在公司的服务器上(不能联网,CentOS6.4)安装R的扩展包nloptr,遇到如下的报错:
[root@ dependencies]# R CMD INSTALL nloptr_1.0.4.tar.gz
* installing to library ‘/server/R/lib64/R/library’
* installing *source* package ‘nloptr’ ...
** package ‘nloptr’ successfully unpacked and MD5 sums checked
checking for g++... g++
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking how to run the C++ preprocessor... g++ -E
checking whether we are using the GNU C++ compiler... (cached) yes
checking whether g++ accepts -g... (cached) yes
checking for pkg-config... yes
configure: Now testing for NLopt header file.
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking nlopt.h usability... yes
checking nlopt.h presence... yes
checking for nlopt.h... yes
configure: Suitable NLopt library found.
configure: creating ./config.status
config.status: creating src/Makevars
** libs
g++ -I/server/R/lib64/R/include -DNDEBUG -I/usr/local/include -fpic -g -O2 -c dummy.cpp -o dummy.o
gcc -std=gnu99 -I/server/R/lib64/R/include -DNDEBUG -I/usr/local/include -fpic -g -O2 -c nloptr.c -o nloptr.o
g++ -shared -L/usr/local/lib64 -o nloptr.so dummy.o nloptr.o
installing to /server/R/lib64/R/library/nloptr/libs
** R
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/server/R/lib64/R/library/nloptr/libs/nloptr.so':
/server/R/lib64/R/library/nloptr/libs/nloptr.so: undefined symbol: nlopt_set_maxtime
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/server/R/lib64/R/library/nloptr’
在网上查了好久,还是没有解决,不知道哪位大神遇到过类似的问题?先谢谢了
在网上找到了类似的解决方法,但是按照操作还是没有解决:
http://stackoverflow.com/questions/29716857/installing-nloptr-on-linux