[R-SIG-Mac] tkrplot failure to load

Luke Tierney luke at stat.uiowa.edu
Tue Aug 15 13:14:56 CEST 2006


Thanks.  A more complete fix, suggested to me off list, is to use
.Platform$r_arch rather than hard-coding ppc.  New version should be
on cran before too long.

Best,

luke

On Tue, 15 Aug 2006, Diego Diez wrote:

> Hello, Im having problems loading the tkrplot package in MacOSX and
> found a workaround, though I dont know how to make a "generic" patch
> for all platforms. Here is some info:
>
> > library(tkrplot)
> Loading required package: tcltk
> Loading Tcl/Tk interface ... done
> Error in structure(.External("dotTcl", ..., PACKAGE = "tcltk"), class
> = "tclObj") :
> 	[tcl] image not found
> NSCreateObjectFileImageFromFile() error: not a Mach-O MH_BUNDLE file.
> Error in library(tkrplot) : .First.lib failed for 'tkrplot'
> > sessionInfo()
> Version 2.3.1 (2006-06-01)
> powerpc-apple-darwin8.6.0
>
> attached base packages:
> [1] "tcltk"     "methods"   "stats"     "graphics"  "grDevices"
> "utils"     "datasets"
> [8] "base"
>
>
> The tkrplot packages is installed in the following directory:
>
> /Library/Frameworks/R.framework/Resources/library/tkrplot
>
> with the relevant files being:
>
> /Library/Frameworks/R.framework/Resources/library/tkrplot/R/tkrplot
> /Library/Frameworks/R.framework/Resources/library/tkrplot/libs/ppc/
> tkrplot.so
>
> in tkrplot file:
>
> .First.lib <- function(lib, pkg) {
>     if (! .Tkrplot.loaded) {
>         chname<-"tkrplot"
>         file.ext <- .Platform$dynlib.ext
>         path <- file.path("libs", paste(chname, file.ext, sep = ""))
>         file <- system.file(path, package = pkg, lib.loc = lib)[1]
>         .Tcl(paste("load", file, "Rplot"))
>         .Tkrplot.loaded <<- TRUE
>     }
> }
>
> it fails because the "file" variable returns "". This is because
> "path" variable is "../libs/tkrplot.so" and it should be "../libs/ppc/
> tkrplot.so". If I make this change:
>
> chname<-"tkrplot"
> -----------------
> chname<-"ppc/tkrplot"
>
> then it works fine:
>
> > library(tkrplot)
> Loading required package: tcltk
> Loading Tcl/Tk interface ... done
>
>
> I don't know if the file tkrplot.so should be under "libs" directory
> instead of "ppc/libs" or if the call to .First.lib should take into
> account the architecture.
>
> By the way, this "patch" works.
>
> Best.
>
> Diego.
>
> _______________________________________________
> R-SIG-Mac mailing list
> R-SIG-Mac at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-mac
>

-- 
Luke Tierney
Chair, Statistics and Actuarial Science
Ralph E. Wareham Professor of Mathematical Sciences
University of Iowa                  Phone:             319-335-3386
Department of Statistics and        Fax:               319-335-3017
    Actuarial Science
241 Schaeffer Hall                  email:      luke at stat.uiowa.edu
Iowa City, IA 52242                 WWW:  http://www.stat.uiowa.edu



More information about the R-SIG-Mac mailing list