[R] Some tcltk-related packages not loading (OS X)

Peter Dalgaard p.dalgaard at biostat.ku.dk
Tue Jun 27 00:03:26 CEST 2006


Michael Kubovy <kubovy at virginia.edu> writes:

> Dear r helpers,
> 
> In my exploration of the tcltk facilities of R I've had some success  
> but some failures, and wonder if someone could point me to a  
> solution. To begin:
> 
> ******************************************************
>  > sessionInfo()
> Version 2.3.1 (2006-06-01)
> powerpc-apple-darwin8.6.0
> 
> attached base packages:
> [1] "tcltk"     "methods"   "stats"     "graphics"  "grDevices"  
> "utils"     "datasets"  "base"
> 
> other attached packages:
> igraph
> "0.1.2"
> ******************************************************
> A success:
> ******************************************************
>  > library(tcltk)
>  > tt <- tktoplevel()
>  > tkpack(txt.w <- tktext(tt))
> <Tcl>
>  > tkinsert(txt.w, "0.0", "plot(1:10)")
> <Tcl>
>  >
>  > eval.txt <- function()
> +    eval(parse(text=tclvalue(tkget(txt.w, "0.0", "end"))))
>  > tkpack(but.w <- tkbutton(tt,text="Submit", command=eval.txt))
> <Tcl>
>  >
>  > tkdestroy(tt)
> ******************************************************
> An interactive session ran successfully. One failure:
> ******************************************************
>  > library(gtkDevice)

gtk is not related to tcltk. They are essentially different GUI
programming interfaces.

 ....
> ******************************************************
> trying URL 'http://lib.stat.cmu.edu/R/CRAN/src/contrib/ 
> tkrplot_0.0-14.tar.gz'
> Content type 'application/x-gzip' length 38339 bytes
> opened URL
> ==================================================
> downloaded 37Kb
> 
> WARNING: ignoring environment value of R_HOME
> * Installing *source* package 'tkrplot' ...
> configure: creating ./config.status
> config.status: creating src/Makevars
> ** libs
> ** arch - ppc
> gcc-4.0 -arch ppc -I/Library/Frameworks/R.framework/Resources/include  
> -I/Library/Frameworks/R.framework/Resources/include/ppc -I/usr/local/ 
> include -I/usr/local/include -I/usr/local/include   -fPIC -fno- 
> common  -g -O2 -std=gnu99 -c tcltkimg.c -o tcltkimg.o
> gcc-4.0 -arch ppc -flat_namespace -bundle -undefined suppress -L/usr/ 
> local/lib -o tkrplot.so tcltkimg.o -L/usr/local/lib -ltcl8.4 -L/usr/ 
> local/lib -ltk8.4 -L/usr/X11R6/lib -lX11  -L/Library/Frameworks/ 
> R.framework/Resources/lib/ppc -lR
> ** R
> ** help
>  >>> Building/Updating help pages for package 'tkrplot'
>       Formats: text html latex example
>    TkRplot                           text    html    latex   example
> ** building package indices ...
> * DONE (tkrplot)
> 
> The downloaded packages are in
> 	/private/tmp/RtmpjNWS1J/downloaded_packages
> ******************************************************
> But:
> ******************************************************
>  > 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'

Presumably, this means that the "load" command in Tcl is not happy
loading tkrplot.so as generated by the 2nd gcc-4.0 command above. For
a non-Mac-guru like me this raises a few questions: Is .so really the
right extension? Is a special processing step needed for Mac OSX?
However, better leave this for real Mac gurus...

-- 
   O__  ---- Peter Dalgaard             Øster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark          Ph:  (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)                  FAX: (+45) 35327907



More information about the R-help mailing list