Kostas Oikonomou
2010-Mar-22 15:53 UTC
[Rd] some fixes for R 2.01.1 on OpenSolaris using Sun Studio compilers
Hello, 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 instructions. =============================================== 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 make 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 compiler. ## Also, to be defensive there should be a similar test with SHLIB_LD ## 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 --enable-R-shlib --with-libintl-prefix=/opt/lib CC=cc CFLAGS='-O -m64 -xarch=native' CPPFLAGS=-I/opt/lib/include 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' R_BROWSER=opera R_PDFVIEWER=evince 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 ====================================================== Regards, Kostas Oikonomou
Prof Brian Ripley
2010-Mar-22 16:51 UTC
[Rd] some fixes for R 2.01.1 on OpenSolaris using Sun Studio compilers
On Mon, 22 Mar 2010, Kostas Oikonomou wrote:> Hello, > > 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 instructions.Do you mean the R-admin manual? Your 'updates' all seem to be failures to follow that manual.> ===============================================> > 0. GNU libiconv and GNU gettext are assumed to be in /opt/lib.Assumed by whom? Not by our manual.> 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 > make > pfexec make installWhy do you do this rather than use R's included gettext?> 1. export PATH=/opt/lib/bin:$PATH > > 2. Edit R's configure in *three* places to add the 2nd ${CFLAGS} below:No, please don't: rather RTFM. The R-admin manual has things like CC="gcc -m64" and it seems you needed CC="cc -m64 -xarch=native" If you need specific options to run a compiler, they are part of CC (and so on) and not CFLAGS.> 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 compiler. > ## Also, to be defensive there should be a similar test with SHLIB_LD > ## 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 --enable-R-shlib > --with-libintl-prefix=/opt/lib > CC=cc CFLAGS='-O -m64 -xarch=native' CPPFLAGS=-I/opt/lib/include > 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' > R_BROWSER=opera R_PDFVIEWER=evince > > > 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 > > ======================================================> > > Regards, > > Kostas Oikonomou > > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel >-- 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
Jens Elkner
2010-Mar-22 21:16 UTC
[Rd] some fixes for R 2.01.1 on OpenSolaris using Sun Studio compilers
On Mon, Mar 22, 2010 at 11:53:32AM -0400, Kostas Oikonomou wrote: Hi,> 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 > instructions.First: Since no patches are listed, check the results of the Eigen* tests: I assume, that at least one fails ...> ===============================================> > 0. GNU libiconvWell, that's a matter of taste. I prefer SUN's libiconv.> and GNU gettext are assumed to be in /opt/lib.There is no need to clutter the system with another one ...> 2. Edit R's configure in *three* places to add the 2nd > ${CFLAGS} below:If one needs to change stuff in configure, one should make the change in the configure.ac or m4/*m4 file and autoreconf ... Hacking the configure script itself is a bad idea and often has un-intended side effects ... Just to pass standard flags, use the environment vars mentioned in the R manual ...> 4. configure --prefix=/opt/R/2.10.1 --disable-nls > --enable-R-shlib > --with-libintl-prefix=/opt/lib > CC=cc CFLAGS='-O -m64 -xarch=native' > CPPFLAGS=-I/opt/lib/include > LDFLAGS='-m64 -L/opt/lib/lib -R/opt/lib/lib' > LIBS=-liconv CXX=CC CXXFLAGS='-O -m64 -xarch=native'This is not really sufficient because the very old standard libCstd would be used by CC. With the stlport library most C++ stuff can be compiled, but there are still some more or less g++ specific cases, where CC fails ... Also note that [Open]Solaris is on the way to establish the Apache stdc++ library as the system's default standard C++ library ... (OT: Always wondering, what the term 'standard' means in the C++ world at all ;-))> F77=f95 FFLAGS='-O -m64 -xarch=native' > R_BROWSER=opera R_PDFVIEWER=evinceNailing the users to a certain browser or pdf viewer is a very bad idea - they'll hate you. For Freedesktop compliant Desktop Environments like GNOME or KDE use xdg-open instead, which honors the user's preferences.> 5. The results of running the tests:As said - check the test output, where Eigen* is used (or was it another R package? - don't remember exactly ... ). To get it work and get better performance, I'm using the SUN performance libraries for blas/lapack stuff. To get an idea, you might have a look at http://iws.cs.uni-magdeburg.de/~elkner/R/Build.sh (the script I use to build the R package). Have fun, jel. -- Otto-von-Guericke University http://www.cs.uni-magdeburg.de/ Department of Computer Science Geb. 29 R 027, Universitaetsplatz 2 39106 Magdeburg, Germany Tel: +49 391 67 12768