簡體   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