Installing R Interface for Ipopt

China☆狼群 提交于 2019-12-08 12:20:31

问题


I have exactly the same problem as the poster here, unfortunately no solution is provided on that link.

I built and installed IPOPT (version 3.12.6) on Windows 7 (64bit) with Cygwin, but I cannot seem to get the R interface to work. All commands (configure, make, make install, make test) were executed without error.

When I try to build the R interface from RStudio, I tried using both the code in the "build" folder as well as the code in the main directory. I get the following errors:

`>install.packages("C:/cygwin64/home/Ipopt-3.12.6/build/Ipopt/contrib/RInterface", repos=NULL, type="source")

Error:

cygwin64/home/Ipopt-3.12.6/build/Ipopt/contrib/RInterface/DESCRIPTION'

Not using the build directory:

`>install.packages("C:/cygwin64/home/Ipopt-3.12.6/Ipopt/contrib/RInterface", repos=NULL, type="source")

Error:

  • installing source package 'ipoptr' ... ** libs

*** arch - i386 Warning: running command 'make -f "Makevars.win" -f "C:/Users/~1/DOCUME~1/R/R-33~1.1/etc/i386/Makeconf" -f "C:/Users/~1/DOCUME~1/R/R-33~1.1/share/make/winshlib.mk" SHLIB_LDFLAGS='$(SHLIB_CXXLDFLAGS)' SHLIB_LD='$(SHLIB_CXXLD)' SHLIB="ipoptr.dll" ' had status 127 ERROR: compilation failed for package 'ipoptr' * removing 'C:/Users/Documents/R/R-3.3.1/library/ipoptr' Warning in install.packages : running command '"C:/Users/~1/DOCUME~1/R/R-33~1.1/bin/x64/R" CMD INSTALL -l "C:\Users\Documents\R\R-3.3.1\library" "C:/cygwin64/home/Ipopt-3.12.6/Ipopt/contrib/RInterface"' had status 1 Warning in install.packages : installation of package ‘C:/cygwin64/home/Ipopt-3.12.6/Ipopt/contrib/RInterface’ had non-zero exit status

Does anyone know what I could do to resolve this?

EDIT: After installing RTools and adding it to my PATH I get ipoptr.cpp:22:34: fatal error: IpIpoptApplication.hpp: No such file or directory #include "IpIpoptApplication.hpp", i.e. it seems that ipoptr.cpp cannot find IpIpoptApplication.hpp (which is in a subdirectory of the build folder) and later on in the error still the same Warning: running command 'make -f "Makevars.win" -f ' had status 2.... Copying this file over to the location of ipoptr.cpp moves the error one file further to another similar file that it cannot find. I suspect it cannot find these files because of something being wrong with my makevars.win file (I suspect that that's the file that should point to the currently missing files). Does anyone have an idea what this could be?

EDIT 2: Might it have to do with the comment here indicating that in some cases LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$IPOPTDIR/build/lib should be set? How do I do this? Should this be done in R or cygwin?

来源:https://stackoverflow.com/questions/40343289/installing-r-interface-for-ipopt

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!