From l.bartnik at gmail.com  Wed May 27 11:35:10 2009
From: l.bartnik at gmail.com (l.bartnik at gmail.com)
Date: Wed, 27 May 2009 11:35:10 +0200 (CEST)
Subject: [Rd] R package installation (PR#13726)
Message-ID: <20090527093510.E70DB2832188@mail.pubhealth.ku.dk>

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

* 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



[Rd] R package installation (PR#13726)
l.bartnik at gmail.com