[Rd] compile 2.4.1 for linux on power cpus

Andrew Ferris aferris at mrl.ubc.ca
Thu Mar 15 21:51:05 CET 2007

I'm closer but still not quite there. Here's the configure command I'm using:

 ./configure 'CC=gcc -m64' 'CXX=g++ -m64 -mminimal-toc' 'FC=gfortran -mc64 -fno-optimize-sibling-calls' 'F77=gfortran -m64 -fno-optimize-sibling-calls' 'LDFLAGS=-L/usr/lib64' R_PAPERSIZE='letter'

I'm using the -mminimal-toc and -fno-optimize-sibling-calls flags because of this error during make:

/usr/bin/ld: ../nmath/libnmath.a(gamma.o)(.text+0xf4): sibling call optimization to `Rf_chebyshev_eval' does not allow automatic multiple TOCs; recompile with -mminimal-toc or -fno-optimize-sibling-calls, or make `Rf_chebyshev_eval' extern
/usr/bin/ld: ../nmath/libnmath.a(gamma.o)(.text+0x270): sibling call optimization to `Rf_stirlerr' does not allow automatic multiple TOCs; recompile with -mminimal-toc or -fno-optimize-sibling-calls, or make `Rf_stirlerr' extern
/usr/bin/ld: ../nmath/libnmath.a(gamma.o)(.text+0x34c): sibling call optimization to `Rf_lgammacor' does not allow automatic multiple TOCs; recompile with -mminimal-toc or -fno-optimize-sibling-calls, or make `Rf_lgammacor' extern
/usr/bin/ld: final link failed: Bad value
collect2: ld returned 1 exit status
make[3]: *** [R.bin] Error 1
make[3]: Leaving directory `/usr/local/R-2.4.1/src/main'
make[2]: *** [R] Error 2
make[2]: Leaving directory `/usr/local/R-2.4.1/src/main'
make[1]: *** [R] Error 1
make[1]: Leaving directory `/usr/local/R-2.4.1/src'
make: *** [R] Error 1

But those flags aren't helping as those errors persist. Is there anything else I can do?


Andrew Ferris
Network Support Analyst
iCAPTURE Research Centre
University of British Columbia

>>> Prof Brian Ripley <ripley at stats.ox.ac.uk> 03/15/07 12:11 AM >>>
On Thu, 15 Mar 2007, Peter Dalgaard wrote:

> Andrew Ferris wrote:
>> Peter,
>> First off, as you may have guessed, I don't compile many 64 bit programs so thanks again for the help. I'll revert back to powerpc64-unknown-linux-gnu which is the default for -build and -host.
>> Here's the gcc information
>> [hostname]:/ # which gcc
>> /usr/bin/gcc
>> [hostname]:/ # gcc -dumpmachine
>> powerpc64-suse-linux
>> From looking at the GNU documentation for GCC  - IBM RS/6000 and PowerPC Options, I see that it mentions this option:
>> -m64
>> Generate code for 32-bit or 64-bit environments of Darwin and SVR4 targets (including GNU/Linux). The 32-bit environment sets int, long and pointer to 32 bits and generates code that runs on any PowerPC variant. The 64-bit environment sets int to 32 bits and long and pointer to 64 bits, and generates code for PowerPC64, as for -mpowerpc64.
>> So would some compiler flags such as these work:
>> 'CC=gcc -m64' 'CXX=g++ -m64' 'FC=gfortran -mc64' 'F77=gfortran -m64' 'LDFLAGS=-L/lib64'
> That's likely. Or use CFLAGS=-m64, and FFLAGS, CXXFLAGS similarly.

The CC etc forms are preferred, as not all configure scripts use the 
environment CFLAGS.

See the Solaris 64-bit notes in the R-admin manual for proven examples.

> I'd try compiling a simple hello.c program first. Try e.g. "gcc -m64
> hello.c" and see what "file a.out" has to say about the result.
> You may also find yourself having to install a number of packages  with
> names like foo-64bit_xx.yy to get 64bit C libraries, but configure
> should tell you about any missing bits in due course, once you have it
> convinced not to build for 32bit.
> ______________________________________________
> 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

This electronic message is intended only for the use of the addressee and may contain information that is privileged and confidential.  Any dissemination, distribution or copying of this communication by unauthorized individuals is strictly prohibited. If you have received this communication in error, please notify the sender immediately by reply e-mail and delete the original and all copies from your system.

More information about the R-devel mailing list