Looking at the .FirstLib code of rgl I saw
.First.lib <- function(lib, pkg)
{
# For MacOS X we have to remove /usr/X11R6/lib from the
DYLD_LIBRARY_PATH
# because it would override Apple's OpenGL framework
Sys.putenv("DYLD_LIBRARY_PATH"=sub("/usr/X11R6/
lib","",Sys.getenv("DYLD_LIBRARY_PATH")))
# load shared library
library.dynam( "rgl", pkg, lib)
ret <- .C( symbol.C("rgl_init"),
success=FALSE
)
if (!ret$success) {
dyn.unload( file.path( libpath, "libs", paste( "rgl",
.Platform$dynlib.ext, sep="") ) )
stop("error rgl_init")
}
}
If I suppress the line starting with Sys.putenv ("....
than I get the same error as you.
If I leave as it is, I simply cannot load the library.
stefano
On Marted?, giu 3, 2003, at 00:27 Europe/Rome, Anestis Antoniadis wrote:
Well it doesn't work for me (xterm or not). Here is what I have: [liontari:~] anestisa% sudo R CMD INSTALL /Users/anestisa/Desktop/rgl_0.64-5.tar.gz * Installing *source* package 'rgl' ... checking build system type... powerpc-apple-darwin6.6 checking host system type... powerpc-apple-darwin6.6 checking for gcc... gcc checking for C compiler default output... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking how to run the C preprocessor... gcc -E checking for X... libraries /usr/X11R6/lib, headers /usr/X11R6/include checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking png.h usability... no checking png.h presence... no checking for png.h... no configure: creating ./config.status config.status: creating src/Makefile config.status: creating src/Makevars ** libs g++ -no-cpp-precomp -I/usr/local/lib/R/include -I/System/Library/Frameworks/Open GL.framework/Headers -DDarwin -DNO_GL_PREFIX -I/usr/X11R6/include -I/sw/include -I/usr/local/include -fno-exceptions -fno-rtti -fno-common -g -O2 -c types.cp p -o types.o cc1plus: warning: changing search order for system directory "/usr/local/include" cc1plus: warning: as it has already been specified as a non-system directory g++ -no-cpp-precomp -I/usr/local/lib/R/include -I/System/Library/Frameworks/Open GL.framework/Headers -DDarwin -DNO_GL_PREFIX -I/usr/X11R6/include -I/sw/include -I/usr/local/include -fno-exceptions -fno-rtti -fno-common -g -O2 -c math.cpp -o math.o cc1plus: warning: changing search order for system directory "/usr/local/include" cc1plus: warning: as it has already been specified as a non-system directory g++ -no-cpp-precomp -I/usr/local/lib/R/include -I/System/Library/Frameworks/Open GL.framework/Headers -DDarwin -DNO_GL_PREFIX -I/usr/X11R6/include -I/sw/include -I/usr/local/include -fno-exceptions -fno-rtti -fno-common -g -O2 -c fps.cpp -o fps.o cc1plus: warning: changing search order for system directory "/usr/local/include" cc1plus: warning: as it has already been specified as a non-system directory g++ -no-cpp-precomp -I/usr/local/lib/R/include -I/System/Library/Frameworks/Open GL.framework/Headers -DDarwin -DNO_GL_PREFIX -I/usr/X11R6/include -I/sw/include -I/usr/local/include -fno-exceptions -fno-rtti -fno-common -g -O2 -c pixmap.c pp -o pixmap.o cc1plus: warning: changing search order for system directory "/usr/local/include" cc1plus: warning: as it has already been specified as a non-system directory g++ -no-cpp-precomp -I/usr/local/lib/R/include -I/System/Library/Frameworks/Open GL.framework/Headers -DDarwin -DNO_GL_PREFIX -I/usr/X11R6/include -I/sw/include -I/usr/local/include -fno-exceptions -fno-rtti -fno-common -g -O2 -c gui.cpp -o gui.o cc1plus: warning: changing search order for system directory "/usr/local/include" cc1plus: warning: as it has already been specified as a non-system directory g++ -no-cpp-precomp -I/usr/local/lib/R/include -I/System/Library/Frameworks/Open GL.framework/Headers -DDarwin -DNO_GL_PREFIX -I/usr/X11R6/include -I/sw/include -I/usr/local/include -fno-exceptions -fno-rtti -fno-common -g -O2 -c api.cpp -o api.o cc1plus: warning: changing search order for system directory "/usr/local/include" cc1plus: warning: as it has already been specified as a non-system directory g++ -no-cpp-precomp -I/usr/local/lib/R/include -I/System/Library/Frameworks/Open GL.framework/Headers -DDarwin -DNO_GL_PREFIX -I/usr/X11R6/include -I/sw/include -I/usr/local/include -fno-exceptions -fno-rtti -fno-common -g -O2 -c device.c pp -o device.o cc1plus: warning: changing search order for system directory "/usr/local/include" cc1plus: warning: as it has already been specified as a non-system directory g++ -no-cpp-precomp -I/usr/local/lib/R/include -I/System/Library/Frameworks/Open GL.framework/Headers -DDarwin -DNO_GL_PREFIX -I/usr/X11R6/include -I/sw/include -I/usr/local/include -fno-exceptions -fno-rtti -fno-common -g -O2 -c devicema nager.cpp -o devicemanager.o cc1plus: warning: changing search order for system directory "/usr/local/include" cc1plus: warning: as it has already been specified as a non-system directory g++ -no-cpp-precomp -I/usr/local/lib/R/include -I/System/Library/Frameworks/Open GL.framework/Headers -DDarwin -DNO_GL_PREFIX -I/usr/X11R6/include -I/sw/include -I/usr/local/include -fno-exceptions -fno-rtti -fno-common -g -O2 -c rglview. cpp -o rglview.o cc1plus: warning: changing search order for system directory "/usr/local/include" cc1plus: warning: as it has already been specified as a non-system directory g++ -no-cpp-precomp -I/usr/local/lib/R/include -I/System/Library/Frameworks/Open GL.framework/Headers -DDarwin -DNO_GL_PREFIX -I/usr/X11R6/include -I/sw/include -I/usr/local/include -fno-exceptions -fno-rtti -fno-common -g -O2 -c scene.cp p -o scene.o cc1plus: warning: changing search order for system directory "/usr/local/include" cc1plus: warning: as it has already been specified as a non-system directory g++ -no-cpp-precomp -I/usr/local/lib/R/include -I/System/Library/Frameworks/Open GL.framework/Headers -DDarwin -DNO_GL_PREFIX -I/usr/X11R6/include -I/sw/include -I/usr/local/include -fno-exceptions -fno-rtti -fno-common -g -O2 -c glgui.cp p -o glgui.o cc1plus: warning: changing search order for system directory "/usr/local/include" cc1plus: warning: as it has already been specified as a non-system directory g++ -no-cpp-precomp -I/usr/local/lib/R/include -I/System/Library/Frameworks/Open GL.framework/Headers -DDarwin -DNO_GL_PREFIX -I/usr/X11R6/include -I/sw/include -I/usr/local/include -fno-exceptions -fno-rtti -fno-common -g -O2 -c x11lib.c pp -o x11lib.o cc1plus: warning: changing search order for system directory "/usr/local/include" cc1plus: warning: as it has already been specified as a non-system directory g++ -no-cpp-precomp -I/usr/local/lib/R/include -I/System/Library/Frameworks/Open GL.framework/Headers -DDarwin -DNO_GL_PREFIX -I/usr/X11R6/include -I/sw/include -I/usr/local/include -fno-exceptions -fno-rtti -fno-common -g -O2 -c x11gui.c pp -o x11gui.o cc1plus: warning: changing search order for system directory "/usr/local/include" cc1plus: warning: as it has already been specified as a non-system directory R CMD SHLIB -o rgl.so types.o math.o fps.o pixmap.o gui.o api.o device.o devicem anager.o rglview.o scene.o glgui.o x11lib.o x11gui.o gcc -bundle -flat_namespace -undefined suppress -L/sw/lib -L/usr/local/lib -o rg l.so types.o math.o fps.o pixmap.o gui.o api.o device.o devicemanager.o rglview. o scene.o glgui.o x11lib.o x11gui.o -framework OpenGL -lstdc++ -L/usr/X11R6/lib -lX11 -lGL -L/usr/local/lib/R/bin -lR ld: warning multiple definitions of symbol _xerbla_ /usr/local/lib/R/bin/libR.dylib(print.lo) definition of _xerbla_ /System/Library/Frameworks/vecLib.framework/Versions/A/ vecLib(ProjectBuilderMast erObjectFile.o) definition of _xerbla_ ld: warning multiple definitions of symbol _BC /sw/lib/libreadline.4.dylib(terminal.so) definition of _BC /sw/lib/libncurses.5.dylib(lib_termcap.lo) definition of _BC ld: warning multiple definitions of symbol _UP /sw/lib/libreadline.4.dylib(terminal.so) definition of _UP /sw/lib/libncurses.5.dylib(lib_termcap.lo) definition of _UP ld: warning multiple definitions of symbol _PC /sw/lib/libreadline.4.dylib(terminal.so) definition of _PC /sw/lib/libncurses.5.dylib(lib_tputs.lo) definition of _PC ** R ** inst ** help
>>> Building/Updating help pages for package 'rgl'
Formats: text html latex example bbox text html latex example bg text html latex example light text html latex maintainer text html latex material text html latex primitive text html latex example rgl-internal text html latex rgl text html latex example scene text html latex snapshot text html latex example spheres text html latex example sprites text html latex example surface text html latex example texts text html latex example viewpoint text html latex example * DONE (rgl) * DONE (INSTALL) [liontari:~] anestisa% R R : Copyright 2003, The R Development Core Team Version 1.7.0 Patched (2003-05-14) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type `license()' or `licence()' for distribution details. R is a collaborative project with many contributors. Type `contributors()' for more information. Type `demo()' for some demos, `help()' for on-line help, or `help.start()' for a HTML browser interface to help. Type `q()' to quit R. [Previously saved workspace restored]
library(rgl)
Error in dyn.load(x, as.logical(local), as.logical(now)) :
unable to load shared library
"/usr/local/lib/R/library/rgl/libs/rgl.so":
dlcompat: dyld: /usr/local/lib/R/bin/R.bin Undefined symbols:
_glArrayElement
_glBegin
_glBindTexture
_glBitmap
_glBlendFunc
_glCallList
_glCallLists
_glClear
_glClearColor
_glClearDepth
_glColor3f
_glColor4fv
_glColor4ubv
_glColorMaterial
_glColorPointe
Error in library(rgl) : .First.lib failed
q()
Save workspace image? [y/n/c]: n ANY HINTS???? ==================================================== Prof. Anestis ANTONIADIS Laboratoire de Modelisation et Calcul(LMC-IMAG) Universite Joseph Fourier Tour IRMA B.P.53 38041 Grenoble CEDEX 9 FRANCE Tel:(33) (0) 476514306 Fax:(33) (0) 476631263 =======================================================