I've had a great deal of issues installing Rcplex in windows. Here is my makevars.win:
set CPLEX_DIR='C:/Program Files/IBM/ILOG/CPLEX_Studio1263/cplex/'
ifeq "$(WIN)" "64"
PKG_LIBS = -L"${CPLEX_DIR}/bin/x64_win64" -lcplex201 -lm
PKG_CPPFLAGS = -D_LP64 -I"${CPLEX_DIR}/include" -DBUILD_CPXSTATIC
else
PKG_LIBS = -L"${CPLEX_DIR}/bin/x86_win32" -lcplex201 -lm
PKG_CPPFLAGS = -I"${CPLEX_DIR}/include"
endif
Here is the result of attempting to install the package in R:
> install.packages("Rcplex")
Installing package into 'C:/Users/dalgleishjl/Documents/R/win-library/4.1'
(as 'lib' is unspecified)
--- Please select a CRAN mirror for use in this session ---
Package which is only available in source form, and may need
compilation of C/C++/Fortran: 'Rcplex'
Do you want to attempt to install these from sources? (Yes/no/cancel)
installing the source package 'Rcplex'
trying URL 'https://cloud.r-project.org/src/contrib/Rcplex_0.3-3.tar.gz'
Content type 'application/x-gzip' length 49931 bytes (48 KB)
downloaded 48 KB
* installing *source* package 'Rcplex' ...
** package 'Rcplex' successfully unpacked and MD5 sums checked
** using staged installation
** libs
*** arch - i386
"C:/rtools40/mingw32/bin/"gcc -I"c:/PROGRA~1/R/R-41~1.1/include" -DNDEBUG -I""C:/Program Files/IBM/ILOG/CPLEX_Studio1263/cplex/"/include" -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c Rcplex.c -o Rcplex.o
41 [main] make 18852 C:\Rtools\bin\make.exe: *** fatal error in forked process - MapViewOfFileEx '(null)'(0x2B8), Win32 error 5. Terminating.
1 [main] make 12244 fork: child 18852 - died waiting for dll loading, errno 11
make: fork: Resource temporarily unavailable
ERROR: compilation failed for package 'Rcplex'
* removing 'C:/Users/dalgleishjl/Documents/R/win-library/4.1/Rcplex'
The downloaded source packages are in
'C:\Users\dalgleishjl\AppData\Local\Temp\2\RtmpmQ1n1b\downloaded_packages'
Warning message:
In install.packages("Rcplex") :
installation of package 'Rcplex' had non-zero exit status
Here is what happens when installing to a git cloned copy of Rcplex:
C:\Users\dalgleishjl\Documents\gGnome\Rcplex>R CMD INSTALL .
* installing to library 'C:/Users/dalgleishjl/Documents/R/win-library/4.1'
* installing *source* package 'Rcplex' ...
file 'src/Makevars.win' has the wrong MD5 checksum
** using staged installation
** libs
*** arch - i386
make: *** No rule to make target '/Program', needed by 'set'. Stop.
ERROR: compilation failed for package 'Rcplex'
* removing 'C:/Users/dalgleishjl/Documents/R/win-library/4.1/Rcplex'
UPDATE: After changing makevars.Win to have the following text: CPLEX_DIR="C:/CPLEX/cplex/" ifeq "$(WIN)" "64" PKG_LIBS = -L"${CPLEX_DIR}/bin/x64_win64" -lcplex1263 -lm PKG_CPPFLAGS = -D_LP64 -I"${CPLEX_DIR}/include" else PKG_LIBS = -L"${CPLEX_DIR}/bin/x86_win32" -lcplex1263 -lm PKG_CPPFLAGS = -I"${CPLEX_DIR}/include" endif
I get the following result installing within the directory of gGnome (which also uses Rcplex):
$ /C/R/R-4.1.1/bin/x64/R.exe CMD INSTALL --no-multiarch .
* installing to library 'C:/R/R-4.1.1/library'
* installing *source* package 'gGnome' ...
** using staged installation
** libs
"C:/rtools40/mingw64/bin/"gcc -I"C:/R/R-4.1.1/include" -DNDEBUG -D_LP64 -I""C:/CPLEX/cplex/"/include" -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c Rcplex2.c -o Rcplex2.o
C:/CPLEX/cplex/include/ilcplex/cpxconst.h:249:62: error: expected ')' before 'deprecated'
# define CPXDEPRECATEDAPI(version) __declspec(dllimport deprecated)
^~~~~~~~~~
C:/CPLEX/cplex/include/ilcplex/cplex.h:35:1: note: in expansion of macro 'CPXDEPRECATEDAPI'
CPXDEPRECATEDAPI(12060200)
^~~~~~~~~~~~~~~~
C:/CPLEX/cplex/include/ilcplex/cpxconst.h:249:41: error: expected identifier or '(' before ')' token
# define CPXDEPRECATEDAPI(version) __declspec(dllimport deprecated)
^~~~~~~~~~
C:/CPLEX/cplex/include/ilcplex/cplex.h:35:1: note: in expansion of macro 'CPXDEPRECATEDAPI'
CPXDEPRECATEDAPI(12060200)
^~~~~~~~~~~~~~~~
C:/CPLEX/cplex/include/ilcplex/cpxconst.h:249:62: error: expected ')' before 'deprecated'
# define CPXDEPRECATEDAPI(version) __declspec(dllimport deprecated)
^~~~~~~~~~
C:/CPLEX/cplex/include/ilcplex/cplex.h:335:1: note: in expansion of macro 'CPXDEPRECATEDAPI'
CPXDEPRECATEDAPI(12060200)
^~~~~~~~~~~~~~~~
C:/CPLEX/cplex/include/ilcplex/cpxconst.h:249:41: error: expected identifier or '(' before ')' token
# define CPXDEPRECATEDAPI(version) __declspec(dllimport deprecated)
^~~~~~~~~~
C:/CPLEX/cplex/include/ilcplex/cplex.h:335:1: note: in expansion of macro 'CPXDEPRECATEDAPI'
CPXDEPRECATEDAPI(12060200)
^~~~~~~~~~~~~~~~
C:/CPLEX/cplex/include/ilcplex/cpxconst.h:249:62: error: expected ')' before 'deprecated'
# define CPXDEPRECATEDAPI(version) __declspec(dllimport deprecated)
^~~~~~~~~~
C:/CPLEX/cplex/include/ilcplex/cplex.h:462:1: note: in expansion of macro 'CPXDEPRECATEDAPI'
CPXDEPRECATEDAPI(12040000)
^~~~~~~~~~~~~~~~
C:/CPLEX/cplex/include/ilcplex/cpxconst.h:249:41: error: expected identifier or '(' before ')' token
# define CPXDEPRECATEDAPI(version) __declspec(dllimport deprecated)
^~~~~~~~~~
C:/CPLEX/cplex/include/ilcplex/cplex.h:462:1: note: in expansion of macro 'CPXDEPRECATEDAPI'
CPXDEPRECATEDAPI(12040000)
^~~~~~~~~~~~~~~~
C:/CPLEX/cplex/include/ilcplex/cpxconst.h:249:62: error: expected ')' before 'deprecated'
# define CPXDEPRECATEDAPI(version) __declspec(dllimport deprecated)
^~~~~~~~~~
C:/CPLEX/cplex/include/ilcplex/cplex.h:488:1: note: in expansion of macro 'CPXDEPRECATEDAPI'
CPXDEPRECATEDAPI(12040000)
^~~~~~~~~~~~~~~~
C:/CPLEX/cplex/include/ilcplex/cpxconst.h:249:41: error: expected identifier or '(' before ')' token
# define CPXDEPRECATEDAPI(version) __declspec(dllimport deprecated)
^~~~~~~~~~
C:/CPLEX/cplex/include/ilcplex/cplex.h:488:1: note: in expansion of macro 'CPXDEPRECATEDAPI'
CPXDEPRECATEDAPI(12040000)
^~~~~~~~~~~~~~~~
C:/CPLEX/cplex/include/ilcplex/cpxconst.h:249:62: error: expected ')' before 'deprecated'
# define CPXDEPRECATEDAPI(version) __declspec(dllimport deprecated)
^~~~~~~~~~
C:/CPLEX/cplex/include/ilcplex/cplex.h:668:1: note: in expansion of macro 'CPXDEPRECATEDAPI'
CPXDEPRECATEDAPI(12040000)
^~~~~~~~~~~~~~~~
C:/CPLEX/cplex/include/ilcplex/cpxconst.h:249:41: error: expected identifier or '(' before ')' token
# define CPXDEPRECATEDAPI(version) __declspec(dllimport deprecated)
^~~~~~~~~~
C:/CPLEX/cplex/include/ilcplex/cplex.h:668:1: note: in expansion of macro 'CPXDEPRECATEDAPI'
CPXDEPRECATEDAPI(12040000)
^~~~~~~~~~~~~~~~
C:/CPLEX/cplex/include/ilcplex/cpxconst.h:249:62: error: expected ')' before 'deprecated'
# define CPXDEPRECATEDAPI(version) __declspec(dllimport deprecated)
^~~~~~~~~~
C:/CPLEX/cplex/include/ilcplex/cplex.h:1032:1: note: in expansion of macro 'CPXDEPRECATEDAPI'
CPXDEPRECATEDAPI(12040000)
^~~~~~~~~~~~~~~~
C:/CPLEX/cplex/include/ilcplex/cpxconst.h:249:41: error: expected identifier or '(' before ')' token
# define CPXDEPRECATEDAPI(version) __declspec(dllimport deprecated)
^~~~~~~~~~
C:/CPLEX/cplex/include/ilcplex/cplex.h:1032:1: note: in expansion of macro 'CPXDEPRECATEDAPI'
CPXDEPRECATEDAPI(12040000)
^~~~~~~~~~~~~~~~
C:/CPLEX/cplex/include/ilcplex/cpxconst.h:249:62: error: expected ')' before 'deprecated'
# define CPXDEPRECATEDAPI(version) __declspec(dllimport deprecated)
^~~~~~~~~~
C:/CPLEX/cplex/include/ilcplex/cplex.h:1049:1: note: in expansion of macro 'CPXDEPRECATEDAPI'
CPXDEPRECATEDAPI(12040000)
^~~~~~~~~~~~~~~~
C:/CPLEX/cplex/include/ilcplex/cpxconst.h:249:41: error: expected identifier or '(' before ')' token
# define CPXDEPRECATEDAPI(version) __declspec(dllimport deprecated)
^~~~~~~~~~
C:/CPLEX/cplex/include/ilcplex/cplex.h:1049:1: note: in expansion of macro 'CPXDEPRECATEDAPI'
CPXDEPRECATEDAPI(12040000)
^~~~~~~~~~~~~~~~
C:/CPLEX/cplex/include/ilcplex/cpxconst.h:249:62: error: expected ')' before 'deprecated'
# define CPXDEPRECATEDAPI(version) __declspec(dllimport deprecated)
^~~~~~~~~~
C:/CPLEX/cplex/include/ilcplex/cplex.h:1178:1: note: in expansion of macro 'CPXDEPRECATEDAPI'
CPXDEPRECATEDAPI(12060100)
^~~~~~~~~~~~~~~~
C:/CPLEX/cplex/include/ilcplex/cpxconst.h:249:41: error: expected identifier or '(' before ')' token
# define CPXDEPRECATEDAPI(version) __declspec(dllimport deprecated)
^~~~~~~~~~
C:/CPLEX/cplex/include/ilcplex/cplex.h:1178:1: note: in expansion of macro 'CPXDEPRECATEDAPI'
CPXDEPRECATEDAPI(12060100)
^~~~~~~~~~~~~~~~
C:/CPLEX/cplex/include/ilcplex/cpxconst.h:249:62: error: expected ')' before 'deprecated'
# define CPXDEPRECATEDAPI(version) __declspec(dllimport deprecated)
^~~~~~~~~~
C:/CPLEX/cplex/include/ilcplex/cplex.h:1218:1: note: in expansion of macro 'CPXDEPRECATEDAPI'
CPXDEPRECATEDAPI(12040000)
^~~~~~~~~~~~~~~~
C:/CPLEX/cplex/include/ilcplex/cpxconst.h:249:41: error: expected identifier or '(' before ')' token
# define CPXDEPRECATEDAPI(version) __declspec(dllimport deprecated)
^~~~~~~~~~
C:/CPLEX/cplex/include/ilcplex/cplex.h:1218:1: note: in expansion of macro 'CPXDEPRECATEDAPI'
CPXDEPRECATEDAPI(12040000)
^~~~~~~~~~~~~~~~
C:/CPLEX/cplex/include/ilcplex/cpxconst.h:249:62: error: expected ')' before 'deprecated'
# define CPXDEPRECATEDAPI(version) __declspec(dllimport deprecated)
^~~~~~~~~~
C:/CPLEX/cplex/include/ilcplex/cplex.h:1224:1: note: in expansion of macro 'CPXDEPRECATEDAPI'
CPXDEPRECATEDAPI(12040000)
^~~~~~~~~~~~~~~~
C:/CPLEX/cplex/include/ilcplex/cpxconst.h:249:41: error: expected identifier or '(' before ')' token
# define CPXDEPRECATEDAPI(version) __declspec(dllimport deprecated)
^~~~~~~~~~
C:/CPLEX/cplex/include/ilcplex/cplex.h:1224:1: note: in expansion of macro 'CPXDEPRECATEDAPI'
CPXDEPRECATEDAPI(12040000)
^~~~~~~~~~~~~~~~
C:/CPLEX/cplex/include/ilcplex/cpxconst.h:249:62: error: expected ')' before 'deprecated'
# define CPXDEPRECATEDAPI(version) __declspec(dllimport deprecated)
^~~~~~~~~~
C:/CPLEX/cplex/include/ilcplex/cplex.h:1390:1: note: in expansion of macro 'CPXDEPRECATEDAPI'
CPXDEPRECATEDAPI(12040000)
^~~~~~~~~~~~~~~~
C:/CPLEX/cplex/include/ilcplex/cpxconst.h:249:41: error: expected identifier or '(' before ')' token
# define CPXDEPRECATEDAPI(version) __declspec(dllimport deprecated)
^~~~~~~~~~
C:/CPLEX/cplex/include/ilcplex/cplex.h:1390:1: note: in expansion of macro 'CPXDEPRECATEDAPI'
CPXDEPRECATEDAPI(12040000)
^~~~~~~~~~~~~~~~
C:/CPLEX/cplex/include/ilcplex/cpxconst.h:249:62: error: expected ')' before 'deprecated'
# define CPXDEPRECATEDAPI(version) __declspec(dllimport deprecated)
^~~~~~~~~~
C:/CPLEX/cplex/include/ilcplex/cplex.h:1395:1: note: in expansion of macro 'CPXDEPRECATEDAPI'
CPXDEPRECATEDAPI(12040000)
^~~~~~~~~~~~~~~~
C:/CPLEX/cplex/include/ilcplex/cpxconst.h:249:41: error: expected identifier or '(' before ')' token
# define CPXDEPRECATEDAPI(version) __declspec(dllimport deprecated)
^~~~~~~~~~
C:/CPLEX/cplex/include/ilcplex/cplex.h:1395:1: note: in expansion of macro 'CPXDEPRECATEDAPI'
CPXDEPRECATEDAPI(12040000)
^~~~~~~~~~~~~~~~
C:/CPLEX/cplex/include/ilcplex/cpxconst.h:249:62: error: expected ')' before 'deprecated'
# define CPXDEPRECATEDAPI(version) __declspec(dllimport deprecated)
^~~~~~~~~~
C:/CPLEX/cplex/include/ilcplex/cplex.h:1430:1: note: in expansion of macro 'CPXDEPRECATEDAPI'
CPXDEPRECATEDAPI(12040000)
^~~~~~~~~~~~~~~~
C:/CPLEX/cplex/include/ilcplex/cpxconst.h:249:41: error: expected identifier or '(' before ')' token
# define CPXDEPRECATEDAPI(version) __declspec(dllimport deprecated)
^~~~~~~~~~
C:/CPLEX/cplex/include/ilcplex/cplex.h:1430:1: note: in expansion of macro 'CPXDEPRECATEDAPI'
CPXDEPRECATEDAPI(12040000)
^~~~~~~~~~~~~~~~
C:/CPLEX/cplex/include/ilcplex/cpxconst.h:249:62: error: expected ')' before 'deprecated'
# define CPXDEPRECATEDAPI(version) __declspec(dllimport deprecated)
^~~~~~~~~~
C:/CPLEX/cplex/include/ilcplex/cplex.h:1460:1: note: in expansion of macro 'CPXDEPRECATEDAPI'
CPXDEPRECATEDAPI(12040000)
^~~~~~~~~~~~~~~~
C:/CPLEX/cplex/include/ilcplex/cpxconst.h:249:41: error: expected identifier or '(' before ')' token
# define CPXDEPRECATEDAPI(version) __declspec(dllimport deprecated)
^~~~~~~~~~
C:/CPLEX/cplex/include/ilcplex/cplex.h:1460:1: note: in expansion of macro 'CPXDEPRECATEDAPI'
CPXDEPRECATEDAPI(12040000)
^~~~~~~~~~~~~~~~
C:/CPLEX/cplex/include/ilcplex/cpxconst.h:249:62: error: expected ')' before 'deprecated'
# define CPXDEPRECATEDAPI(version) __declspec(dllimport deprecated)
^~~~~~~~~~
C:/CPLEX/cplex/include/ilcplex/cplex.h:1676:1: note: in expansion of macro 'CPXDEPRECATEDAPI'
CPXDEPRECATEDAPI(12040000)
^~~~~~~~~~~~~~~~
C:/CPLEX/cplex/include/ilcplex/cpxconst.h:249:41: error: expected identifier or '(' before ')' token
# define CPXDEPRECATEDAPI(version) __declspec(dllimport deprecated)
^~~~~~~~~~
C:/CPLEX/cplex/include/ilcplex/cplex.h:1676:1: note: in expansion of macro 'CPXDEPRECATEDAPI'
CPXDEPRECATEDAPI(12040000)
^~~~~~~~~~~~~~~~
C:/CPLEX/cplex/include/ilcplex/cpxconst.h:249:62: error: expected ')' before 'deprecated'
# define CPXDEPRECATEDAPI(version) __declspec(dllimport deprecated)
^~~~~~~~~~
C:/CPLEX/cplex/include/ilcplex/cplex.h:1924:1: note: in expansion of macro 'CPXDEPRECATEDAPI'
CPXDEPRECATEDAPI(12040000)
^~~~~~~~~~~~~~~~
C:/CPLEX/cplex/include/ilcplex/cpxconst.h:249:41: error: expected identifier or '(' before ')' token
# define CPXDEPRECATEDAPI(version) __declspec(dllimport deprecated)
^~~~~~~~~~
C:/CPLEX/cplex/include/ilcplex/cplex.h:1924:1: note: in expansion of macro 'CPXDEPRECATEDAPI'
CPXDEPRECATEDAPI(12040000)
^~~~~~~~~~~~~~~~
C:/CPLEX/cplex/include/ilcplex/cpxconst.h:249:62: error: expected ')' before 'deprecated'
# define CPXDEPRECATEDAPI(version) __declspec(dllimport deprecated)
^~~~~~~~~~
C:/CPLEX/cplex/include/ilcplex/cplex.h:2341:1: note: in expansion of macro 'CPXDEPRECATEDAPI'
CPXDEPRECATEDAPI(12040000)
^~~~~~~~~~~~~~~~
C:/CPLEX/cplex/include/ilcplex/cpxconst.h:249:41: error: expected identifier or '(' before ')' token
# define CPXDEPRECATEDAPI(version) __declspec(dllimport deprecated)
^~~~~~~~~~
C:/CPLEX/cplex/include/ilcplex/cplex.h:2341:1: note: in expansion of macro 'CPXDEPRECATEDAPI'
CPXDEPRECATEDAPI(12040000)
^~~~~~~~~~~~~~~~
make: *** [C:/R/R-4.1.1/etc/x64/Makeconf:238: Rcplex2.o] Error 1
ERROR: compilation failed for package 'gGnome'
* removing 'C:/R/R-4.1.1/library/gGnome'