Skip to content

(no subject)

8 messages · Jake Michaelson, Brian Ripley, Göran Broström

#
I've been using R for a while under Mac OS X, which thanks to the R  
on OS X developers, is probably the best platform for learning R.  I  
recently built a Linux box with a Pentium D processor, and am running  
an AMD64 port of Ubuntu with the SMP kernel.

After setting up the basics on the box, I thought I'd install R as  
well. I've had a very hard time finding good documentation on some  
configure flags/options for compiling a 64-bit version of R on  
Linux.  I thought this was very strange, considering Linux is  
apparently the R developer's platform of choice.

Can anyone point me to some good build instructions for 64-bit R  
under Linux?  Should I compile it against any additional libraries  
for better performance?

Thanks in advance for any pointers.

--Jake
#
We find it equally strange that you posted this!

The advice _is_ in the R-admin manual which the INSTALL file asks you to 
read if you have any questions.  It covers using enhanced BLAS libraries.

R builds out of the box on FC3, FC4 and Suse on AMD64.  I use Goto's BLAS, 
but ATLAS can be used (except that building a shared version is tricky).

Quite a few packages have been written in ways that stop them building on 
64-bit platforms (and the maintainers have been informed but not fixed 
them).
On Mon, 1 Aug 2005, Jacob Michaelson wrote:

            

        

  
    
#
On Tue, Aug 02, 2005 at 07:34:39AM +0100, Prof Brian Ripley wrote:
Incidentally, I have just tried building R on a Fujitsu Amilo amd64 with
debian-amd64 (unstable) and ATLAS. Both 'make' and 'make check' worked
without complaints with gcc-3.4.5, but when I tried gcc-4.0.1, 'make check' 
failed with a segmentation error after
-----------------------------------------------------------------------------
R is now configured for x86_64-unknown-linux-gnu

  Source directory:          .
  Installation directory:    /usr/local

  C compiler:                /usr/bin/gcc-4.0  -g -O2
  C++ compiler:              /usr/bin/g++-4.0  -g -O2
  Fortran compiler:          /usr/bin/gfortran-4.0  -g -O2

  Interfaces supported:      X11, tcltk
  External libraries:        readline, BLAS(ATLAS)
  Additional capabilities:   PNG, JPEG, iconv, MBCS, NLS
  Options enabled:           R profiling

  Recommended packages:      yes
-------------------------------------------------------------------
amilo:/usr/local/src/R/R-2.1.1# make check
make[1]: Entering directory `/usr/local/src/R/R-2.1.1/tests'
make[2]: Entering directory `/usr/local/src/R/R-2.1.1/tests'
make[3]: Enteri|ng directory `/usr/local/src/R/R-2.1.1/tests/Examples'
make[4]: Entering directory `/usr/local/src/R/R-2.1.1/tests/Examples'
make[4]: Leaving directory `/usr/local/src/R/R-2.1.1/tests/Examples'
make[4]: Entering directory `/usr/local/src/R/R-2.1.1/tests/Examples'
collecting examples for package 'base' ...
make[5]: Entering directory `/usr/local/src/R/R-2.1.1/src/library'
 >>> Building/Updating help pages for package 'base'
     Formats: text html latex example
make[5]: Leaving directory `/usr/local/src/R/R-2.1.1/src/library'
running code in 'base-Ex.R' .../bin/sh: line 1:  9010 Segmentation fault      ../../bin/R --vanilla <base-Ex.R >base-Ex.Rout 2>&1
make[4]: *** [base-Ex.Rout] Error 1
make[4]: Leaving directory `/usr/local/src/R/R-2.1.1/tests/Examples'
make[3]: *** [test-Examples-Base] Error 2
make[3]: Leaving directory `/usr/local/src/R/R-2.1.1/tests/Examples'
make[2]: *** [test-Examples] Error 2
make[2]: Leaving directory `/usr/local/src/R/R-2.1.1/tests'
make[1]: *** [test-all-basics] Error 1
make[1]: Leaving directory `/usr/local/src/R/R-2.1.1/tests'
make: *** [check] Error 2
[,1] [,2]
[1,] 0+0i 0-1i
[2,] 0+1i 0+0i

Running it under 'R -d gdb': R "hangs"; after C-c:

Program received signal SIGINT, Interrupt.
zhetd2_ (uplo=@0x7fffff92ebbe, n=@0x7fffff92e9f4, a=0x10900f0,
    lda=@0x7fffff92ebb8, d=0x13b06e8, e=0xb6add8, tau=0x1bb6448,
    info=@0x7fffff92ea04, _uplo=1) at cmplx.f:8330
8330                   CALL ZAXPY( N-I, ALPHA, A( I+1, I ), 1, TAU( I ), 1 )
Current language:  auto; currently fortran
-----------------------------------------------------------------------

[...]

G??ran
#
On Tue, 2 Aug 2005, G?ran Brostr?m wrote:

            
There is no gcc 3.4.5!  There are versions 3.3.5 and 3.4.4.
I have seen this on FC3.  Note that ZAXPY is a BLAS routine, and you are 
using ATLAS: was that also built with gcc-4.0.1?  On FC3 I get the failure 
if I use its BLAS, and not if I configure R with --without-blas.  (I did 
not see the problem using the gcc4 RPM from FC3 update, and I gather 
others have managed to use gcc4 from FC4.)

We do not recommend gcc-4.0.x as yet: we have yet to see any performance 
gains (only losses) from it, and this is one of a number of known 
nuisances.  More serious are places where it apparently generates 
incorrect code and so gives incorrect answers.

...

  
    
#
On Tue, Aug 02, 2005 at 09:33:45AM +0100, Prof Brian Ripley wrote:
[...]
I apologize for the incomplete description; gcc -v gives:

gcc version 3.4.5 20050706 (prerelease) (Debian 3.4.4-5)
Probably not; I just 'apt-get install'ed atlas3-base etc. I'll build atlas
from source and try again.
OK. An additional advantage with gfortran(-4.x) will be the possibility to
use fortan95 code, n'est ce pas?

G??ran
#
On Tue, 2 Aug 2005, G?ran Brostr?m wrote:

            
Some Fortran95 code, anyway.  (It is not yet a complete implementation.)

The problems we are seeing with gcc4 are mainly (but not 
entirely) with gfortran: it seems not quite ready for production use.
-4.0.1 is already a considerable improvement over -4.0.0.

There is another project (www.g95.org) that is using a slightly different 
version of these sources, and either g95 or gfortran can be used with 
gcc3 if you want to use F95 sources.  However, F95 is unlikely to be 
suitable for use in distributed R packages for a long time to come.
#
On Tue, Aug 02, 2005 at 10:58:31AM +0100, Prof Brian Ripley wrote:

            
Thanks; I'll stick to 3.4.4(!) and f77 for the time being.

G??ran