Problem when installing RSPerl on RedHat
I want to run R (the statistical package) from Perl in RedHat Linux. I found online that there is a package called RSPerl that does this job but I have hard time installing it in RedHat. This software requires R to be installed as a shared library. I followed the instructions but I am facing the following problem when (after installing R without problem) I try to install RSPerl.
[root@xxx opt]# R CMD INSTALL -c -l ./ RSPerl_0.92-1.tar.gz
* installing *source* package âRSPerlâ ...
checking for perl... /usr/bin/perl
No support for any of the Perl modules from calling Perl from R.
*****************************************************
Set PERL5LIB to /opt/RSPerl/perl
*****************************************************
Testing: -L/usr/local/lib64/R/lib -lR
Using '/usr/bin/perl' as the perl executable
Perl modules (no):
Adding R package to list of Perl modules to enable callbacks to R from Perl
Creating the C code for dynamically loading modules with native code for Perl: R
modules: R; linking:
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
Support R in Perl: yes
configure: creating ./config.status
config.status: creating src/Makevars
config.status: creating inst/scripts/RSPerl.csh
config.status: creating inst/scripts/RSPerl.bsh
config.status: creating src/RinPerlMakefile
config.status: creating src/Makefile.PL
config.status: creating cleanup
config.status: creating src/R.pm
config.status: creating R/perl5lib.R
making target all in RinPerlMakefile
gcc -std=gnu99 -I/usr/local/lib64/R/include -I. -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -I/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE -DPERL_POLLUTE -D_R_=1 -DUSE_R=1 -DUSE_TOPLEVEL_EXEC=1 -DWITH_R_IN_PERL=1 -I/usr/local/include -fpic -g -O2 -c Converters.c -o Converters.o
gcc -std=gnu99 -I/usr/local/lib64/R/include -I. -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -I/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE -DPERL_POLLUTE -D_R_=1 -DUSE_R=1 -DUSE_TOPLEVEL_EXEC=1 -DWITH开发者_运维知识库_R_IN_PERL=1 -I/usr/local/include -fpic -g -O2 -c Reflectance.c -o Reflectance.o
gcc -std=gnu99 -I/usr/local/lib64/R/include -I. -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -I/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE -DPERL_POLLUTE -D_R_=1 -DUSE_R=1 -DUSE_TOPLEVEL_EXEC=1 -DWITH_R_IN_PERL=1 -I/usr/local/include -fpic -g -O2 -c ForeignReference.c -o ForeignReference.o
gcc -std=gnu99 -I/usr/local/lib64/R/include -I. -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -I/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE -DPERL_POLLUTE -D_R_=1 -DUSE_R=1 -DUSE_TOPLEVEL_EXEC=1 -DWITH_R_IN_PERL=1 -I/usr/local/include -fpic -g -O2 -c UserConverters.c -o UserConverters.o
gcc -std=gnu99 -I/usr/local/lib64/R/include -I. -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -I/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE -DPERL_POLLUTE -D_R_=1 -DUSE_R=1 -DUSE_TOPLEVEL_EXEC=1 -DWITH_R_IN_PERL=1 -I/usr/local/include -fpic -g -O2 -c GeneralConverters.c -o GeneralConverters.o
making libPerlConverter.so
/usr/local/lib64/R/bin/R CMD SHLIB -o libPerlConverter.so Converters.c Reflectance.c ForeignReference.c UserConverters.o GeneralConverters.o
make[1]: Entering directory `/tmp/RtmpSqebDp/R.INSTALL68be5031/RSPerl/src'
gcc -std=gnu99 -shared -L/usr/local/lib64 -o libPerlConverter.so Converters.o Reflectance.o ForeignReference.o UserConverters.o GeneralConverters.o -Wl,-E -Wl,-rpath,/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/auto/DynaLoader/DynaLoader.a -L/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE -lperl -lresolv -lnsl -ldl -lm -lcrypt -lutil -lpthread -lc -L/usr/local/lib64/R/lib -lR
make[1]: Leaving directory `/tmp/RtmpSqebDp/R.INSTALL68be5031/RSPerl/src'
if test ! -d /opt/RSPerl/libs ; then mkdir /opt/RSPerl/libs ; fi
cp libPerlConverter.so /opt/RSPerl/libs
Makefile.PL PREFIX=/opt/RSPerl LIB=/opt/RSPerl/perl
make: Makefile.PL: Command not found
make: *** [Makefile.perl] Error 127
calling make -f Makefile.perl install
make: Makefile.perl: No such file or directory
make: *** No rule to make target `Makefile.perl'. Stop.
chmod: cannot access `blib/lib/R.pm': No such file or directory
Finished configuration
** libs
gcc -std=gnu99 -I/usr/local/lib64/R/include -I. -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -I/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE -DPERL_POLLUTE -D_R_=1 -DUSE_R=1 -DUSE_TOPLEVEL_EXEC=1 -DWITH_R_IN_PERL=1 -I/usr/local/include -fpic -g -O2 -c RPerlElements.c -o RPerlElements.o
gcc -std=gnu99 -I/usr/local/lib64/R/include -I. -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -I/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE -DPERL_POLLUTE -D_R_=1 -DUSE_R=1 -DUSE_TOPLEVEL_EXEC=1 -DWITH_R_IN_PERL=1 -I/usr/local/include -fpic -g -O2 -c RPerlEval.c -o RPerlEval.o
RPerlEval.c: In function âRS_PerlEvalStringâ:
RPerlEval.c:20: warning: ISO C90 forbids mixed declarations and code
RPerlEval.c: In function âRS_PerlGetâ:
RPerlEval.c:128: warning: ISO C90 forbids mixed declarations and code
RPerlEval.c: In function âRS_PerlCallModifiedâ:
RPerlEval.c:208: warning: ISO C90 forbids mixed declarations and code
RPerlEval.c: In function âRS_PerlCallâ:
RPerlEval.c:377: warning: ISO C90 forbids mixed declarations and code
gcc -std=gnu99 -I/usr/local/lib64/R/include -I. -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -I/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE -DPERL_POLLUTE -D_R_=1 -DUSE_R=1 -DUSE_TOPLEVEL_EXEC=1 -DWITH_R_IN_PERL=1 -I/usr/local/include -fpic -g -O2 -c RPerlInit.c -o RPerlInit.o
gcc -std=gnu99 -I/usr/local/lib64/R/include -I. -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -I/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE -DPERL_POLLUTE -D_R_=1 -DUSE_R=1 -DUSE_TOPLEVEL_EXEC=1 -DWITH_R_IN_PERL=1 -I/usr/local/include -fpic -g -O2 -c RPerlNew.c -o RPerlNew.o
gcc -std=gnu99 -I/usr/local/lib64/R/include -I. -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -I/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE -DPERL_POLLUTE -D_R_=1 -DUSE_R=1 -DUSE_TOPLEVEL_EXEC=1 -DWITH_R_IN_PERL=1 -I/usr/local/include -fpic -g -O2 -c RPerlReference.c -o RPerlReference.o
gcc -std=gnu99 -I/usr/local/lib64/R/include -I. -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -I/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE -DPERL_POLLUTE -D_R_=1 -DUSE_R=1 -DUSE_TOPLEVEL_EXEC=1 -DWITH_R_IN_PERL=1 -I/usr/local/include -fpic -g -O2 -c RPerlVars.c -o RPerlVars.o
gcc -std=gnu99 -I/usr/local/lib64/R/include -I. -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -I/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE -DPERL_POLLUTE -D_R_=1 -DUSE_R=1 -DUSE_TOPLEVEL_EXEC=1 -DWITH_R_IN_PERL=1 -I/usr/local/include -fpic -g -O2 -c Utils.c -o Utils.o
Utils.c: In function âcharacterVectorToNullTerminatedArrayâ:
Utils.c:35: warning: assignment discards qualifiers from pointer target type
Utils.c: In function âcharacterVectorToArrayâ:
Utils.c:78: warning: assignment discards qualifiers from pointer target type
gcc -std=gnu99 -I/usr/local/lib64/R/include -I. -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -I/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE -DPERL_POLLUTE -D_R_=1 -DUSE_R=1 -DUSE_TOPLEVEL_EXEC=1 -DWITH_R_IN_PERL=1 -I/usr/local/include -fpic -g -O2 -c xsinit.c -o xsinit.o
gcc -std=gnu99 -shared -L/usr/local/lib64 -o RSPerl.so Converters.o ForeignReference.o GeneralConverters.o RPerlElements.o RPerlEval.o RPerlInit.o RPerlNew.o RPerlReference.o RPerlVars.o Reflectance.o UserConverters.o Utils.o xsinit.o -Wl,-E -Wl,-rpath,/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/auto/DynaLoader/DynaLoader.a -L/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE -lperl -lresolv -lnsl -ldl -lm -lcrypt -lutil -lpthread -lc -L/usr/local/lib64/R/lib -lR
installing to /opt/RSPerl/libs
** R
** inst
** preparing package for lazy loading
** help
Warning: /tmp/RtmpSqebDp/R.INSTALL68be5031/RSPerl/man/PerlReferenceObjects.Rd:32: unknown macro '\textit'
*** installing help indices
** building package indices ...
Removing additional files
rm: cannot remove `src/Makefile.perl': No such file or directory
rm: cannot remove `src/pm_to_blib': No such file or directory
** testing if installed package can be loaded
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/opt/RSPerl/libs/RSPerl.so':
/opt/RSPerl/libs/RSPerl.so: undefined symbol: boot_R
Error: loading failed
Execution halted
ERROR: loading failed
* removing â/opt/RSPerlâ
* restoring previous â/opt/RSPerlâ
[root@xxx opt]#
My system information is the following:
Linux version 2.6.18-194.el5 (mockbuild@x86-005.build.bos.redhat.com) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-48)) #1 SMP Tue Mar 16 21:52:39 EDT 2010
and it runs on a 64 bit Xeon server.
Do you have any idea what's going on?
Thank you in advance.
From R-2.12 they remove requirement on perl, hence the PERL (env variable) in lib/R/etc/Renviron will not be set anymore.
One quick fix is to manually set PERL, as following:
PERL=`which perl` R --vanilla CMD INSTALL -c -l ~/library/ RSPerl_0.92-1.tar.gz
make sure you get perl-dev, not only perl (e.g. under ubuntu, apt-get install libperl-dev, if you compiled perl yourself, this won't be a problem)
RSPerl is an interface between R (or S) and Perl. It looks like you need to do some more research and find a Perl package that fits your installation or if you do have a compatible version use a compiler flag or an environment variable that tells R where to find it. Then install RSPerl.
You might want to look at this example of setting environment variables from an admittedly old posting from Duncan Temple Lang.
精彩评论