[R] Installing rgl in R2.0.1

Prof Brian Ripley ripley at stats.ox.ac.uk
Mon Nov 22 09:34:18 CET 2004


On Sun, 21 Nov 2004, Duncan Murdoch wrote:

> On Mon, 22 Nov 2004 13:10:59 +1300 (NZDT), "Richard A. O'Keefe"
> <ok at cs.otago.ac.nz> wrote:
>
>> I'm running R2.0.1 under Solaris 2.9 on a SunBlade 100.
>> When I installed it, I set things up to use the Sun compilers
>> cc, CC, f95 with the options recommended in the installation and
>> administration guide.
>>
>> Until today, no worries.
>>
>> With all this discussion about R GUIs I thought I'd give R Commander a go.
>> The web page said to install a bunch of packages first, so I did
>>> install.packages(c("abind", "car", "effects", "lmtest", "multcomp",
>> + "mvtnorm", "relimp", "rgl", "sandwich", "strucchange", "zoo"),
>> + dependencies = TRUE)
>>
>> Again, all went well up to a certain point.  That point was rgl.
>>
>> * Installing *source* package 'rgl' ...
>> checking build system type... sparc-sun-solaris2.9
>> checking host system type... sparc-sun-solaris2.9
>> checking for gcc... gcc
>> checking for C compiler default output file name... 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 for gcc option to accept ANSI C... none needed
>> checking how to run the C preprocessor... gcc -E
>> checking for X... libraries /usr/openwin/lib, headers /usr/openwin/include
>>
>> checking for libpng-config... yes
>> configure: creating ./config.status
>> config.status: creating src/Makevars
>> ** libs
>> CC -I/users/local/lib/R/include -I/usr/openwin/include -DHAVE_PNG_H -I/usr/local/include  -Wall -pedantic -fno-exceptions -fno-rtti -KPIC  -xO4 -xlibmil -dalign -c x11lib.cpp -o x11lib.o
>> CC: Warning: Option -Wall passed to ld, if ld is invoked, ignored otherwise
>> CC: Warning: Option -pedantic passed to ld, if ld is invoked, ignored otherwise
>> CC: Warning: Option -fno-exceptions passed to ld, if ld is invoked, ignored otherwise
>> ...
>> erwise
>> CC: Warning: Option -fno-rtti passed to ld, if ld is invoked, ignored otherwise
>> CC -G -L/usr/local/lib -o rgl.so x11lib.o x11gui.o types.o math.o fps.o pixmap.o gui.o api.o device.o devicemanager.o rglview.o scene.o glgui.o -L/usr/openwin/lib -L/users/local/lib -R/users/local/lib -lpng12 -lz -lm -lstdc++ -lX11 -lXext -lGL -lGLU -lpng12 -lz -lm
>> ld: fatal: library -lstdc++: not found
>> ld: fatal: File processing errors. No output written to rgl.so
>> *** Error code 1
>> make: Fatal error: Command failed for target `rgl.so'
>> ERROR: compilation failed for package 'rgl'
>>
>> Previous packages figured out from whatever information the R installation
>> squirrelled away that they should use f95 (not g77) and cc (not gcc) and
>> provided sensible options.  However, the rgl installation has decided to
>> do its own configuration, and has decided to use gcc.  That would probably
>> work, except that it is mixing up the Sun C++ compiler (CC) with the Gnu
>> command line options (-Wall -pedantic -fno-exceptions .....) AND the Sun
>> command line options (-xO4 -xlibmil -dalign).
>>
>> All my attempts to follow the
>> http://wsopuppenkiste.wiso.uni-goettingen.de/~dadler/rgl
>> link on the rgl catalogue card at CRAN have failed.
>>
>> - Did I do something wrong?
>> - What if anything can I do about it?
>
> I don't think you did anything wrong, but I don't know what you can do
> to fix it.  uni-goettingen.de hasn't been responding for a few days.

This is quite a common error in user-written configure scripts.  (To see 
how it should be done look at e.g. foreign.  A quick look suggests more 
scripts are wrong than right.)

The way to fix it for now is to remove rgl/configure and create 
rgl/src/Makevars by hand.

The configuration is not right even for gcc/g++.  It should not be adding
-lstdc++ for example, and things like

## C language

CPPFLAGS=""
CFLAGS="-Wall -pedantic"


## C++ language

LIBS="-lstdc++"
CXXFLAGS="${CFLAGS} -fno-exceptions -fno-rtti"

are inappropriate.

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595




More information about the R-help mailing list