问题
I try to solve a very large optimization problem in R, so I want to install rcplex. I've not much experience with R, so excuse me if I ask stupid things.
First I installed cplex studio and rtools40. I've tried to follow the manual https://cran.r-project.org/web/packages/Rcplex/INSTALL. Then I changed the makevars.win
file to
ifeq "$(WIN)" "64"
PKG_LIBS = -L"C:/Program Files/IBM/ILOG/CPLEX_Studio_Community1210/cplex/bin/x64_win64" -lcplex12100 -lm
PKG_CPPFLAGS = -D_LP64 -I"C:/Program Files/IBM/ILOG/CPLEX_Studio_Community1210/cplex/include"
else
PKG_LIBS = -L"C:/Program Files/IBM/ILOG/CPLEX_Studio_Community1210/cplex/bin/x86_win32" -lcplex12100 -lm
PKG_CPPFLAGS = -I"C:/Program Files/IBM/ILOG/CPLEX_Studio_Community1210/cplex/include"
endif
Then I used the command
"C:\Program Files\R\R-4.0.2\bin\x64\Rgui.exe" CMD build --no-build-vignettes --no-manual --md5 Rcplex_0.3-3
and get the errors:
warning unknown option --no-build-vignettes, warning unknown option --no-manual and warning unknown option --md5 .
If I tried to install it directly in R, I get the error
Warning in install.packages(files[tarballs], .libPaths()[1L], repos = NULL,
'lib = "C:/Program Files/R/R-4.0.2/library" is not writable
ERROR: dependency 'slam' is not available for package 'Rcplex'
So I don't know how to fix it. EDIT I changed the command to
"C:\Program Files\R\R-4.0.2\bin\x64\R.exe" CMD build --no-build-vignettes --no-manual --md5 C:/Users/Jonas/Desktop/Rcplex_0.3-3.tar.gz
and get the error
ERROR
cannot change to directory 'C:/Users/Jonas/Desktop/Rcplex_0.3-3.tar.gz'
and for the command
"C:\Program Files\R\R-4.0.2\bin\x64\R.exe" CMD check C:/Users/Jonas/Desktop/Rcplex_0.3-3.tar.gz
I get
* using log directory 'C:/Users/Jonas/Rcplex.Rcheck'
* using R version 4.0.2 (2020-06-22)
* using platform: x86_64-w64-mingw32 (64-bit)
* using session charset: ISO8859-1
* checking for file 'Rcplex/DESCRIPTION' ... OK
* this is package 'Rcplex' version '0.3-3'
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for .dll and .exe files ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking whether package 'Rcplex' can be installed ... ERROR
Installation failed.
See 'C:/Users/Jonas/Rcplex.Rcheck/00install.out' for details.
* DONE
Status: 1 ERROR
See
'C:/Users/Jonas/Rcplex.Rcheck/00check.log'
for details.
I don't know how to proceed.
2.Edit
I changed it and get
"C:\Program Files\R\R-4.0.2\bin\x64\R.exe" CMD build --no-build-vignettes --no-manual --md5 C:/Users/Jonas/Desktop/Rcplex
* checking for file 'C:/Users/Jonas/Desktop/Rcplex/DESCRIPTION' ... OK
* preparing 'Rcplex':
* checking DESCRIPTION meta-information ... OK
* cleaning src
Warning in cleanup_pkg(pkgdir, Log)
unable to run 'make clean' in '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
I think the problem is now, that there is no C:/Program Files/IBM/ILOG/CPLEX_Studio_Community1210/cplex/bin/x86_win32 file.
3.Edit
I've tried to install cplexAPI too, where I don't need these file and got the same error.
4.Edit I get then
"C:\Program Files\R\R-4.0.2\bin\x64\R.exe" CMD INSTALL --build --no-multiarch .\Rcplex_0.3-3.tar.gz
* installing to library 'C:/Users/Jonas/Documents/R/win-library/4.0'
* installing *source* package 'Rcplex' ...
** package 'Rcplex' successfully unpacked and MD5 sum checked
** using staged installation
Warning in system("sh ./configure.win") 'sh' not found
ERROR: configuration failed for package 'Rcplex'
* removing 'C:/Users/Jonas/Documents/R/win-library/4.0/Rcplex'
5.Edit Now I get
"C:\Program Files\R\R-4.0.2\bin\x64\R.exe" CMD build --no-build-vignettes --no-manual --md5 C:/Users/Jonas/Desktop/cplexAPI
* checking for file 'C:/Users/Jonas/Desktop/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 and shell scripts
* checking for empty or unneeded directories
* adding MD5 file
* building 'cplexAPI_1.4.0.tar.gz'
Warning: file 'cplexAPI/cleanup' did not have execute permissions: corrected
Warning: file 'cplexAPI/configure' did not have execute permissions: corrected
and
C:\Users\Jonas>"C:\Program Files\R\R-4.0.2\bin\x64\R.exe" CMD INSTALL --build --no-multiarch .\Rcplex_0.3-3.tar.gz
* installing to library 'C:/Users/Jonas/Documents/R/win-library/4.0'
* installing *source* package 'Rcplex' ...
** package 'Rcplex' successfully unpacked and MD5 sums checked
** using staged installation
** libs
"C:/rtools/mingw64/bin/"gcc -I"C:/PROGRA~1/R/R-40~1.2/include" -DNDEBUG -D_LP64 -I"C:/Program Files/IBM/ILOG/CPLEX_Studio_Community1210/cplex/include" -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c Rcplex.c -o Rcplex.o
C:/Program Files/IBM/ILOG/CPLEX_Studio_Community1210/cplex/include/ilcplex/cpxconst.h:251:62: error: expected ')' before 'deprecated'
# define CPXDEPRECATEDAPI(version) __declspec(dllimport deprecated)
^~~~~~~~~~
C:/Program Files/IBM/ILOG/CPLEX_Studio_Community1210/cplex/include/ilcplex/cplex.h:1214:1: note: in expansion of macro 'CPXDEPRECATEDAPI'
CPXDEPRECATEDAPI(12090000)
^~~~~~~~~~~~~~~~
C:/Program Files/IBM/ILOG/CPLEX_Studio_Community1210/cplex/include/ilcplex/cpxconst.h:251:41: error: expected identifier or '(' before ')' token
# define CPXDEPRECATEDAPI(version) __declspec(dllimport deprecated)
^~~~~~~~~~
C:/Program Files/IBM/ILOG/CPLEX_Studio_Community1210/cplex/include/ilcplex/cplex.h:1214:1: note: in expansion of macro 'CPXDEPRECATEDAPI'
CPXDEPRECATEDAPI(12090000)
^~~~~~~~~~~~~~~~
C:/Program Files/IBM/ILOG/CPLEX_Studio_Community1210/cplex/include/ilcplex/cpxconst.h:251:62: error: expected ')' before 'deprecated'
# define CPXDEPRECATEDAPI(version) __declspec(dllimport deprecated)
^~~~~~~~~~
C:/Program Files/IBM/ILOG/CPLEX_Studio_Community1210/cplex/include/ilcplex/cplex.h:1220:1: note: in expansion of macro 'CPXDEPRECATEDAPI'
CPXDEPRECATEDAPI(12090000)
^~~~~~~~~~~~~~~~
C:/Program Files/IBM/ILOG/CPLEX_Studio_Community1210/cplex/include/ilcplex/cpxconst.h:251:41: error: expected identifier or '(' before ')' token
# define CPXDEPRECATEDAPI(version) __declspec(dllimport deprecated)
^~~~~~~~~~
C:/Program Files/IBM/ILOG/CPLEX_Studio_Community1210/cplex/include/ilcplex/cplex.h:1220:1: note: in expansion of macro 'CPXDEPRECATEDAPI'
CPXDEPRECATEDAPI(12090000)
^~~~~~~~~~~~~~~~
C:/Program Files/IBM/ILOG/CPLEX_Studio_Community1210/cplex/include/ilcplex/cpxconst.h:251:62: error: expected ')' before 'deprecated'
# define CPXDEPRECATEDAPI(version) __declspec(dllimport deprecated)
^~~~~~~~~~
C:/Program Files/IBM/ILOG/CPLEX_Studio_Community1210/cplex/include/ilcplex/cplex.h:1251:1: note: in expansion of macro 'CPXDEPRECATEDAPI'
CPXDEPRECATEDAPI(12090000)
^~~~~~~~~~~~~~~~
C:/Program Files/IBM/ILOG/CPLEX_Studio_Community1210/cplex/include/ilcplex/cpxconst.h:251:41: error: expected identifier or '(' before ')' token
# define CPXDEPRECATEDAPI(version) __declspec(dllimport deprecated)
^~~~~~~~~~
C:/Program Files/IBM/ILOG/CPLEX_Studio_Community1210/cplex/include/ilcplex/cplex.h:1251:1: note: in expansion of macro 'CPXDEPRECATEDAPI'
CPXDEPRECATEDAPI(12090000)
^~~~~~~~~~~~~~~~
C:/Program Files/IBM/ILOG/CPLEX_Studio_Community1210/cplex/include/ilcplex/cpxconst.h:251:62: error: expected ')' before 'deprecated'
# define CPXDEPRECATEDAPI(version) __declspec(dllimport deprecated)
^~~~~~~~~~
C:/Program Files/IBM/ILOG/CPLEX_Studio_Community1210/cplex/include/ilcplex/cplex.h:1257:1: note: in expansion of macro 'CPXDEPRECATEDAPI'
CPXDEPRECATEDAPI(12090000)
^~~~~~~~~~~~~~~~
C:/Program Files/IBM/ILOG/CPLEX_Studio_Community1210/cplex/include/ilcplex/cpxconst.h:251:41: error: expected identifier or '(' before ')' token
# define CPXDEPRECATEDAPI(version) __declspec(dllimport deprecated)
^~~~~~~~~~
C:/Program Files/IBM/ILOG/CPLEX_Studio_Community1210/cplex/include/ilcplex/cplex.h:1257:1: note: in expansion of macro 'CPXDEPRECATEDAPI'
CPXDEPRECATEDAPI(12090000)
^~~~~~~~~~~~~~~~
C:/Program Files/IBM/ILOG/CPLEX_Studio_Community1210/cplex/include/ilcplex/cpxconst.h:251:62: error: expected ')' before 'deprecated'
# define CPXDEPRECATEDAPI(version) __declspec(dllimport deprecated)
^~~~~~~~~~
C:/Program Files/IBM/ILOG/CPLEX_Studio_Community1210/cplex/include/ilcplex/cplex.h:1262:1: note: in expansion of macro 'CPXDEPRECATEDAPI'
CPXDEPRECATEDAPI(12090000)
^~~~~~~~~~~~~~~~
C:/Program Files/IBM/ILOG/CPLEX_Studio_Community1210/cplex/include/ilcplex/cpxconst.h:251:41: error: expected identifier or '(' before ')' token
# define CPXDEPRECATEDAPI(version) __declspec(dllimport deprecated)
^~~~~~~~~~
C:/Program Files/IBM/ILOG/CPLEX_Studio_Community1210/cplex/include/ilcplex/cplex.h:1262:1: note: in expansion of macro 'CPXDEPRECATEDAPI'
CPXDEPRECATEDAPI(12090000)
^~~~~~~~~~~~~~~~
C:/Program Files/IBM/ILOG/CPLEX_Studio_Community1210/cplex/include/ilcplex/cpxconst.h:251:62: error: expected ')' before 'deprecated'
# define CPXDEPRECATEDAPI(version) __declspec(dllimport deprecated)
^~~~~~~~~~
C:/Program Files/IBM/ILOG/CPLEX_Studio_Community1210/cplex/include/ilcplex/cplex.h:1617:1: note: in expansion of macro 'CPXDEPRECATEDAPI'
CPXDEPRECATEDAPI(12090000)
^~~~~~~~~~~~~~~~
C:/Program Files/IBM/ILOG/CPLEX_Studio_Community1210/cplex/include/ilcplex/cpxconst.h:251:41: error: expected identifier or '(' before ')' token
# define CPXDEPRECATEDAPI(version) __declspec(dllimport deprecated)
^~~~~~~~~~
C:/Program Files/IBM/ILOG/CPLEX_Studio_Community1210/cplex/include/ilcplex/cplex.h:1617:1: note: in expansion of macro 'CPXDEPRECATEDAPI'
CPXDEPRECATEDAPI(12090000)
^~~~~~~~~~~~~~~~
make: *** [C:/PROGRA~1/R/R-40~1.2/etc/x64/Makeconf:222: Rcplex.o] Error 1
ERROR: compilation failed for package 'Rcplex'
* removing 'C:/Users/Jonas/Documents/R/win-library/4.0/Rcplex'
Also I get the same error,if I try to install cplexAPI
6.Edit
For cplexAPi I have the makevars.win
file
PKG_CPPFLAGS=-g -D_R_=1 -DUSE_R=1 -I"C:\Program Files\IBM\ILOG\CPLEX_Studio_Community1210\cplex\include"
PKG_LIBS=-L"C:\Program Files\IBM\ILOG\CPLEX_Studio_Community1210\cplex\bin\x64_win64" -lm -lcplex12100
and get
"C:\Program Files\R\R-4.0.2\bin\x64\R.exe" CMD build --no-build-vignettes --no-manual --md5 C:/Users/Jonas/Desktop/cplexAPI
* checking for file 'C:/Users/Jonas/Desktop/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 and shell scripts
* checking for empty or unneeded directories
* adding MD5 file
* building 'cplexAPI_1.4.0.tar.gz'
Warning: file 'cplexAPI/cleanup' did not have execute permissions: corrected
Warning: file 'cplexAPI/configure' did not have execute permissions: corrected
and
"C:\Program Files\R\R-4.0.2\bin\x64\R.exe" CMD INSTALL --build --no-multiarch .\cplexAPI_1.4.0.tar.gz
* installing to library 'C:/Users/Jonas/Documents/R/win-library/4.0'
* installing *source* package 'cplexAPI' ...
** package 'Rcplex' successfully unpacked and MD5 sums checked
** using staged installation
** libs
"C:/rtools/mingw64/bin/"gcc -I"C:/PROGRA~1/R/R-40~1.2/include" -DNDEBUG -g -D_R_=1 -DUSE_R=1 -I"C:\Program Files\IBM\ILOG\CPLEX_Studio_Community1210\cplex\include" -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c cplexAPI.c -o cplexAPI.o
C:\Program Files\IBM\ILOG\CPLEX_Studio_Community1210\cplex\include/ilcplex/cpxconst.h:251:62: error: expected ')' before 'deprecated'
# define CPXDEPRECATEDAPI(version) __declspec(dllimport deprecated)
^~~~~~~~~~
C:\Program Files\IBM\ILOG\CPLEX_Studio_Community1210\cplex\include/ilcplex/cplex.h:1214:1: note: in expansion of macro 'CPXDEPRECATEDAPI'
CPXDEPRECATEDAPI(12090000)
^~~~~~~~~~~~~~~~
C:\Program Files\IBM\ILOG\CPLEX_Studio_Community1210\cplex\include/ilcplex/cpxconst.h:251:41: error: expected identifier or '(' before ')' token
# define CPXDEPRECATEDAPI(version) __declspec(dllimport deprecated)
^~~~~~~~~~
C:\Program Files\IBM\ILOG\CPLEX_Studio_Community1210\cplex\include/ilcplex/cplex.h:1214:1: note: in expansion of macro 'CPXDEPRECATEDAPI'
CPXDEPRECATEDAPI(12090000)
^~~~~~~~~~~~~~~~
C:\Program Files\IBM\ILOG\CPLEX_Studio_Community1210\cplex\include/ilcplex/cpxconst.h:251:62: error: expected ')' before 'deprecated'
# define CPXDEPRECATEDAPI(version) __declspec(dllimport deprecated)
^~~~~~~~~~
C:\Program Files\IBM\ILOG\CPLEX_Studio_Community1210\cplex\include/ilcplex/cplex.h:1220:1: note: in expansion of macro 'CPXDEPRECATEDAPI'
CPXDEPRECATEDAPI(12090000)
^~~~~~~~~~~~~~~~
C:\Program Files\IBM\ILOG\CPLEX_Studio_Community1210\cplex\include/ilcplex/cpxconst.h:251:41: error: expected identifier or '(' before ')' token
# define CPXDEPRECATEDAPI(version) __declspec(dllimport deprecated)
^~~~~~~~~~
C:\Program Files\IBM\ILOG\CPLEX_Studio_Community1210\cplex\include/ilcplex/cplex.h:1220:1: note: in expansion of macro 'CPXDEPRECATEDAPI'
CPXDEPRECATEDAPI(12090000)
^~~~~~~~~~~~~~~~
C:\Program Files\IBM\ILOG\CPLEX_Studio_Community1210\cplex\include/ilcplex/cpxconst.h:251:62: error: expected ')' before 'deprecated'
# define CPXDEPRECATEDAPI(version) __declspec(dllimport deprecated)
^~~~~~~~~~
C:\Program Files\IBM\ILOG\CPLEX_Studio_Community1210\cplex\include/ilcplex/cplex.h:1251:1: note: in expansion of macro 'CPXDEPRECATEDAPI'
CPXDEPRECATEDAPI(12090000)
^~~~~~~~~~~~~~~~
C:\Program Files\IBM\ILOG\CPLEX_Studio_Community1210\cplex\include/ilcplex/cpxconst.h:251:41: error: expected identifier or '(' before ')' token
# define CPXDEPRECATEDAPI(version) __declspec(dllimport deprecated)
^~~~~~~~~~
C:\Program Files\IBM\ILOG\CPLEX_Studio_Community1210\cplex\include/ilcplex/cplex.h:1251:1: note: in expansion of macro 'CPXDEPRECATEDAPI'
CPXDEPRECATEDAPI(12090000)
^~~~~~~~~~~~~~~~
C:\Program Files\IBM\ILOG\CPLEX_Studio_Community1210\cplex\include/ilcplex/cpxconst.h:251:62: error: expected ')' before 'deprecated'
# define CPXDEPRECATEDAPI(version) __declspec(dllimport deprecated)
^~~~~~~~~~
C:\Program Files\IBM\ILOG\CPLEX_Studio_Community1210\cplex\include/ilcplex/cplex.h:1257:1: note: in expansion of macro 'CPXDEPRECATEDAPI'
CPXDEPRECATEDAPI(12090000)
^~~~~~~~~~~~~~~~
C:\Program Files\IBM\ILOG\CPLEX_Studio_Community1210\cplex\include/ilcplex/cpxconst.h:251:41: error: expected identifier or '(' before ')' token
# define CPXDEPRECATEDAPI(version) __declspec(dllimport deprecated)
^~~~~~~~~~
C:\Program Files\IBM\ILOG\CPLEX_Studio_Community1210\cplex\include/ilcplex/cplex.h:1257:1: note: in expansion of macro 'CPXDEPRECATEDAPI'
CPXDEPRECATEDAPI(12090000)
^~~~~~~~~~~~~~~~
C:\Program Files\IBM\ILOG\CPLEX_Studio_Community1210\cplex\include/ilcplex/cpxconst.h:251:62: error: expected ')' before 'deprecated'
# define CPXDEPRECATEDAPI(version) __declspec(dllimport deprecated)
^~~~~~~~~~
C:\Program Files\IBM\ILOG\CPLEX_Studio_Community1210\cplex\include/ilcplex/cplex.h:1262:1: note: in expansion of macro 'CPXDEPRECATEDAPI'
CPXDEPRECATEDAPI(12090000)
^~~~~~~~~~~~~~~~
C:\Program Files\IBM\ILOG\CPLEX_Studio_Community1210\cplex\include/ilcplex/cpxconst.h:251:41: error: expected identifier or '(' before ')' token
# define CPXDEPRECATEDAPI(version) __declspec(dllimport deprecated)
^~~~~~~~~~
C:\Program Files\IBM\ILOG\CPLEX_Studio_Community1210\cplex\include/ilcplex/cplex.h:1262:1: note: in expansion of macro 'CPXDEPRECATEDAPI'
CPXDEPRECATEDAPI(12090000)
^~~~~~~~~~~~~~~~
C:\Program Files\IBM\ILOG\CPLEX_Studio_Community1210\cplex\include/ilcplex/cpxconst.h:251:62: error: expected ')' before 'deprecated'
# define CPXDEPRECATEDAPI(version) __declspec(dllimport deprecated)
^~~~~~~~~~
C:\Program Files\IBM\ILOG\CPLEX_Studio_Community1210\cplex\include/ilcplex/cplex.h:1617:1: note: in expansion of macro 'CPXDEPRECATEDAPI'
CPXDEPRECATEDAPI(12090000)
^~~~~~~~~~~~~~~~
C:\Program Files\IBM\ILOG\CPLEX_Studio_Community1210\cplex\include/ilcplex/cpxconst.h:251:41: error: expected identifier or '(' before ')' token
# define CPXDEPRECATEDAPI(version) __declspec(dllimport deprecated)
^~~~~~~~~~
C:\Program Files\IBM\ILOG\CPLEX_Studio_Community1210\cplex\include/ilcplex/cplex.h:1617:1: note: in expansion of macro 'CPXDEPRECATEDAPI'
CPXDEPRECATEDAPI(12090000)
^~~~~~~~~~~~~~~~
make: *** [C:/PROGRA~1/R/R-40~1.2/etc/x64/Makeconf:222: cplexAPI.o] Error 1
ERROR: compilation failed for package 'cplexAPI'
* removing 'C:/Users/Jonas/Documents/R/win-library/4.0/cplexAPI'
So there is the same problem.
来源:https://stackoverflow.com/questions/63942596/install-rcplex-on-windows