2011-07-08 44 views
0

我想在RedHat Linux中運行Perl中的R(統計軟件包)。我在網上發現,有一個名爲RSPerl的包可以完成這項工作,但我很難在RedHat中安裝它。該軟件要求將R安裝爲shared library。我按照說明進行操作,但在安裝R之後(我沒有問題),我嘗試安裝RSPerl時遇到以下問題。在RedHat上安裝RSPerl時出現問題

[[email protected] 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â 
[[email protected] opt]# 

我的系統信息如下:

Linux version 2.6.18-194.el5 ([email protected]) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-48)) #1 SMP Tue Mar 16 21:52:39 EDT 2010 

,它運行在64位Xeon服務器上。

你知道發生了什麼嗎?

預先感謝您。

回答

0

RSPerl是R(或S)和Perl之間的接口。看起來你需要做更多的研究並找到一個適合你的安裝的Perl包,或者如果你有一個兼容的版本,使用一個編譯器標誌或一個環境變量來告訴R在哪裏找到它。然後安裝RSPerl。

你可能想看看設置環境變量的這個例子從admittedly old posting from Duncan Temple Lang.

+0

解決通過設置環境變量$ PERL指向正確的Perl目錄(即導出PERL =/usr/bin/perl)謝謝! – Regressor

1

從R-2.12它們Perl的刪除要求,因此PERL(環境變量)中的lib/R的/ etc/Renviron不會被設置了。

一個快速的解決方法是手動設置PERL,如下:

PERL=`which perl` R --vanilla CMD INSTALL -c -l ~/library/ RSPerl_0.92-1.tar.gz 

確保你得到Perl的開發,不僅perl的(如ubuntu下,易於得到安裝libperl-dev的,如果你編譯perl自己,這不會是一個問題)