Opened 9 months ago

Closed 3 months ago

#307 closed defect (migrated)

RInterface compilation error

Reported by: a.verma Owned by: ipopt-team
Priority: normal Component: Ipopt
Version: 3.12 Severity: normal
Keywords: Cc:

Description (last modified by stefan)

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?

Attachments (1)

Compilation.txt (1.8 KB) - added by a.verma 9 months ago.
Error message from RStudio

Download all attachments as: .zip

Change History (3)

Changed 9 months ago by a.verma

Error message from RStudio

comment:1 Changed 8 months ago by stefan

  • Description modified (diff)

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

comment:2 Changed 3 months ago by stefan

  • Resolution set to migrated
  • Status changed from new to closed

This ticket has been migrated to GitHub and will be followed up there: https://github.com/coin-or/Ipopt/issues/307

Note: See TracTickets for help on using tickets.