From mark_komarinski at hms.harvard.edu  Wed Dec 19 21:19:05 2007
From: mark_komarinski at hms.harvard.edu (Mark Komarinski)
Date: Wed, 19 Dec 2007 15:19:05 -0500
Subject: [Rd] Problem compiling R 3.6.1 on POWER 570 system
Message-ID: <47697CB9.5020407@hms.harvard.edu>

I've for a RHEL 4 box on a P570 system.  My end user wants to have a 
64-bit version of R compiled due to the large amount of memory they 
require (this image has 16GB allocated to it).

I can compile R fine in 32-bit mode, but it can't use more than 2.4GB of 
RAM before it falls over and dies.

Compiling in 64-bit mode for POWER systems "should" be as easy as adding 
a CFLAGS="-m64" FFLAGS="-m64" ./configure --without-x .

It's not, and unfortunately I'm at a loss to what the problem is. 
Here's the last few lines of the above configure command:

checking for Fortran 77 libraries of g77...  -L/usr/local/lib64 
-L/usr/lib/gcc/ppc64-redhat-linux/3.4.6/64 
-L/usr/lib/gcc/ppc64-redhat-linux/3.4.6 
-L/usr/lib/gcc/ppc64-redhat-linux/3.4.6/../../../../lib64 
-L/usr/lib/gcc/ppc64-redhat-linux/3.4.6/../../.. -L/lib/../lib64 
-L/usr/lib/../lib64 -lfrtbegin -lg2c -lm -lgcc_s_64
checking how to get verbose linking output from gcc -std=gnu99... -v
checking for C libraries of gcc -std=gnu99...  -L/usr/local/lib64 
-L/usr/lib/gcc/ppc64-redhat-linux/3.4.6/64 
-L/usr/lib/gcc/ppc64-redhat-linux/3.4.6 
-L/usr/lib/gcc/ppc64-redhat-linux/3.4.6/../../../../lib64 
-L/usr/lib/gcc/ppc64-redhat-linux/3.4.6/../../.. -L/lib/../lib64 
-L/usr/lib/../lib64 -lgcc_s_64
checking for dummy main to link with Fortran 77 libraries... none
checking for Fortran 77 name-mangling scheme... lower case, underscore, 
extra underscore
checking whether g77 appends underscores to external names... yes
checking whether g77 appends extra underscores to external names... yes
checking whether mixed C/Fortran code can be run... configure: WARNING: 
cannot run mixed C/Fortran code
configure: error: Maybe check LDFLAGS for paths to Fortran libraries?

Here's what looks to be the relevant part from config.log:
configure:32383: checking whether mixed C/Fortran code can be run
/usr/bin/ld: skipping incompatible 
/usr/lib/gcc/ppc64-redhat-linux/3.4.6/libgcc_s_64.so when searching for 
-lgcc_s_64
/usr/bin/ld: skipping incompatible 
/usr/lib/gcc/ppc64-redhat-linux/3.4.6/libgcc_s_64.so when searching for 
-lgcc_s_64
/usr/bin/ld: cannot find -lgcc_s_64
collect2: ld returned 1 exit status
configure:32447: WARNING: cannot run mixed C/Fortran code
configure:32449: error: Maybe check LDFLAGS for paths to Fortran libraries?

This implies that configure is compiling the code in 32 bit mode (which 
is why it's skipping libgcc_s_64.o

I guess my questions are: has anyone compiled this for this system?  And 
if so, how did you do it?

-Mark

-- 
Mark Komarinski				mark_komarinski at hms.harvard.edu
Sr. Research Systems Architect		http://ritg.med.harvard.edu
Research IT Group
Harvard Medical School



[Rd] Problem compiling R 3.6.1 on POWER 570 system
Mark Komarinski