LiChenPU / NetID

A global network optimization approach for untargeted LC-MS metabolomics data annotation and metabolite discovery
GNU General Public License v3.0
44 stars 25 forks source link

Unable to install the package "cplexAPI" #5

Open ZENGTing94 opened 2 years ago

ZENGTing94 commented 2 years ago

Dear Prof.Chen,

Thanks for your excellent work! I am a graduate student majoring in metabolomics. According to your User_guide, I have installed R, Rstudio, Rtools40, CPLEX and Git. And my question is in the step 1.3.2. I can't install the package "cplexAPI".

Could you please kindly give me some suggestions about it?

Thank you so much!

Best wishes Ting Zeng

LiChenPU commented 2 years ago

Please check the user guide.

  1. In command line, run line below to install package.

R CMD INSTALL --build --no-multiarch .\cplexAPI_1.4.0.tar.gz

If you see DONE (cplexAPI), then the package installation is successful.

Note: if error occurs relating to __declspec(dllimport deprecated), you need to go

to C:\Program Files\IBM\ILOG\CPLEX_Studio1210\cplex\include\ilcplex (or your

own installation folder), open the file cpxconst.h, go to the line indicated in the error

message or search for _declspec(dllimport deprecated), add in between, make it

to __declspec(dllimport_deprecated). Save file and repeat step 4.

发件人: @. @.> 代表 ZENGTing94 发送时间: Thursday, November 18, 2021 7:32 PM 收件人: LiChenPU/NetID @.> 抄送: Subscribed @.> 主题: [LiChenPU/NetID] Unable to install the package "cplexAPI" (Issue #5)

Dear Prof.Chen,

Thanks for your excellent work! I am a graduate student majoring in metabolomics. According to your User_guide, I have installed R, Rstudio, Rtools40, CPLEX and Git. And my question is in the step 1.3.2. I can't install the package "cplexAPI".

setwd("C:/Users/11458/Desktop/cplexAPI")

devtools::build(vignettes=FALSE) √ checking for file 'C:\Users\11458\Desktop\cplexAPI/DESCRIPTION' ...

[1] "C:/Users/11458/Desktop/cplexAPI_1.4.0.tar.gz"

install.packages("C:/Users/11458/Desktop/cplexAPI_1.4.0.tar.gz", repos = NULL, type = "source") Installing package into ‘C:/Users/11458/Documents/R/win-library/4.1’ (as ‘lib’ is unspecified)

*** arch - i386 /mingw32/bin/gcc -I"C:/PROGRA1/R/R-411.2/include" -DNDEBUG -g -DR=1 -DUSE_R=1 -I"C:/Program Files/IBM/ILOG/CPLEX_Studio_Community201/cplex/include" -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c cplexAPI.c -o cplexAPI.o C:/Program Files/IBM/ILOG/CPLEX_Studio_Community201/cplex/include/ilcplex/cpxconst.h:251:62: error: expected ')' before 'deprecated'

define CPXDEPRECATEDAPI(version) __declspec(dllimport deprecated)

                                                      ^~~~~~~~~~

C:/Program Files/IBM/ILOG/CPLEX_Studio_Community201/cplex/include/ilcplex/cplex.h:1587:1: note: in expansion of macro 'CPXDEPRECATEDAPI' CPXDEPRECATEDAPI(20010000) ^~~~ C:/Program Files/IBM/ILOG/CPLEX_Studio_Community201/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_Community201/cplex/include/ilcplex/cplex.h:1587:1: note: in expansion of macro 'CPXDEPRECATEDAPI' CPXDEPRECATEDAPI(20010000) ^~~~ C:/Program Files/IBM/ILOG/CPLEX_Studio_Community201/cplex/include/ilcplex/cpxconst.h:251:62: error: expected ')' before 'deprecated'

define CPXDEPRECATEDAPI(version) __declspec(dllimport deprecated)

                                                      ^~~~~~~~~~

C:/Program Files/IBM/ILOG/CPLEX_Studio_Community201/cplex/include/ilcplex/cplex.h:1599:1: note: in expansion of macro 'CPXDEPRECATEDAPI' CPXDEPRECATEDAPI(20010000) ^~~~ C:/Program Files/IBM/ILOG/CPLEX_Studio_Community201/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_Community201/cplex/include/ilcplex/cplex.h:1599:1: note: in expansion of macro 'CPXDEPRECATEDAPI' CPXDEPRECATEDAPI(20010000) ^~~~ C:/Program Files/IBM/ILOG/CPLEX_Studio_Community201/cplex/include/ilcplex/cpxconst.h:251:62: error: expected ')' before 'deprecated'

define CPXDEPRECATEDAPI(version) __declspec(dllimport deprecated)

                                                      ^~~~~~~~~~

C:/Program Files/IBM/ILOG/CPLEX_Studio_Community201/cplex/include/ilcplex/cplex.h:2722:1: note: in expansion of macro 'CPXDEPRECATEDAPI' CPXDEPRECATEDAPI(20010000) ^~~~ C:/Program Files/IBM/ILOG/CPLEX_Studio_Community201/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_Community201/cplex/include/ilcplex/cplex.h:2722:1: note: in expansion of macro 'CPXDEPRECATEDAPI' CPXDEPRECATEDAPI(20010000) ^~~~ cplexAPI.c: In function 'refineConflict': cplexAPI.c:4010:14: warning: implicit declaration of function 'CPXrefineconflict'; did you mean 'CPXrefineconflictext'? [-Wimplicit-function-declaration] status = CPXrefineconflict(R_ExternalPtrAddr(env), R_ExternalPtrAddr(lp), ^~~~~ CPXrefineconflictext cplexAPI.c: In function 'readCopySol': cplexAPI.c:4515:14: warning: implicit declaration of function 'CPXreadcopysol'; did you mean 'CPXreadcopyprob'? [-Wimplicit-function-declaration] status = CPXreadcopysol(R_ExternalPtrAddr(env), R_ExternalPtrAddr(lp), ^~~~~~ CPXreadcopyprob cplexAPI.c: In function 'refineMIPstartConflict': cplexAPI.c:5908:14: warning: implicit declaration of function 'CPXrefinemipstartconflict'; did you mean 'CPXrefinemipstartconflictext'? [-Wimplicit-function-declaration] status = CPXrefinemipstartconflict(R_ExternalPtrAddr(env), ^~~~~~~~~ CPXrefinemipstartconflictext make: *** [C:/PROGRA1/R/R-411.2/etc/i386/Makeconf:238: cplexAPI.o] Error 1 ERROR: compilation failed for package 'cplexAPI'

R CMD INSTALL --build --no-multiarch .\cplexAPI_1.4.0.tar.gz Error: unexpected symbol in "R CMD"

Could you please kindly give me some suggestions about it?

Thank you so much!

Best wishes Ting Zeng

— You are receiving this because you are subscribed to this thread. Reply to this email directly, https://github.com/LiChenPU/NetID/issues/5 view it on GitHub, or https://github.com/notifications/unsubscribe-auth/AIN7EZHMYRSXHFDZ5OJNECTUMTPZDANCNFSM5IJL7QTQ unsubscribe. Triage notifications on the go with GitHub Mobile for https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 iOS or https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub Android.

lbrow121 commented 2 years ago

Hi there!

I am also having the same issue when installing the cplexAPI package. I have completed all steps of the user guide, including 1.3.2 step 3 where the package cplexAPI_1.4.0.tar.gz is successfully built. I'm having trouble installing it using the R CMD INSTALL --build --no-multiarch .\cplexAPI_1.4.0.tar.gz line. I've searched online for help and found that MINGW64 compiler is potentially not supported by IBM (https://stackoverflow.com/questions/67462291/ilcplex-ilocplex-h-no-such-file-or-directory). What are your thoughts on this? Do you have any advice on this step? Thank you! The output is attached below. Note: I did end up removing the dot before \cplexAPI_1.4.0.tar.gz as keeping the dot gave me the following error: Warning: invalid package '.cplexAPI_1.4.0.tar.gz Error: ERROR: no packages specified


$ R CMD INSTALL --build --no-multiarch \cplexAPI_1.4.0.tar.gz

LiChenPU commented 2 years ago

Hi,

It looks like you need to specify a correct path of cplexAPI_1.4.0.tar.gz for R CMD to recognize.

R CMD INSTALL --build --no-multiarch \cplexAPI_1.4.0.tar.gz

Set the path as where you build the file “cplexAPI_1.4.0.tar.gz”. Another way of trouble shooting “R CMD INSTALL” is that you can download a well-established package in tar.gz format and install it.

发件人: @. @.> 代表 lbrow121 发送时间: Sunday, December 5, 2021 3:15 AM 收件人: LiChenPU/NetID @.> 抄送: LiChenPU @.>; Comment @.***> 主题: Re: [LiChenPU/NetID] Unable to install the package "cplexAPI" (Issue

5)

Hi there!

I am also having the same issue when installing the cplexAPI package. I have completed all steps of the user guide, including 1.3.2 step 3 where the package cplexAPI_1.4.0.tar.gz is successfully built. I'm having trouble installing it using the R CMD INSTALL --build --no-multiarch .\cplexAPI_1.4. 0.tar.gz line. I've searched online for help and found that MINGW64 compiler is potentially not supported by IBM (https://stackoverflow.com/questions/67462291/ilcplex-ilocplex-h-no-such-fil e-or-directory). What are your thoughts on this? Do you have any advice on this step? Thank you! The output is attached below. Note: I did end up removing the dot before \cplexAPI_1.4.0.tar.gz as keeping the dot gave me the following error: Warning: invalid package '.cplexAPI_1.4.0.tar.gz Error: ERROR: no packages specified


$ R CMD INSTALL --build --no-multiarch \cplexAPI_1.4.0.tar.gz

― You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/LiChenPU/NetID/issues/5#issuecomment-986078871 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AIN7EZC3ZVQOY6XZYTJFGKDUP JSDJANCNFSM5IJL7QTQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&m t=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=u tm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub .

ZENGTing94 commented 2 years ago

Thanks a lot! I have installed it successfully.

在 2021年12月10日,下午1:15,LiChenPU @.***> 写道:

 Hi,

It looks like you need to specify a correct path of cplexAPI_1.4.0.tar.gz for R CMD to recognize.

R CMD INSTALL --build --no-multiarch \cplexAPI_1.4.0.tar.gz

Set the path as where you build the file “cplexAPI_1.4.0.tar.gz”. Another way of trouble shooting “R CMD INSTALL” is that you can download a well-established package in tar.gz format and install it.

发件人: @. @.> 代表 lbrow121 发送时间: Sunday, December 5, 2021 3:15 AM 收件人: LiChenPU/NetID @.> 抄送: LiChenPU @.>; Comment @.***> 主题: Re: [LiChenPU/NetID] Unable to install the package "cplexAPI" (Issue

5)

Hi there!

I am also having the same issue when installing the cplexAPI package. I have completed all steps of the user guide, including 1.3.2 step 3 where the package cplexAPI_1.4.0.tar.gz is successfully built. I'm having trouble installing it using the R CMD INSTALL --build --no-multiarch .\cplexAPI_1.4. 0.tar.gz line. I've searched online for help and found that MINGW64 compiler is potentially not supported by IBM (https://stackoverflow.com/questions/67462291/ilcplex-ilocplex-h-no-such-fil e-or-directory). What are your thoughts on this? Do you have any advice on this step? Thank you! The output is attached below. Note: I did end up removing the dot before \cplexAPI_1.4.0.tar.gz as keeping the dot gave me the following error: Warning: invalid package '.cplexAPI_1.4.0.tar.gz Error: ERROR: no packages specified


$ R CMD INSTALL --build --no-multiarch \cplexAPI_1.4.0.tar.gz

  • installing to library 'C:/Users/PC4/Documents/R/win-library/4.1'
  • installing source package 'cplexAPI' ... package 'cplexAPI' successfully unpacked and MD5 sums checked using staged installation ** libs "C:/rtools40/mingw64/bin/"gcc -I"C:/PROGRA1/R/R-411.2/include" -DNDEBUG -g -DR=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 In file included from cplexAPI.h:26, from cplexAPI.c:26: cplexR.h:50:10: fatal error: ilcplex/cplex.h: No such file or directory

    include <ilcplex/cplex.h>

    ^~~~~ compilation terminated. make: *** [C:/PROGRA1/R/R-411.2/etc/x64/Makeconf:238: cplexAPI.o] Error 1 ERROR: compilation failed for package 'cplexAPI'

  • removing 'C:/Users/PC4/Documents/R/win-library/4.1/cplexAPI'

― You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/LiChenPU/NetID/issues/5#issuecomment-986078871 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AIN7EZC3ZVQOY6XZYTJFGKDUP JSDJANCNFSM5IJL7QTQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&m t=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=u tm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

Owen-haha commented 2 years ago

Hi Li,

Thanks for the great work!

I also have problem with cplexAPI but it is different to the above ones. I am trying to configure NetID on MacOS, which I think it should be OK to run the core functions if the required packages can be installed successfully.

I have tried R4.0 and R4.1 to install the cplexAPI and both gave me the same error messages:

install.packages("../cplexAPI_1.4.0.tar.gz")
Warning in install.packages :
  package ‘../cplexAPI_1.4.0.tar.gz’ is not available for this version of R

A version of this package for your version of R might be available elsewhere,
see the ideas at
https://cran.r-project.org/doc/manuals/r-patched/R-admin.html#Installing-packages

Do you know which R version could work for cplexAPI_1.4.0? Any suggestion to install this package? Have you tried to test NetID on MaxOS?

Thanks, Owen

zty12 commented 2 years ago

Hi Owen, Maybe the following operation will help you.

  1. Make sure you have completed step a,b,c in the following figure

    截屏2022-01-25 下午1 20 58
  2. Change step d to the following code: R CMD INSTALL --configure-args=" --with-cplex-dir='/Applications/CPLEX_Studio1210/cplex'" /Users/{your name}/cplexAPI_1.4.0.tar.gz Note: These instructions are entered into the terminal. @Owen-haha

nickyflowz commented 2 years ago

Hello Professor Chen,

I am also trying to set up this program on my Mac.

I am having trouble with the last step installing the cplexAPI_1.4.0.tar.gz even though it is generated. It gives me an "zero-exit status" error. Any advice?

Thanks

zty12 commented 2 years ago

Hi nickyflowz, Maybe the following operation will help you.

  1. Check if C++ is installed in your computer environment
  2. Check if all dependency packages are installed correctly
  3. use this code: R CMD INSTALL --configure-args=" --with-cplex-dir='/Applications/CPLEX_Studio1210/cplex'" /Users/{your name}/cplexAPI_1.4.0.tar.gz @nickyflowz
nickyflowz commented 2 years ago

Hello Zty12,

Thank you so much! After reinstalling C++ (Xcode for Mac) I was able to get the program up and running.

I used the following command, slightly different from what you wrote above: % R CMD INSTALL --configure-args=" --with-cplex-dir='/Applications/CPLEX_Studio1210/cplex'" /Users/{your name}/desktop/cplexAPI_1.4.0.tar.gz

Really appreciate the help!

best

RahulShanbhag1704 commented 1 year ago

I am also facing a similar issue but on Windows. I have also added the _ in between, make it to __declspec(dllimport_deprecated). I used the same command (R CMD INSTALL --build --no-multiarch .\cplexAPI_1.4.0.tar.gz) and I am getting the following message on command prompt and then it is not compiling the package:

Please tell me what I should do, thanks!

Jonah-K commented 1 year ago

I am also facing a similar issue but on Windows. I have also added the _ in between, make it to __declspec(dllimport_deprecated). I used the same command (R CMD INSTALL --build --no-multiarch .\cplexAPI_1.4.0.tar.gz) and I am getting the following message on command prompt and then it is not compiling the package:

  • installing to library 'C:/Users/rshan/AppData/Local/R/win-library/4.3'
  • installing source package 'cplexAPI' ... package 'cplexAPI' successfully unpacked and MD5 sums checked using staged installation * libs using C compiler: 'gcc.exe (GCC) 12.2.0' gcc -I"C:/PROGRA~1/R/R-43~1.0/include" -DNDEBUG -g -DR=1 -DUSE_R=1 -I"C:/Program Files/IBM/ILOG/CPLEX_Studio2211/cplex/include" -I"C:/rtools43/x86_64-w64-mingw32.static.posix/include" -O2 -Wall -mfpmath=sse -msse2 -mstackrealign -c cplexAPI.c -o cplexAPI.o In file included from cplexR.h:50, from cplexAPI.h:26, from cplexAPI.c:26: C:/Program Files/IBM/ILOG/CPLEX_Studio2211/cplex/include/ilcplex/cplex.h:1598:20: warning: 'dllimport_deprecated' attribute directive ignored [-Wattributes] 1598 | char const filename_str); | ^~~~ C:/Program Files/IBM/ILOG/CPLEX_Studio2211/cplex/include/ilcplex/cplex.h:1610:23: warning: 'dllimport_deprecated' attribute directive ignored [-Wattributes] 1610 | int confnumcols_p); | ^~~ C:/Program Files/IBM/ILOG/CPLEX_Studio2211/cplex/include/ilcplex/cplex.h:2734:31: warning: 'dllimport_deprecated' attribute directive ignored [-Wattributes] 2734 | int confnumcols_p); | ^~~ gcc -I"C:/PROGRA~1/R/R-43~1.0/include" -DNDEBUG -g -DR=1 -DUSE_R=1 -I"C:/Program Files/IBM/ILOG/CPLEX_Studio2211/cplex/include" -I"C:/rtools43/x86_64-w64-mingw32.static.posix/include" -O2 -Wall -mfpmath=sse -msse2 -mstackrealign -c cplexR.c -o cplexR.o In file included from cplexR.h:50, from cplexR.c:26: C:/Program Files/IBM/ILOG/CPLEX_Studio2211/cplex/include/ilcplex/cplex.h:1598:20: warning: 'dllimport_deprecated' attribute directive ignored [-Wattributes] 1598 | char const filename_str); | ^~~~ C:/Program Files/IBM/ILOG/CPLEX_Studio2211/cplex/include/ilcplex/cplex.h:1610:23: warning: 'dllimport_deprecated' attribute directive ignored [-Wattributes] 1610 | int confnumcols_p); | ^~~ C:/Program Files/IBM/ILOG/CPLEX_Studio2211/cplex/include/ilcplex/cplex.h:2734:31: warning: 'dllimport_deprecated' attribute directive ignored [-Wattributes] 2734 | int confnumcols_p); | ^~~ gcc -I"C:/PROGRA~1/R/R-43~1.0/include" -DNDEBUG -g -DR=1 -DUSE_R=1 -I"C:/Program Files/IBM/ILOG/CPLEX_Studio2211/cplex/include" -I"C:/rtools43/x86_64-w64-mingw32.static.posix/include" -O2 -Wall -mfpmath=sse -msse2 -mstackrealign -c cplex_checkAPI.c -o cplex_checkAPI.o In file included from cplexR.h:50, from cplex_checkAPI.h:26, from cplex_checkAPI.c:26: C:/Program Files/IBM/ILOG/CPLEX_Studio2211/cplex/include/ilcplex/cplex.h:1598:20: warning: 'dllimport_deprecated' attribute directive ignored [-Wattributes] 1598 | char const filename_str); | ^~~~ C:/Program Files/IBM/ILOG/CPLEX_Studio2211/cplex/include/ilcplex/cplex.h:1610:23: warning: 'dllimport_deprecated' attribute directive ignored [-Wattributes] 1610 | int confnumcols_p); | ^~~ C:/Program Files/IBM/ILOG/CPLEX_Studio2211/cplex/include/ilcplex/cplex.h:2734:31: warning: 'dllimport_deprecated' attribute directive ignored [-Wattributes] 2734 | int confnumcols_p); | ^~~ gcc -I"C:/PROGRA~1/R/R-43~1.0/include" -DNDEBUG -g -DR=1 -DUSE_R=1 -I"C:/Program Files/IBM/ILOG/CPLEX_Studio2211/cplex/include" -I"C:/rtools43/x86_64-w64-mingw32.static.posix/include" -O2 -Wall -mfpmath=sse -msse2 -mstackrealign -c cplex_longparamAPI.c -o cplex_longparamAPI.o In file included from cplexR.h:50, from cplex_longparamAPI.h:26, from cplex_longparamAPI.c:26: C:/Program Files/IBM/ILOG/CPLEX_Studio2211/cplex/include/ilcplex/cplex.h:1598:20: warning: 'dllimport_deprecated' attribute directive ignored [-Wattributes] 1598 | char const filename_str); | ^~~~ C:/Program Files/IBM/ILOG/CPLEX_Studio2211/cplex/include/ilcplex/cplex.h:1610:23: warning: 'dllimport_deprecated' attribute directive ignored [-Wattributes] 1610 | int confnumcols_p); | ^~~ C:/Program Files/IBM/ILOG/CPLEX_Studio2211/cplex/include/ilcplex/cplex.h:2734:31: warning: 'dllimport_deprecated' attribute directive ignored [-Wattributes] 2734 | int confnumcols_p); | ^~~ gcc -I"C:/PROGRA~1/R/R-43~1.0/include" -DNDEBUG -g -DR=1 -DUSE_R=1 -I"C:/Program Files/IBM/ILOG/CPLEX_Studio2211/cplex/include" -I"C:/rtools43/x86_64-w64-mingw32.static.posix/include" -O2 -Wall -mfpmath=sse -msse2 -mstackrealign -c init.c -o init.o In file included from cplexR.h:50, from cplexAPI.h:26, from init.c:28: C:/Program Files/IBM/ILOG/CPLEX_Studio2211/cplex/include/ilcplex/cplex.h:1598:20: warning: 'dllimport_deprecated' attribute directive ignored [-Wattributes] 1598 | char const filename_str); | ^~~~ C:/Program Files/IBM/ILOG/CPLEX_Studio2211/cplex/include/ilcplex/cplex.h:1610:23: warning: 'dllimport_deprecated' attribute directive ignored [-Wattributes] 1610 | int confnumcols_p); | ^~~ C:/Program Files/IBM/ILOG/CPLEX_Studio2211/cplex/include/ilcplex/cplex.h:2734:31: warning: 'dllimport_deprecated' attribute directive ignored [-Wattributes] 2734 | int confnumcols_p); | ^~~ gcc -shared -s -static-libgcc -o cplexAPI.dll tmp.def cplexAPI.o cplexR.o cplex_checkAPI.o cplex_longparamAPI.o init.o -L-LC:/Program Files/IBM/ILOG/CPLEX_Studio1210/cplex/bin/x64_win64 -lm -lcplex22100 -LC:/rtools43/x86_64-w64-mingw32.static.posix/lib/x64 -LC:/rtools43/x86_64-w64-mingw32.static.posix/lib -LC:/PROGRA~1/R/R-43~1.0/bin/x64 -lR ; gcc -shared -s -static-libgcc -o cplexAPI.dll tmp.def cplexAPI.o cplexR.o cplex_checkAPI.o cplex_longparamAPI.o init.o -L-LC:/Program Files/IBM/ILOG/CPLEX_Studio1210/cplex/bin/x64_win64 -lm -lcplex22100 -LC:/rtools43/x86_64-w64-mingw32.static.posix/lib/x64 -LC:/rtools43/x86_64-w64-mingw32.static.posix/lib -LC:/PROGRA~1/R/R-43~1.0/bin/x64 -lR no DLL was created ERROR: compilation failed for package 'cplexAPI'
  • removing 'C:/Users/rshan/AppData/Local/R/win-library/4.3/cplexAPI'

Please tell me what I should do, thanks!

Hi RahulShanbhag1704,

I am experiencing a similar issue to you with the setup of the CPLEX API and was wondering if you managed to solve your problem. Our error seems to be very similar so I'm hoping for a common fix.

Thanks!

suprarai commented 2 months ago

I am also facing a similar issue but on Windows. I have also added the _ in between, make it to __declspec(dllimport_deprecated). I used the same command (R CMD INSTALL --build --no-multiarch .\cplexAPI_1.4.0.tar.gz) and I am getting the following message on command prompt and then it is not compiling the package:

  • installing to library 'C:/Users/rshan/AppData/Local/R/win-library/4.3'
  • installing source package 'cplexAPI' ... package 'cplexAPI' successfully unpacked and MD5 sums checked using staged installation * libs using C compiler: 'gcc.exe (GCC) 12.2.0' gcc -I"C:/PROGRA~1/R/R-43~1.0/include" -DNDEBUG -g -DR=1 -DUSE_R=1 -I"C:/Program Files/IBM/ILOG/CPLEX_Studio2211/cplex/include" -I"C:/rtools43/x86_64-w64-mingw32.static.posix/include" -O2 -Wall -mfpmath=sse -msse2 -mstackrealign -c cplexAPI.c -o cplexAPI.o In file included from cplexR.h:50, from cplexAPI.h:26, from cplexAPI.c:26: C:/Program Files/IBM/ILOG/CPLEX_Studio2211/cplex/include/ilcplex/cplex.h:1598:20: warning: 'dllimport_deprecated' attribute directive ignored [-Wattributes] 1598 | char const filename_str); | ^~~~ C:/Program Files/IBM/ILOG/CPLEX_Studio2211/cplex/include/ilcplex/cplex.h:1610:23: warning: 'dllimport_deprecated' attribute directive ignored [-Wattributes] 1610 | int confnumcols_p); | ^~~ C:/Program Files/IBM/ILOG/CPLEX_Studio2211/cplex/include/ilcplex/cplex.h:2734:31: warning: 'dllimport_deprecated' attribute directive ignored [-Wattributes] 2734 | int confnumcols_p); | ^~~ gcc -I"C:/PROGRA~1/R/R-43~1.0/include" -DNDEBUG -g -DR=1 -DUSE_R=1 -I"C:/Program Files/IBM/ILOG/CPLEX_Studio2211/cplex/include" -I"C:/rtools43/x86_64-w64-mingw32.static.posix/include" -O2 -Wall -mfpmath=sse -msse2 -mstackrealign -c cplexR.c -o cplexR.o In file included from cplexR.h:50, from cplexR.c:26: C:/Program Files/IBM/ILOG/CPLEX_Studio2211/cplex/include/ilcplex/cplex.h:1598:20: warning: 'dllimport_deprecated' attribute directive ignored [-Wattributes] 1598 | char const filename_str); | ^~~~ C:/Program Files/IBM/ILOG/CPLEX_Studio2211/cplex/include/ilcplex/cplex.h:1610:23: warning: 'dllimport_deprecated' attribute directive ignored [-Wattributes] 1610 | int confnumcols_p); | ^~~ C:/Program Files/IBM/ILOG/CPLEX_Studio2211/cplex/include/ilcplex/cplex.h:2734:31: warning: 'dllimport_deprecated' attribute directive ignored [-Wattributes] 2734 | int confnumcols_p); | ^~~ gcc -I"C:/PROGRA~1/R/R-43~1.0/include" -DNDEBUG -g -DR=1 -DUSE_R=1 -I"C:/Program Files/IBM/ILOG/CPLEX_Studio2211/cplex/include" -I"C:/rtools43/x86_64-w64-mingw32.static.posix/include" -O2 -Wall -mfpmath=sse -msse2 -mstackrealign -c cplex_checkAPI.c -o cplex_checkAPI.o In file included from cplexR.h:50, from cplex_checkAPI.h:26, from cplex_checkAPI.c:26: C:/Program Files/IBM/ILOG/CPLEX_Studio2211/cplex/include/ilcplex/cplex.h:1598:20: warning: 'dllimport_deprecated' attribute directive ignored [-Wattributes] 1598 | char const filename_str); | ^~~~ C:/Program Files/IBM/ILOG/CPLEX_Studio2211/cplex/include/ilcplex/cplex.h:1610:23: warning: 'dllimport_deprecated' attribute directive ignored [-Wattributes] 1610 | int confnumcols_p); | ^~~ C:/Program Files/IBM/ILOG/CPLEX_Studio2211/cplex/include/ilcplex/cplex.h:2734:31: warning: 'dllimport_deprecated' attribute directive ignored [-Wattributes] 2734 | int confnumcols_p); | ^~~ gcc -I"C:/PROGRA~1/R/R-43~1.0/include" -DNDEBUG -g -DR=1 -DUSE_R=1 -I"C:/Program Files/IBM/ILOG/CPLEX_Studio2211/cplex/include" -I"C:/rtools43/x86_64-w64-mingw32.static.posix/include" -O2 -Wall -mfpmath=sse -msse2 -mstackrealign -c cplex_longparamAPI.c -o cplex_longparamAPI.o In file included from cplexR.h:50, from cplex_longparamAPI.h:26, from cplex_longparamAPI.c:26: C:/Program Files/IBM/ILOG/CPLEX_Studio2211/cplex/include/ilcplex/cplex.h:1598:20: warning: 'dllimport_deprecated' attribute directive ignored [-Wattributes] 1598 | char const filename_str); | ^~~~ C:/Program Files/IBM/ILOG/CPLEX_Studio2211/cplex/include/ilcplex/cplex.h:1610:23: warning: 'dllimport_deprecated' attribute directive ignored [-Wattributes] 1610 | int confnumcols_p); | ^~~ C:/Program Files/IBM/ILOG/CPLEX_Studio2211/cplex/include/ilcplex/cplex.h:2734:31: warning: 'dllimport_deprecated' attribute directive ignored [-Wattributes] 2734 | int confnumcols_p); | ^~~ gcc -I"C:/PROGRA~1/R/R-43~1.0/include" -DNDEBUG -g -DR=1 -DUSE_R=1 -I"C:/Program Files/IBM/ILOG/CPLEX_Studio2211/cplex/include" -I"C:/rtools43/x86_64-w64-mingw32.static.posix/include" -O2 -Wall -mfpmath=sse -msse2 -mstackrealign -c init.c -o init.o In file included from cplexR.h:50, from cplexAPI.h:26, from init.c:28: C:/Program Files/IBM/ILOG/CPLEX_Studio2211/cplex/include/ilcplex/cplex.h:1598:20: warning: 'dllimport_deprecated' attribute directive ignored [-Wattributes] 1598 | char const filename_str); | ^~~~ C:/Program Files/IBM/ILOG/CPLEX_Studio2211/cplex/include/ilcplex/cplex.h:1610:23: warning: 'dllimport_deprecated' attribute directive ignored [-Wattributes] 1610 | int confnumcols_p); | ^~~ C:/Program Files/IBM/ILOG/CPLEX_Studio2211/cplex/include/ilcplex/cplex.h:2734:31: warning: 'dllimport_deprecated' attribute directive ignored [-Wattributes] 2734 | int confnumcols_p); | ^~~ gcc -shared -s -static-libgcc -o cplexAPI.dll tmp.def cplexAPI.o cplexR.o cplex_checkAPI.o cplex_longparamAPI.o init.o -L-LC:/Program Files/IBM/ILOG/CPLEX_Studio1210/cplex/bin/x64_win64 -lm -lcplex22100 -LC:/rtools43/x86_64-w64-mingw32.static.posix/lib/x64 -LC:/rtools43/x86_64-w64-mingw32.static.posix/lib -LC:/PROGRA~1/R/R-43~1.0/bin/x64 -lR ; gcc -shared -s -static-libgcc -o cplexAPI.dll tmp.def cplexAPI.o cplexR.o cplex_checkAPI.o cplex_longparamAPI.o init.o -L-LC:/Program Files/IBM/ILOG/CPLEX_Studio1210/cplex/bin/x64_win64 -lm -lcplex22100 -LC:/rtools43/x86_64-w64-mingw32.static.posix/lib/x64 -LC:/rtools43/x86_64-w64-mingw32.static.posix/lib -LC:/PROGRA~1/R/R-43~1.0/bin/x64 -lR no DLL was created ERROR: compilation failed for package 'cplexAPI'
  • removing 'C:/Users/rshan/AppData/Local/R/win-library/4.3/cplexAPI'

Please tell me what I should do, thanks!

Hi RahulShanbhag1704,

I am experiencing a similar issue to you with the setup of the CPLEX API and was wondering if you managed to solve your problem. Our error seems to be very similar so I'm hoping for a common fix.

Thanks!

Hi Rahul and Johan, I am also having an issue with installing cplexAPI in R for windows 11 machine.

suprarai commented 2 months ago

Hi there!

I am also having the same issue when installing the cplexAPI package. I have completed all steps of the user guide, including 1.3.2 step 3 where the package cplexAPI_1.4.0.tar.gz is successfully built. I'm having trouble installing it using the R CMD INSTALL --build --no-multiarch .\cplexAPI_1.4.0.tar.gz line. I've searched online for help and found that MINGW64 compiler is potentially not supported by IBM (https://stackoverflow.com/questions/67462291/ilcplex-ilocplex-h-no-such-file-or-directory). What are your thoughts on this? Do you have any advice on this step? Thank you! The output is attached below. Note: I did end up removing the dot before \cplexAPI_1.4.0.tar.gz as keeping the dot gave me the following error: Warning: invalid package '.cplexAPI_1.4.0.tar.gz Error: ERROR: no packages specified

$ R CMD INSTALL --build --no-multiarch \cplexAPI_1.4.0.tar.gz

  • installing to library 'C:/Users/PC4/Documents/R/win-library/4.1'
  • installing source package 'cplexAPI' ... package 'cplexAPI' successfully unpacked and MD5 sums checked using staged installation ** libs "C:/rtools40/mingw64/bin/"gcc -I"C:/PROGRA~1/R/R-41~1.2/include" -DNDEBUG -g -DR=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 In file included from cplexAPI.h:26, from cplexAPI.c:26: cplexR.h:50:10: fatal error: ilcplex/cplex.h: No such file or directory

    include <ilcplex/cplex.h>

    ^~~~~ compilation terminated. make: *** [C:/PROGRA~1/R/R-41~1.2/etc/x64/Makeconf:238: cplexAPI.o] Error 1 ERROR: compilation failed for package 'cplexAPI'

  • removing 'C:/Users/PC4/Documents/R/win-library/4.1/cplexAPI'

Hi Did you solve your problem? Hope to hear your idea :)