首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >R:在linux上安装Rcplex

R:在linux上安装Rcplex
EN

Stack Overflow用户
提问于 2019-03-13 00:31:30
回答 2查看 343关注 0票数 1

我在linux上安装Rcplex时遇到了一些问题。

我试过了:

代码语言:javascript
复制
R CMD INSTALL --configure-args="                                      
--with-cplex-dir='/opt/ibm/ILOG/CPLEX_Studio129/cplex'"    Rcplex_0.3-3.tar.gz

然后我得到了这个错误:

代码语言:javascript
复制
* 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’

我还尝试了这个:

代码语言:javascript
复制
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 

并得到这个错误:

代码语言:javascript
复制
* 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’
EN

回答 2

Stack Overflow用户

发布于 2019-04-14 00:07:54

我认为您最好的做法是查看configure脚本到底想要运行什么。也许它期待另一个版本的CPLEX?

票数 0
EN

Stack Overflow用户

发布于 2019-10-18 15:59:43

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

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

在我的系统上,这个命令成功了:

代码语言:javascript
复制
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

这似乎只是Linux版本的Rcplex的一个问题。我能够在我的Mac上安装Rcplex和最新版本的CPLEX。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/55126428

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档