Closed MichaelChirico closed 4 years ago
NOTES: This is about installing a package with F90 code on a non-standard architecture.
User error: The user forgot to specify -m32 for FC.
Audit (from Jitterbug): Wed May 27 09:57:42 2009 ripley changed notes Wed May 27 09:57:42 2009 ripley moved from incoming to System-specific-fixed
From: Prof Brian Ripley <ripley@<::CENSORED -- SEE ORIGINAL ON BUGZILLA::>> This is a problem in your specification to R of the peculiarities of your system, not in R itself. You have only specified some of the settings you need, and in particular as you are using Fortran 90 code and a shared R library you need more than a typical user would.
On Wed, 27 May 2009, l.bartnik@<::CENSORED -- SEE ORIGINAL ON BUGZILLA::> wrote:
Full_Name: Lukasz Andrzej Bartnik
Version: 2.8.1
Not current.
OS: RHELS 5.2
Submission from: (NULL) (194.181.94.250)
Compile R for 32 bit on a 64 bit machine:
unset LD_LIBRARY_PATH
unset R_LD_LIBRARY_PATH
export CC="gcc -m32"
export CXXFLAGS="-m32 -O2 -g"
export FFLAGS="-m32 -O2 -g"
export FCFLAGS="-m32 -O2 -g"
export OBJCFLAGS="-m32 -O2 -g"
export LIBnn=lib
Copied I suppose from the R-admin manual (without credit)? The current version suggests
CC="gcc -m32" F77="gfortran -m32" FC=$(F77) CXX="gcc -m32" OBJC=$(CC) LIBnn=lib
which I suspect you will find more successful. However, you seem not to have studied the file config.site, which lists many settings you may need to specify. Reading there, it seems that either SHLIB_FCLD="gfortran -m32" or SHLIB_FCLDFLAGS="-shared -m32" would be appropriate.
./configure --with-x=no --enable-R-shlib --prefix=/prefix
Now try to install a package which has Fortran files inside:
Hmm, has Fortran 90 files inside: these do not use the same settings as 'Fortran'.
/prefix/bin/R CMD INSTALL crawl_1.0-4.tar.gz
* Installing to library '/prefix/lib/R/library'
* Installing *source* package 'crawl' ...
** libs
gfortran -fpic -m32 -O2 -g -c crwDriftN2ll.f90 -o crwDriftN2ll.o
gfortran -fpic -m32 -O2 -g -c crwDriftPredict.f90 -o crwDriftPredict.o
gfortran -fpic -m32 -O2 -g -c crwN2ll.f90 -o crwN2ll.o
gfortran -fpic -m32 -O2 -g -c crwPredict.f90 -o crwPredict.o
gfortran -shared -L/usr/local/lib -o crawl.so crwDriftN2ll.o
crwDriftPredict.o
crwN2ll.o crwPredict.o -L/prefix/lib/R/lib -lR
/usr/bin/ld: skipping incompatible /prefix/lib/R/lib/libR.so when searching
for
-lR
/usr/bin/ld: cannot find -lR
collect2: ld returned 1 exit status
make: *** [crawl.so] Error 1
ERROR: compilation failed for package 'crawl'
** Removing '/prefix/lib/R/library/crawl'
** Restoring previous '/prefix/lib/R/library/crawl'
This error can be avoided if /prefix/lib/R/etc/Makeconf is modified:
Remove: SHLIB_FCLD = gfortran
Insert: SHLIB_FCLD = gfortran -m32
______________________________________________
R-devel@<::CENSORED -- SEE ORIGINAL ON BUGZILLA::>-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
-- Brian D. Ripley, ripley@<::CENSORED -- SEE ORIGINAL ON BUGZILLA::> Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ <CENSORING FROM DETECTED PHONE NUMBER ONWARDS; SEE BUGZILLA>
From: l.bartnik@<::CENSORED -- SEE ORIGINAL ON BUGZILLA::> Full_Name: Lukasz Andrzej Bartnik Version: 2.8.1 OS: RHELS 5.2 Submission from: (NULL) (194.181.94.250)
Compile R for 32 bit on a 64 bit machine:
unset LD_LIBRARY_PATH unset R_LD_LIBRARY_PATH export CC="gcc -m32" export CXXFLAGS="-m32 -O2 -g" export FFLAGS="-m32 -O2 -g" export FCFLAGS="-m32 -O2 -g" export OBJCFLAGS="-m32 -O2 -g" export LIBnn=lib
./configure --with-x=no --enable-R-shlib --prefix=/prefix
Now try to install a package which has Fortran files inside:
/prefix/bin/R CMD INSTALL crawl_1.0-4.tar.gz
This error can be avoided if /prefix/lib/R/etc/Makeconf is modified:
Remove: SHLIB_FCLD = gfortran Insert: SHLIB_FCLD = gfortran -m32
METADATA