繁体   English   中英

R:在Linux上安装Rcplex

[英]R: install Rcplex on linux

我在Linux上安装Rcplex时遇到一些麻烦。

我试过了:

R CMD INSTALL --configure-args="                                      
--with-cplex-dir='/opt/ibm/ILOG/CPLEX_Studio129/cplex'"    Rcplex_0.3-3.tar.gz

然后我得到这个错误:

* installing *source* package ‘Rcplex’ ...
** package ‘Rcplex’ successfully unpacked and MD5 sums checked
checking for gawk... gawk
checking for gcc... gcc -std=gnu99
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 -std=gnu99 accepts -g... yes
checking for gcc -std=gnu99 option to accept ANSI C... none needed
checking how to run the C preprocessor... gcc -std=gnu99 -E
checking for egrep... grep -E
checking for ANSI C header files... no
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 ilcplex/cplex.h usability... yes
checking ilcplex/cplex.h presence... yes
checking for ilcplex/cplex.h... yes
checking for library containing CPXversion... no
configure: error: Could not link CPLEX library using -L/opt/ibm/ILOG/CPLEX_Studio129/cplex/lib/x86-64_linux/static_pic -l$(CPLEXLIB) -lm -lpthread -ldl
ERROR: configuration failed for package ‘Rcplex’

我也试过这个:

R CMD INSTALL     --configure-args="--with-cplex-include=/opt/ibm/ILOG/CPLEX_Studio129/cplex/include \
    --with-cplex-cflags=-fPIC \
    --with-cplex-lib=/opt/ibm/ILOG/CPLEX_Studio129/cplex/lib/x86-64_linux/static_pic' \
    -lcplex -lm -lpthread'" Rcplex_0.3-3.tar.gz 

并得到这个错误:

* installing *source* package ‘Rcplex’ ...
** package ‘Rcplex’ successfully unpacked and MD5 sums checked
checking for gcc... gcc -std=gnu99
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 -std=gnu99 accepts -g... yes
checking for gcc -std=gnu99 option to accept ANSI C... none needed
checking how to run the C preprocessor... gcc -std=gnu99 -E
checking for egrep... grep -E
checking for ANSI C header files... no
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 ilcplex/cplex.h usability... yes
checking ilcplex/cplex.h presence... yes
checking for ilcplex/cplex.h... yes
checking for library containing CPXversion... no
configure: error: Could not link CPLEX library using /opt/ibm/ILOG/CPLEX_Studio129/cplex/lib/x86-64_linux/static_pic -lcplex -lm -lpthread
ERROR: configuration failed for package ‘Rcplex’

我认为您最好的做法是调查configure脚本尝试运行的内容。 也许它期望CPLEX的另一个版本?

我在使用CPLEX 12.9的Ubuntu 18.04上为R3.6.1安装Rcplex 0.3-3软件包时遇到了同样的问题。

事实证明,Rcplex软件包是使用CPLEX 12.6.3开发和测试的。 当我在Ubuntu上安装此旧版本的CPLEX时,可以按照INSTALL文件中的说明安装Rcplex 0.3-3。

在我的系统上,此命令可以达到目的:

sudo R CMD INSTALL --configure-args="PKG_CFLAGS=-fPIC PKG_CPPFLAGS=-I/opt/ibm/ILOG/CPLEX_Studio1263/cplex/include PKG_LIBS='-L/opt/ibm/ILOG/CPLEX_Studio1263/cplex/lib/x86-64_linux/static_pic -lcplex -lm -lpthread'" Rcplex_0.3-3.tar.gz

这似乎仅与Rcplex的Linux版本有关。 我可以在Mac上使用最新版本的CPLEX安装Rcplex。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM