【问题标题】:R: install Rcplex on linuxR:在 linux 上安装 Rcplex
【发布时间】:2019-03-12 16:31:30
【问题描述】:

我在 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’

【问题讨论】:

  • 当您尝试cd /opt/ibm/ILOG/CPLEX_Studio129/cplex/examples/x86-64_linux/static_pic && make execute_c时,这些示例运行良好吗?
  • 你曾经解决过这个问题吗?我也有同样的问题。

标签: r cplex


【解决方案1】:

我认为您最好的做法是查看 configure 脚本试图运行的确切内容。也许它需要另一个版本的 CPLEX?

【讨论】:

    【解决方案2】:

    我在带有 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
    

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

    【讨论】:

    • 我可以确认高于 12.6.3 的 CPLEX 版本会阻止 Rcplex 在 Linux 中构建。我使用 Centos 7。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-01-03
    相关资源
    最近更新 更多