From jel+r at cs.uni-magdeburg.de  Mon Mar 22 22:16:13 2010
From: jel+r at cs.uni-magdeburg.de (Jens Elkner)
Date: Mon, 22 Mar 2010 22:16:13 +0100
Subject: [Rd] some fixes for R 2.01.1 on OpenSolaris using Sun Studio
	compilers
In-Reply-To: <4BA7927C.1010705@research.att.com>
References: <4BA7927C.1010705@research.att.com>
Message-ID: <20100322211613.GA1423@trex.cs.uni-magdeburg.de>

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 libiconv

Well, 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=evince

Nailing 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



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