I want to install the cplexAPI R package to interact with the newest version of IBM CPLEX solver (IBM ILOG CPLEX Optimizers 12.10.0) but I keep getting the following error:
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported. Defaulting to Windows directory.
* installing *source* package 'cplexAPI' ...
** package 'cplexAPI' successfully unpacked and MD5 sums checked
** using staged installation
** libs
*** arch - i386
"C:/rtools40/mingw32/bin/"gcc -I"C:/Users/USERNAME/R/R-40~1.3/include" -DNDEBUG -g -D_R_=1 -DUSE_R=1 -I"C:\Program Files\IBM\ILOG\CPLEX_Studio1210\cplex\include" -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c cplexAPI.c -o cplexAPI.o
C:\Program Files\IBM\ILOG\CPLEX_Studio1210\cplex\include/ilcplex/cpxconst.h:251:62: error: expected ')' before 'deprecated'
# define CPXDEPRECATEDAPI(version) __declspec(dllimport deprecated)
^~~~~~~~~~
C:\Program Files\IBM\ILOG\CPLEX_Studio1210\cplex\include/ilcplex/cplex.h:1214:1: note: in expansion of macro 'CPXDEPRECATEDAPI'
CPXDEPRECATEDAPI(12090000)
^~~~~~~~~~~~~~~~
C:\Program Files\IBM\ILOG\CPLEX_Studio1210\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_Studio1210\cplex\include/ilcplex/cplex.h:1214:1: note: in expansion of macro 'CPXDEPRECATEDAPI'
CPXDEPRECATEDAPI(12090000)
^~~~~~~~~~~~~~~~
C:\Program Files\IBM\ILOG\CPLEX_Studio1210\cplex\include/ilcplex/cpxconst.h:251:62: error: expected ')' before 'deprecated'
# define CPXDEPRECATEDAPI(version) __declspec(dllimport deprecated)
I have done the following:
Installed Rtools40 from [https://cran.r-project.org/bin/windows/Rtools/][1], and added
PATH="${RTOOLS40_HOME}\usr\bin;${PATH}"
in my.Renviron
fileInstalled IBM CPLEX in
C:\Program Files\IBM\ILOG\CPLEX_Studio1210
Added the following paths in my
.Renviron
file:CPLEX_STUDIO_DIR = "C:\Program Files\IBM\ILOG\CPLEX_Studio1210"
CPLEX_STUDIO_LIB = "C:\Program Files\IBM\ILOG\CPLEX_Studio1210\cplex\lib"
Run
install.packages('cplexAPI')
. I have also tried to manually download the tar.gz file and modify the path in the Makevars.win file, but I get the same error. FYI, I have the following R version:
platform x86_64-w64-mingw32 arch x86_64 os mingw32 system x86_64, mingw32 status major 4 minor 0.3 year 2020 month 10 day 10 svn rev 79318 language R version.string R version 4.0.3 (2020-10-10) nickname Bunny-Wunnies Freak Out