我已使用以下指南安装了CplexApi软件包:https://www.r-bloggers.com/using-cplex-in-r-installing-cplexapi-in-windows-10/
我现在正试图以类似的方式安装Rcplex软件包。我已将makevars.win文件编辑为以下内容:
ifeq "$(WIN)" "64"
PKG_LIBS = -L"C:/Program Files/IBM/ILOG/CPLEX_Studio128/cplex/x64_win64" -lcplex1280 -lm
PKG_CPPFLAGS = -D_LP64 -I"C:/Program Files/IBM/ILOG/CPLEX_Studio128/cplex/include"
else
PKG_LIBS = -L"C:/Program Files/IBM/ILOG/CPLEX_Studio128/cplex/bin/x86_win32" -lcplex1280 -lm
PKG_CPPFLAGS = -I"C:/Program Files/IBM/ILOG/CPLEX_Studio128/cplex/include"
endif
然后我在CMD中输入以下内容:
C:\Users\A>R CMD build --no-build-vignettes --no-manual --md5 C:\Users\A\Downloads\cPlex\Rcplex_0.3-3.tar\Rcplex_0.3-3\Rcplex
这就是输出:
* checking for file 'C:\Users\A\Downloads\cPlex\Rcplex_0.3-3.tar\Rcplex_0.3-3\Rcplex/DESCRIPTION' ... OK
* preparing 'Rcplex':
* checking DESCRIPTION meta-information ... OK
* cleaning src
* checking for LF line-endings in source and make files and shell scripts
* checking for empty or unneeded directories
* adding MD5 file
* building 'Rcplex_0.3-3.tar.gz'
Warning: file 'Rcplex/cleanup' did not have execute permissions: corrected
Warning: file 'Rcplex/configure' did not have execute permissions: corrected`
然后我输入了以下内容:
C:\Users\A>R CMD INSTALL --build --no-multiarch .\Rcplex_0.3-3.tar.gz
我把它作为输出:
In R CMD INSTALL
* installing to library 'C:/Users/A/Documents/R/win-library/3.5'
* installing *source* package 'Rcplex' ...
** package 'Rcplex' successfully unpacked and MD5 sums checked
** libs
c:/Rtools/mingw_64/bin/gcc -I"C:/PROGRA~1/R/R-35~1.0/include" -DNDEBUG -D_LP64 -I"C:/Program Files/IBM/ILOG/CPLEX_Studio128/cplex/include" -O2 -Wall -std=gnu99 -mtune=generic -c Rcplex.c -o Rcplex.o
c:/Rtools/mingw_64/bin/gcc -I"C:/PROGRA~1/R/R-35~1.0/include" -DNDEBUG -D_LP64 -I"C:/Program Files/IBM/ILOG/CPLEX_Studio128/cplex/include" -O2 -Wall -std=gnu99 -mtune=generic -c Rcplex_QCP.c -o Rcplex_QCP.o
Rcplex_QCP.c: In function 'Rcplex_QCP':
Rcplex_QCP.c:37:7: warning: unused variable 'trace' [-Wunused-variable]
int trace = INTEGER(getListElement(control,"trace"))[0];
^
c:/Rtools/mingw_64/bin/gcc -I"C:/PROGRA~1/R/R-35~1.0/include" -DNDEBUG -D_LP64 -I"C:/Program Files/IBM/ILOG/CPLEX_Studio128/cplex/include" -O2 -Wall -std=gnu99 -mtune=generic -c Rcplex_params.c -o Rcplex_params.o
c:/Rtools/mingw_64/bin/gcc -I"C:/PROGRA~1/R/R-35~1.0/include" -DNDEBUG -D_LP64 -I"C:/Program Files/IBM/ILOG/CPLEX_Studio128/cplex/include" -O2 -Wall -std=gnu99 -mtune=generic -c Rcplex_utils.c -o Rcplex_utils.o
c:/Rtools/mingw_64/bin/gcc -shared -s -static-libgcc -o Rcplex.dll tmp.def Rcplex.o Rcplex_QCP.o Rcplex_params.o Rcplex_utils.o -LC:/Program Files/IBM/ILOG/CPLEX_Studio128/cplex/x64_win64 -lcplex1280 -lm -LC:/PROGRA~1/R/R-35~1.0/bin/x64 -lR
C:/Rtools/mingw_64/bin/../lib/gcc/x86_64-w64-mingw32/4.9.3/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lcplex1280
collect2.exe: error: ld returned 1 exit status
no DLL was created
ERROR: compilation failed for package 'Rcplex'
* removing 'C:/Users/A/Documents/R/win-library/3.5/Rcplex'
我想知道我到底做错了什么?