2017-01-12 227 views
1

我想在R中使用cplexAPI我收到持久性錯誤。我正在使用Microsoft R Open 3.3.1,並在Windows 10上安裝了IBM ILOG CPLEX Optimization Studio版本:12.7.0.0。以下是我所做的以及結果。我將深入細節,希望你能看到我的錯誤!R:安裝cplexAPI錯誤

  1. 解壓tar文件到我桌面上的文件夾。
  2. 編輯文件:C:\Users\zejas\Desktop\cplexAPI\cplexAPI\src\Makevars.win說:

PKG_CPPFLAGS=-g -D_R_=1 -DUSE_R=1 -I"$C:\Program Files\IBM\ILOG\CPLEX_Studio127\cplex\include" PKG_LIBS=-L"$C:\Program Files\IBM\ILOG\CPLEX_Studio127\cplex\lib" -lm -lcplex1270

  • 微軟把自己的自旋的Reviron.site文件。他們把Rcmd_environ在:C:\Program Files\Microsoft\MRO-3.3.1\etc\Rcmd_environ 在那個文件我增加了底部三行:
  • ## from R.sh R_SHARE_DIR=${R_HOME}/share R_INCLUDE_DIR=${R_HOME}/include R_DOC_DIR=${R_HOME}/doc R_ARCH= ## from Rcmd R_OSTYPE=windows TEXINPUTS=.;${TEXINPUTS};${R_SHARE_DIR}/texmf/tex/latex; BIBINPUTS=.;${BIBINPUTS};${R_SHARE_DIR}/texmf/bibtex/bib; BSTINPUTS=.;${BSTINPUTS};${R_SHARE_DIR}/texmf/bibtex/bst; ## from etc/Renviron # R_PLATFORM='i386-pc-mingw32' R_PAPERSIZE_USER=${R_PAPERSIZE} R_PAPERSIZE=${R_PAPERSIZE-'a4'} # for Rd2dpf, reference manual R_RD4PDF=${R_RD4PDF-'times,inconsolata,hyper'} ## used for options("texi2dvi") # R_TEXI2DVICMD=${R_TEXI2DVICMD-${TEXI2DVI-'texi2dvi'}} ## used by INSTALL, check, build R_GZIPCMD=${R_GZIPCMD-'gzip'} ## Default zip/unzip commands R_UNZIPCMD=${R_UNZIPCMD-'unzip'} R_ZIPCMD=${R_ZIPCMD-'zip'} R_BZIPCMD=${R_BZIPCMD-'bzip2'} ## Default browser # R_BROWSER=${R_BROWSER-'open'} ## Default editor # EDITOR=${EDITOR-${VISUAL-vi}} ## Default pager # PAGER=${PAGER-''} ## Default PDF viewer # R_PDFVIEWER=${R_PDFVIEWER-'open'} # MAKE=${MAKE-make} SED=${SED-sed} # CPLEX_STUDIO_DIR=C:/Program Files/IBM/ILOG/CPLEX_Studio127 CPLEX_STUDIO_LIB=C:/Program Files/IBM/ILOG/CPLEX_Studio127/cplex/bin/x64_win64

  • Environment VariablesSystem VariablesPath我已經補充說:
  • %CPLEX_STUDIO_BINARIES127%; C:\Program Files (x86)\Intel\OpenCL SDK\6.1\bin\x64; C:\Program Files (x86)\Intel\OpenCL SDK\6.1\bin\x86; C:\Program Files (x86)\Intel\OpenCL SDK\6.1\bin\Pin; C:\Program Files (x86)\Intel\OpenCL SDK\6.1\bin\GTPin; C:\ProgramData\Oracle\Java\javapath;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\bin; C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\libnvvp; C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\; C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem; C:\Windows\System32\WindowsPowerShell\v1.0\; C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL; C:\Program Files\Intel\Intel(R) Management Engine Components\DAL; C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT; C:\Program Files\Intel\Intel(R) Management Engine Components\IPT; C:\Program Files (x86)\Skype\Phone\; C:\Program Files\MATLAB\R2016b\bin; C:\Program Files\MATLAB\R2016a\bin; C:\Program Files\Microsoft\MRO-3.3.1\bin\x64; C:\Users\zejas\.dnx\bin;C:\Program Files\Microsoft DNX\Dnvm\; C:\Program Files\Microsoft SQL Server\130\Tools\Binn\; C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\; C:\WINDOWS\system32;C:\WINDOWS; C:\WINDOWS\System32\Wbem; C:\WINDOWS\System32\WindowsPowerShell\v1.0\; C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common; C:\Program Files\Git\cmd; C:\Program Files\IBM\ILOG\CPLEX_Studio127\cplex\bin\x64_win64; C:\Program Files\IBM\ILOG\CPLEX_Studio127\cplex\include; C:\Rtools\bin

    1. 我重建包:

    C:\Users\zejas>R CMD build --no-build-vignettes --no-manual --md5 C:\Users\zejas\Desktop\cplexAPI\cplexAPI * checking for file 'C:\Users\zejas\Desktop\cplexAPI\cplexAPI/DESCRIPTION' ... OK * preparing 'cplexAPI': * checking DESCRIPTION meta-information ... OK * cleaning src * checking vignette meta-information ... OK * checking for LF line-endings in source and make files * checking for empty or unneeded directories * adding MD5 file * building 'cplexAPI_1.3.2.tar.gz' Warning: file 'cplexAPI/cleanup' did not have execute permissions: corrected Warning: file 'cplexAPI/configure' did not have execute permissions: corrected

  • 我試圖安裝該包的:
  • C:\Users\zejas>"C:\Program Files\Microsoft\MRO-3.3.1\bin\x64\R.exe" CMD INSTALL --build --no-multiarch ./cplexAPI.tar.gz * installing to library 'C:/Users/zejas/Documents/R/win-library/3.3' * installing *source* package 'cplexAPI' ... ** package 'cplexAPI' successfully unpacked and MD5 sums checked ** libs c:/Rtools/mingw_64/bin/gcc -m64 -I"C:/PROGRA~1/MICROS~1/MRO-33~1.1/include" -DNDEBUG -g -D_R_=1 -DUSE_R=1 -I":\Program Files\IBM\ILOG\CPLEX_Studio127\cplex\include" -I"C:/swarm/workspace/External- R-3.3.1/vendor/extsoft/include" -O2 -Wall -std=gnu99 -mtune=core2 -c cplexAPI.c -o cplexAPI.o In file included from cplexAPI.h:26:0, from cplexAPI.c:26: cplexR.h:50:27: fatal error: ilcplex/cplex.h: No such file or directory #include <ilcplex/cplex.h> ^ compilation terminated. make: *** [cplexAPI.o] Error 1 Warning: running command 'make -f "Makevars.win" -f "C:/PROGRA~1/MICROS~1/MRO-33~1.1/etc/x64/Makeconf" -f "C:/PROGRA~1/MICROS~1/MRO- 33~1.1/share/make/winshlib.mk" SHLIB="cplexAPI.dll" WIN=64 TCLBIN=64 OBJECTS="cplexAPI.o cplexR.o cplex_checkAPI.o cplex_longparamAPI.o init.o"' had status 2 ERROR: compilation failed for package 'cplexAPI' * removing 'C:/Users/zejas/Documents/R/win-library/3.3/cplexAPI'

    有絕對是一個cplex.h文件在那個目錄中!

    C:\Program Files\IBM\ILOG\CPLEX_Studio127\cplex\include\ilcplex>dir 
    
    Volume in drive C is OS 
    Volume Serial Number is 0A1B-3F26 
    Directory of C:\Program Files\IBM\ILOG\CPLEX_Studio127\cplex\include\ilcplex 
    01/09/2017 10:43 AM <DIR>   . 
    01/09/2017 10:43 AM <DIR>   .. 
    01/09/2017 10:43 AM    2,499 annotation.xsd 
    01/09/2017 10:43 AM   72,321 cplex.h 
    01/09/2017 10:43 AM    6,429 cplexcheck.h 
    01/09/2017 10:43 AM    1,703 cplexdistmip.h 
    01/09/2017 10:43 AM    1,857 cplexdistmipl.h 
    01/09/2017 10:43 AM    1,857 cplexdistmips.h 
    01/09/2017 10:43 AM    2,569 cplexdistmipx.h 
    01/09/2017 10:43 AM   76,659 cplexl.h 
    01/09/2017 10:43 AM    2,826 cplexremote.h 
    01/09/2017 10:43 AM    2,944 cplexremotel.h 
    01/09/2017 10:43 AM   111,312 cplexremotemaster.h 
    01/09/2017 10:43 AM   107,895 cplexremotemasterl.h 
    01/09/2017 10:43 AM   107,777 cplexremotemasters.h 
    01/09/2017 10:43 AM   220,496 cplexremotemasterx.h 
    01/09/2017 10:43 AM    2,944 cplexremotes.h 
    01/09/2017 10:43 AM    3,379 cplexremoteworker.h 
    01/09/2017 10:43 AM    3,505 cplexremoteworkerl.h 
    01/09/2017 10:43 AM    3,511 cplexremoteworkers.h 
    01/09/2017 10:43 AM    4,554 cplexremoteworkerx.h 
    01/09/2017 10:43 AM    3,289 cplexremotex.h 
    01/09/2017 10:43 AM   76,354 cplexs.h 
    01/09/2017 10:43 AM   119,712 cplexx.h 
    01/09/2017 10:43 AM   70,061 cpxconst.h 
    01/09/2017 10:43 AM    675 ilm.h 
    01/09/2017 10:43 AM    7,158 ilocarray.h 
    01/09/2017 10:43 AM   186,959 ilocplex.h 
    01/09/2017 10:43 AM   205,973 ilocplexi.h 
    01/09/2017 10:43 AM   13,174 iloextrmgr.h 
    01/09/2017 10:43 AM   13,496 ilogoals.h 
    01/09/2017 10:43 AM   15,241 iloparam.h 
    01/09/2017 10:43 AM    5,705 solution.xsd 
    01/09/2017 10:43 AM    5,504 solution.xsl 
    01/09/2017 10:43 AM    1,397 vmc.dtd 
    01/09/2017 10:43 AM    2,837 vmc.xsd 
    34 File(s)  1,464,572 bytes 
    2 Dir(s) 333,053,566,976 bytes free 
    

    任何想法?


    從@ c0bra與輸入更新和@rkersh

    我更新Makevars.win

    PKG_CPPFLAGS=-g -D_R_=1 -DUSE_R=1 -I"C:\Program Files\IBM\ILOG\CPLEX_Studio127\cplex\include" 
    PKG_LIBS=-L"C:\Program Files\IBM\ILOG\CPLEX_Studio127\cplex\lib" -lm -lcplex1270 
    

    重建在命令行:

    C:\Users\zejas>R CMD build --no-build-vignettes --no-manual --md5  C:\Users\zejas\Desktop\cplexAPI\cplexAPI 
    * checking for file 'C:\Users\zejas\Desktop\cplexAPI\cplexAPI/DESCRIPTION' ... OK 
    * preparing 'cplexAPI': 
    * checking DESCRIPTION meta-information ... OK 
    * cleaning src 
    * checking vignette meta-information ... OK 
    * checking for LF line-endings in source and make files 
    * checking for empty or unneeded directories 
    * adding MD5 file 
    * building 'cplexAPI_1.3.2.tar.gz' 
    Warning: file 'cplexAPI/cleanup' did not have execute permissions: corrected 
    Warning: file 'cplexAPI/configure' did not have execute permissions: corrected 
    

    我嘗試從安裝命令行:

    C:\Users\zejas>"C:\Program Files\Microsoft\MRO-3.3.1\bin\x64\R.exe" CMD INSTALL --build --no-multiarch .\cplexAPI_1.3.2.tar.gz 
    * installing to library 'C:/Users/zejas/Documents/R/win-library/3.3' 
    * installing *source* package 'cplexAPI' ... 
    ** package 'cplexAPI' successfully unpacked and MD5 sums checked 
    ** libs 
    c:/Rtools/mingw_64/bin/gcc -m64 -I"C:/PROGRA~1/MICROS~1/MRO-33~1.1/include" -DNDEBUG -g -D_R_=1 -DUSE_R=1 -I"C:\Program Files\IBM\ILOG\CPLEX_Studio127\cplex\include" -I"C:/swarm/workspace/External-R-3.3.1/vendor/extsoft/include"  -O2 -Wall -std=gnu99 -mtune=core2 -c cplexAPI.c -o cplexAPI.o 
    cplexAPI.c: In function 'addChannel': 
    cplexAPI.c:5198:5: warning: implicit declaration of function 'CPXaddchannel' [-Wimplicit-function-declaration] 
        newch = CPXaddchannel(R_ExternalPtrAddr(env)); 
        ^
    cplexAPI.c:5198:11: warning: assignment makes pointer from integer without a cast 
        newch = CPXaddchannel(R_ExternalPtrAddr(env)); 
         ^
    cplexAPI.c: In function 'delChannel': 
    cplexAPI.c:5234:5: warning: implicit declaration of function 'CPXdelchannel' [-Wimplicit-function-declaration] 
        CPXdelchannel(R_ExternalPtrAddr(env), &delch); 
        ^
    c:/Rtools/mingw_64/bin/gcc -m64 -I"C:/PROGRA~1/MICROS~1/MRO-33~1.1/include" -DNDEBUG -g -D_R_=1 -DUSE_R=1 -I"C:\Program Files\IBM\ILOG\CPLEX_Studio127\cplex\include" -I"C:/swarm/workspace/External-R-3.3.1/vendor/extsoft/include"  -O2 -Wall -std=gnu99 -mtune=core2 -c cplexR.c -o cplexR.o 
    c:/Rtools/mingw_64/bin/gcc -m64 -I"C:/PROGRA~1/MICROS~1/MRO-33~1.1/include" -DNDEBUG -g -D_R_=1 -DUSE_R=1 -I"C:\Program Files\IBM\ILOG\CPLEX_Studio127\cplex\include" -I"C:/swarm/workspace/External-R-3.3.1/vendor/extsoft/include"  -O2 -Wall -std=gnu99 -mtune=core2 -c cplex_checkAPI.c -o cplex_checkAPI.o 
    c:/Rtools/mingw_64/bin/gcc -m64 -I"C:/PROGRA~1/MICROS~1/MRO-33~1.1/include" -DNDEBUG -g -D_R_=1 -DUSE_R=1 -I"C:\Program Files\IBM\ILOG\CPLEX_Studio127\cplex\include" -I"C:/swarm/workspace/External-R-3.3.1/vendor/extsoft/include"  -O2 -Wall -std=gnu99 -mtune=core2 -c cplex_longparamAPI.c -o cplex_longparamAPI.o 
    c:/Rtools/mingw_64/bin/gcc -m64 -I"C:/PROGRA~1/MICROS~1/MRO-33~1.1/include" -DNDEBUG -g -D_R_=1 -DUSE_R=1 -I"C:\Program Files\IBM\ILOG\CPLEX_Studio127\cplex\include" -I"C:/swarm/workspace/External-R-3.3.1/vendor/extsoft/include"  -O2 -Wall -std=gnu99 -mtune=core2 -c init.c -o init.o 
    c:/Rtools/mingw_64/bin/gcc -m64 -shared -s -static-libgcc -o cplexAPI.dll tmp.def cplexAPI.o cplexR.o cplex_checkAPI.o cplex_longparamAPI.o init.o -LC:\Program Files\IBM\ILOG\CPLEX_Studio127\cplex\lib -lm -lcplex1270 -LC:/swarm/workspace/External-R-3.3.1/vendor/extsoft/lib/x64 -LC:/swarm/workspace/External-R-3.3.1/vendor/extsoft/lib -LC:/PROGRA~1/MICROS~1/MRO-33~1.1/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 -lcplex1270 
    collect2.exe: error: ld returned 1 exit status 
    no DLL was created 
    ERROR: compilation failed for package 'cplexAPI' 
    * removing 'C:/Users/zejas/Documents/R/win-library/3.3/cplexAPI' 
    

    我編輯Makevars。贏得

    PKG_CPPFLAGS=-g -D_R_=1 -DUSE_R=1 -I"C:/PROGRA~1/IBM/ILOG/CPLEX_Studio127/cplex/include" 
    PKG_LIBS=-L"C:/PROGRA~1/IBM/ILOG/CPLEX_Studio127/cplex/include/lib" -lm -lcplex1270 
    

    我重建:

    C:\Users\zejas>R CMD build --no-build-vignettes --no-manual --md5 C:\Users\zejas\Desktop\cplexAPI\cplexAPI 
    * checking for file 'C:\Users\zejas\Desktop\cplexAPI\cplexAPI/DESCRIPTION' ... OK 
    * preparing 'cplexAPI': 
    * checking DESCRIPTION meta-information ... OK 
    * cleaning src 
    * checking vignette meta-information ... OK 
    * checking for LF line-endings in source and make files 
    * checking for empty or unneeded directories 
    * adding MD5 file 
    * building 'cplexAPI_1.3.2.tar.gz' 
    Warning: file 'cplexAPI/cleanup' did not have execute permissions: corrected 
    Warning: file 'cplexAPI/configure' did not have execute permissions: corrected 
    

    我嘗試安裝:

    C:\Users\zejas>"C:\Program Files\Microsoft\MRO-3.3.1\bin\x64\R.exe" CMD INSTALL --build --no-multiarch .\cplexAPI_1.3.2.tar.gz 
    * installing to library 'C:/Users/zejas/Documents/R/win-library/3.3' 
    * installing *source* package 'cplexAPI' ... 
    ** package 'cplexAPI' successfully unpacked and MD5 sums checked 
    ** libs 
    c:/Rtools/mingw_64/bin/gcc -m64 -I"C:/PROGRA~1/MICROS~1/MRO-33~1.1/include" -DNDEBUG -g -D_R_=1 -DUSE_R=1 -I"C:/PROGRA~1/IBM/ILOG/CPLEX_Studio127/cplex/include" -I"C:/swarm/workspace/External-R-3.3.1/vendor/extsoft/include"  -O2 -Wall -std=gnu99 -mtune=core2 -c cplexAPI.c -o cplexAPI.o 
    cplexAPI.c: In function 'addChannel': 
    cplexAPI.c:5198:5: warning: implicit declaration of function 'CPXaddchannel' [-Wimplicit-function-declaration] 
        newch = CPXaddchannel(R_ExternalPtrAddr(env)); 
        ^
    cplexAPI.c:5198:11: warning: assignment makes pointer from integer without a cast 
        newch = CPXaddchannel(R_ExternalPtrAddr(env)); 
         ^
    cplexAPI.c: In function 'delChannel': 
    cplexAPI.c:5234:5: warning: implicit declaration of function 'CPXdelchannel' [-Wimplicit-function-declaration] 
        CPXdelchannel(R_ExternalPtrAddr(env), &delch); 
        ^
    c:/Rtools/mingw_64/bin/gcc -m64 -I"C:/PROGRA~1/MICROS~1/MRO-33~1.1/include" -DNDEBUG -g -D_R_=1 -DUSE_R=1 -I"C:/PROGRA~1/IBM/ILOG/CPLEX_Studio127/cplex/include" -I"C:/swarm/workspace/External-R-3.3.1/vendor/extsoft/include"  -O2 -Wall -std=gnu99 -mtune=core2 -c cplexR.c -o cplexR.o 
    c:/Rtools/mingw_64/bin/gcc -m64 -I"C:/PROGRA~1/MICROS~1/MRO-33~1.1/include" -DNDEBUG -g -D_R_=1 -DUSE_R=1 -I"C:/PROGRA~1/IBM/ILOG/CPLEX_Studio127/cplex/include" -I"C:/swarm/workspace/External-R-3.3.1/vendor/extsoft/include"  -O2 -Wall -std=gnu99 -mtune=core2 -c cplex_checkAPI.c -o cplex_checkAPI.o 
    c:/Rtools/mingw_64/bin/gcc -m64 -I"C:/PROGRA~1/MICROS~1/MRO-33~1.1/include" -DNDEBUG -g -D_R_=1 -DUSE_R=1 -I"C:/PROGRA~1/IBM/ILOG/CPLEX_Studio127/cplex/include" -I"C:/swarm/workspace/External-R-3.3.1/vendor/extsoft/include"  -O2 -Wall -std=gnu99 -mtune=core2 -c cplex_longparamAPI.c -o cplex_longparamAPI.o 
    c:/Rtools/mingw_64/bin/gcc -m64 -I"C:/PROGRA~1/MICROS~1/MRO-33~1.1/include" -DNDEBUG -g -D_R_=1 -DUSE_R=1 -I"C:/PROGRA~1/IBM/ILOG/CPLEX_Studio127/cplex/include" -I"C:/swarm/workspace/External-R-3.3.1/vendor/extsoft/include"  -O2 -Wall -std=gnu99 -mtune=core2 -c init.c -o init.o 
    c:/Rtools/mingw_64/bin/gcc -m64 -shared -s -static-libgcc -o cplexAPI.dll tmp.def cplexAPI.o cplexR.o cplex_checkAPI.o cplex_longparamAPI.o init.o -LC:/PROGRA~1/IBM/ILOG/CPLEX_Studio127/cplex/include/lib -lm -lcplex1270 -LC:/swarm/workspace/External-R-3.3.1/vendor/extsoft/lib/x64 -LC:/swarm/workspace/External-R-3.3.1/vendor/extsoft/lib -LC:/PROGRA~1/MICROS~1/MRO-33~1.1/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 -lcplex1270 
    collect2.exe: error: ld returned 1 exit status 
    no DLL was created 
    ERROR: compilation failed for package 'cplexAPI' 
    * removing 'C:/Users/zejas/Documents/R/win-library/3.3/cplexAPI' 
    

    這些都是新的錯誤!

    回答

    1

    對我來說,它看起來就像在Makevars.win文件的路徑前面留下了$符號。請儘量糾正到:

    PKG_CPPFLAGS=-g -D_R_=1 -DUSE_R=1 -I"C:\Program Files\IBM\ILOG\CPLEX_Studio127\cplex\include" 
    PKG_LIBS=-L"C:\Program Files\IBM\ILOG\CPLEX_Studio127\cplex\lib" -lm -lcplex1270 
    

    EDIT2:由於baydoganm指出,有兩個功能缺失在CPLEX 1270年在拆除這些,cplexAPI編譯罰款與Windows,太: cplexAPI_1.3.3.tar.gz

    +0

    我真的希望這可以工作。我試了一下,得到了同樣的錯誤。該項目的開發人員也在他的指示中有'$'謝謝! – jjhold

    +0

    在最終安裝輸出中,您可以看到包含路徑中缺少「C」(例如'-I「:\ Program Files \ IBM \ ILOG \ CPLEX_Studio127 \ cplex \ include」')。另外,在輸出中,它看起來像其他路徑正在使用正斜槓。這些只是在黑暗中拍攝,但也許嘗試使用'PKG_CPPFLAGS = -g -D_R_ = 1 -DUSE_R = 1 -I「C:/ Program Files/IBM/ILOG/CPLEX_Studio127/cplex/include」等。 'Makevars.win'。另外,你可以嘗試使用'C:\ PROGRA〜1'而不是'C:/ Program Files',這樣你就沒有任何空格了...... – rkersh

    +0

    @rkersh我也一直想知道缺少' C'在輸出和空間。令人困惑的是,輸入「C」。所以我嘗試了'C:\ PROGRA〜1'的想法,並將它與@c0bra結合起來,並刪除了'$'。這些組合都不起作用。你對空間的擔憂讓我想到環境變量。謝謝! – jjhold

    1

    我有完全相同同樣的問題,並找不到安裝軟件包的方法,儘管在這裏嘗試了所有類似於該文章的內容。我不確定問題是否與軟件包發佈後CPLEX中的版本更改有關。

    編輯:我能夠確認問題。顯然可調用的庫元素addchannel,delchannel和其他幾個元素在版本12.7中被刪除。這裏是鏈接:

    http://www.ibm.com/support/knowledgecenter/SSSA5P_12.7.0/ilog.odms.cplex.help/CPLEX/ReleaseNotes/topics/releasenotes127/removed.html

    在包的源文件之一,它已經被提到,「R接口IBM ILOG CPLEX版本的C API 12.1至12.6。」

    看起來像降級cplex將有所幫助。

    0

    我正面臨着類似的問題,同時有R集成CPLEX,並安裝cplexAPI包,請參閱https://cran.r-project.org/web/packages/cplexAPI/ 有一些錯誤,我在做什麼,首先,問題的產生是因爲R不知道安裝了IBM CPLEX哪裏,因此您必須手動更改在試圖從rstudio GUI安裝cplexAPI時下載的cplexAPI_1.3.3.tar.gz包中的文件Makevars.win。 查找以下代碼:

    ,你需要檢查的 -L"${CPLEX_STUDIO_LIB}"是由我的情況下更換
    PKG_CPPFLAGS=-g -D_R_=1 -DUSE_R=1 -I"${CPLEX_STUDIO_DIR}\cplex\include" 
    PKG_LIBS=-L"${CPLEX_STUDIO_LIB}" -lm -lcplex1261 
    

    兩招,-L"C:/Program Files/IBM/ILOG/CPLEX_Studio1271/cplex/bin/x64_win64"(見斌/ x64_win64),更換$

    文件夾x64_win64內第二次,尋找cplex12**.dll文件,這其中-lcplex1261所指向的文件,這裏手動更改-lcplex1261到無論你的文件名(在我的情況下,它是cplex1271.dll,所以我改變-lcplex1261到-lcplex1271,

    相似${CPLEX_STUDIO_DIR}必須替換爲C:/Program Files/IBM/ILOG/CPLEX_Studio1271(在我的情況下)。

    在此之後,按照https://www.r-bloggers.com/using-cplex-in-r-installing-cplexapi-in-windows-10/給出的指令, 基本上使用下面的命令(命令行)重新包裝並安裝cplexAPI_1.3.3.tar.gz(確保你已經安裝了Rtools,並確保環境變量有PATH指向R的安裝文件,基本上以R.exe和Rcmd.exe爲命令運行),並且

    R CMD build --no-build-vignettes --no-manual --md5 C:\Users{computer name here}\Desktop\cplexAPI 
    
    R CMD INSTALL --build --no-multiarch .\cplexAPI_1.3.3.tar.gz