[Rd] some fixes for R 2.01.1 on OpenSolaris using Sun Studio compilers

Kostas Oikonomou ko at research.att.com
Mon Mar 22 16:53:32 CET 2010


I recently built a 64-bit R 2.10.1 on OpenSolaris using the 
Sun Studio 12.1 compilers.   I would like to contribute the 
following notes, to update the OpenSolaris installation 


0. GNU libiconv and GNU gettext are assumed to be in /opt/lib.

     GNU libiconv is easy to build from source.  After 
building it, configure gettext like this:

     configure --prefix=/opt/lib --with-included-gettext 
CC=cc CFLAGS=-m64   LDFLAGS=-lsec
    pfexec make install

1. export PATH=/opt/lib/bin:$PATH

2. Edit R's configure in *three* places to add the 2nd 
${CFLAGS} below:

if ${CC} ${CFLAGS} -c conftest.c 1>&5 2>&5; then
   ## <NOTE>
   ## This should really use MAIN_LD, and hence come after 
this is
   ## determined (and necessary additions to MAIN_LDFLAGS 
were made).
   ## But it seems that we currently can always use the C 
   ## Also, to be defensive there should be a similar test 
   ## and SHLIB_LDFLAGS (and note that on HPUX with native 
cc we have to
   ## use ld for SHLIB_LD) ...
   if ${CC} ${CFLAGS} ${LDFLAGS} ${MAIN_LDFLAGS} -o 
conftest${ac_exeext} \
        conftest.${ac_objext} conftestf.${ac_objext} ${FLIBS} \
        ${LIBM} 1>&5 2>&5;
   ## </NOTE>

4. configure --prefix=/opt/R/2.10.1 --disable-nls 
CC=cc CFLAGS='-O -m64 -xarch=native' 
LDFLAGS='-m64 -L/opt/lib/lib -R/opt/lib/lib'
LIBS=-liconv CXX=CC CXXFLAGS='-O -m64 -xarch=native'
F77=f95 FFLAGS='-O -m64 -xarch=native'

5. The results of running the tests:

    cd tests.
    make test-Examples  Ok
    make test-Specific  Ok
    make test-Reg
    	running tests of plotting Latin-1
	expect failure or some differences if not in a Latin or 
UTF-8 locale
	running code in 'reg-plot-latin1.R' ... FAILED
    make test-Demo      Ok
    make test-Random    Ok
    make test-Internet  Ok



				Kostas Oikonomou

More information about the R-devel mailing list