[Ipopt-tickets] [Ipopt] #307: RInterface compilation error

Ipopt coin-trac at coin-or.org
Tue Aug 21 03:48:27 EDT 2018


#307: RInterface compilation error
----------------------+------------------------
  Reporter:  a.verma  |      Owner:  ipopt-team
      Type:  defect   |     Status:  new
  Priority:  normal   |  Component:  Ipopt
   Version:  3.12     |   Severity:  normal
Resolution:           |   Keywords:
----------------------+------------------------

Old description:

> I'm facing difficulty in installing ipopt as a R Package. I get the
> following error:
>
> * installing *source* package 'ipoptr' ...
> ** libs
> c:/Rtools/mingw_64/bin/g++ -m64
> -I"C:/PROGRA~3/ANACON~1/envs/rstudio/lib/R/include" -DNDEBUG
> -I"C:/swarm/workspace/External-R-3.4.3/vendor/extsoft/include"     -O2
> -Wall  -mtune=core2 -c IpJournalist.cpp -o IpJournalist.o
> bash.exe: warning: could not find /tmp, please create!
> IpJournalist.cpp:19:4: error: #error "don't have header file for stdio"
>  #  error "don't have header file for stdio"
>     ^
> IpJournalist.cpp:29:4: error: #error "don't have header file for string"
>  #  error "don't have header file for string"
>     ^
> IpJournalist.cpp: In member function 'virtual bool
> Ipopt::FileJournal::Open(const char*)':
> IpJournalist.cpp:380:31: error: 'strcmp' was not declared in this scope
>      if (strcmp("stdout", fname)==0) {
>                                ^
> make: *** [IpJournalist.o] Error 1
> Warning: running command 'make -f
> "C:/PROGRA~3/ANACON~1/envs/rstudio/lib/R/etc/x64/Makeconf" -f
> "C:/PROGRA~3/ANACON~1/envs/rstudio/lib/R/share/make/winshlib.mk"
> SHLIB_LDFLAGS='$(SHLIB_CXXLDFLAGS)' SHLIB_LD='$(SHLIB_CXXLD)'
> SHLIB="ipoptr.dll" WIN=64 TCLBIN=64 OBJECTS="IpDebug.o IpJournalist.o
> IpObserver.o IpOptionsList.o IpRegOptions.o IpTaggedObject.o IpUtils.o
> IpoptRJournal.o IpoptRNLP.o ipoptr.o"' had status 2
> ERROR: compilation failed for package 'ipoptr'
>
> For some reason, the IpJournalist.cpp can't find stdio.h and string.h
> headers. Any clues why this may be so and how this could be fixed?

New description:

 I'm facing difficulty in installing ipopt as a R Package. I get the
 following error:
 {{{
 * installing *source* package 'ipoptr' ...
 ** libs
 c:/Rtools/mingw_64/bin/g++ -m64
 -I"C:/PROGRA~3/ANACON~1/envs/rstudio/lib/R/include" -DNDEBUG
 -I"C:/swarm/workspace/External-R-3.4.3/vendor/extsoft/include"     -O2
 -Wall  -mtune=core2 -c IpJournalist.cpp -o IpJournalist.o
 bash.exe: warning: could not find /tmp, please create!
 IpJournalist.cpp:19:4: error: #error "don't have header file for stdio"
  #  error "don't have header file for stdio"
     ^
 IpJournalist.cpp:29:4: error: #error "don't have header file for string"
  #  error "don't have header file for string"
     ^
 IpJournalist.cpp: In member function 'virtual bool
 Ipopt::FileJournal::Open(const char*)':
 IpJournalist.cpp:380:31: error: 'strcmp' was not declared in this scope
      if (strcmp("stdout", fname)==0) {
                                ^
 make: *** [IpJournalist.o] Error 1
 Warning: running command 'make -f
 "C:/PROGRA~3/ANACON~1/envs/rstudio/lib/R/etc/x64/Makeconf" -f
 "C:/PROGRA~3/ANACON~1/envs/rstudio/lib/R/share/make/winshlib.mk"
 SHLIB_LDFLAGS='$(SHLIB_CXXLDFLAGS)' SHLIB_LD='$(SHLIB_CXXLD)'
 SHLIB="ipoptr.dll" WIN=64 TCLBIN=64 OBJECTS="IpDebug.o IpJournalist.o
 IpObserver.o IpOptionsList.o IpRegOptions.o IpTaggedObject.o IpUtils.o
 IpoptRJournal.o IpoptRNLP.o ipoptr.o"' had status 2
 ERROR: compilation failed for package 'ipoptr'
 }}}
 For some reason, the IpJournalist.cpp can't find stdio.h and string.h
 headers. Any clues why this may be so and how this could be fixed?

--

Comment (by stefan):

 Probably because the defines that specify whether stdio.h or string are
 available are not defined here. They are defined during the build of
 Ipopt, but not when building something that depends on Ipopt.

 Main problem is that your build of the R-interface seems to try to build
 some Ipopt source file. I don't know why this is, because according to
 https://projects.coin-
 or.org/Ipopt/browser/stable/3.12/Ipopt/contrib/RInterface/src/Makevars.in#L34
 only three files should be build:
 {{{
 OBJECTS = ipoptr.o IpoptRNLP.o IpoptRJournal.o
 }}}

--
Ticket URL: <https://projects.coin-or.org/Ipopt/ticket/307#comment:1>
Ipopt <http://projects.coin-or.org/Ipopt>
Interior-point optimizer for nonlinear programs.



More information about the Ipopt-tickets mailing list