[OS] Errors in COIN OR OS examples

Bezrucav, Stefan-Octavian stefan.bezrucav at rwth-aachen.de
Mon Oct 9 09:18:03 EDT 2017


Dear all,

I am trying to use the COIN OR libraries and especially the Couenne solver through OS for my master thesis. Unfortunately I do not manage to compile the OS examples. In the followings I will present what I have tried and than I will mention what does not work:

I tried everything on a system with

    ubuntu 14.04 LTS and

with the gcc compiler

    gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04.3).

I have downloaded the OS sources OS-2.10.1.tgz<https://www.coin-or.org/download/source/OS/OS-2.10.1.tgz> from https://www.coin-or.org/download/source/OS/, extracted them in a folder in home folder, downloaded the ThirdParty packages (ASL,Blas,Lapack,Mumps), created the  "build" folder, ../configure, make, make test, make install. Everything worked perfectly; all tests were successful. Then I tried the example osSolverDemo.cpp from ~/OS-2.10.1/build/examples. I executed the make command and the first error was thrown:

bezrucav at rosel:~/OS-2.10.1/build/examples/osSolverDemo$ make
g++ -O3 -pipe -DNDEBUG -pedantic-errors -Wparentheses -Wreturn-type -Wcast-qual -Wall -Wpointer-arith -Wwrite-strings -Wconversion -Wno-unknown-pragmas -Wno-long-long    -DHAVE_CONFIG_H `pkg-config --cflags os` -I`echo ../../include`  -c -o OSSolverDemo.o OSSolverDemo.cpp
Package cppad was not found in the pkg-config search path.
Perhaps you should add the directory containing `cppad.pc'
to the PKG_CONFIG_PATH environment variable
Package 'cppad', required by 'OS', not found
OSSolverDemo.cpp:15:22: fatal error: OSConfig.h: No such file or directory
 #include "OSConfig.h"
                      ^
compilation terminated.
make: *** [OSSolverDemo.o] Error 1


I took a look in the Makefile from the same folder and I have added:

    ADDINCFLAGS2 =  ${prefix}/include/coin
and
    -I`$(CYGPATH_W) $(ADDINCFLAGS2)` in INCL =  -I`$(CYGPATH_W) $(ADDINCFLAGS)` -I`$(CYGPATH_W) $(ADDINCFLAGS2)`

Now the following error were generated:

bezrucav at rosel:~/OS-2.10.1/build/examples/osSolverDemo$ make
g++ -O3 -pipe -DNDEBUG -pedantic-errors -Wparentheses -Wreturn-type -Wcast-qual -Wall -Wpointer-arith -Wwrite-strings -Wconversion -Wno-unknown-pragmas -Wno-long-long    -DHAVE_CONFIG_H `pkg-config --cflags os` -I`echo ../../include` -I`echo ../../include/coin`    -c -o OSSolverDemo.o OSSolverDemo.cpp
Package cppad was not found in the pkg-config search path.
Perhaps you should add the directory containing `cppad.pc'
to the PKG_CONFIG_PATH environment variable
Package 'cppad', required by 'OS', not found
OSSolverDemo.cpp:30:27: fatal error: OSmps2osil.h: No such file or directory
 #include "OSmps2osil.h"
                           ^
compilation terminated.
make: *** [OSSolverDemo.o] Error 1

I did not find the OSmps2osil.h file in the entire OS folder.

After more research on the Internet I found another newer osSolverDemo.cpp file on https://projects.coin-or.org/CoinBazaar/browser/projects/ApplicationTemplates?order=name where some of the previous problems were corrected. I have also executed the make file in the example folder, after replacing the old file with the new one, but there were also some errors thrown:

bezrucav at rosel:~/OS-2.10.1/build/examples/osSolverDemo$ make
bla=;\
    for file in OSSolverDemo2.o ; do bla="$bla `echo $file`"; done; \
    g++ -Wl,--rpath -Wl,/home/bezrucav/OS-2.10.1/build/lib -O3 -pipe -DNDEBUG -pedantic-errors -Wparentheses -Wreturn-type -Wcast-qual -Wall -Wpointer-arith -Wwrite-strings -Wconversion -Wno-unknown-pragmas -Wno-long-long    -DHAVE_CONFIG_H `pkg-config --cflags os` -o OSSolverDemo2 $bla  `pkg-config --libs os`
Package cppad was not found in the pkg-config search path.
Perhaps you should add the directory containing `cppad.pc'
to the PKG_CONFIG_PATH environment variable
Package 'cppad', required by 'OS', not found
Package cppad was not found in the pkg-config search path.
Perhaps you should add the directory containing `cppad.pc'
to the PKG_CONFIG_PATH environment variable
Package 'cppad', required by 'OS', not found
OSSolverDemo2.o: In function `getOSResult(std::string)':
OSSolverDemo2.cpp:(.text+0x12b): undefined reference to `OSrLReader::OSrLReader()'
OSSolverDemo2.cpp:(.text+0x136): undefined reference to `OSrLReader::readOSrL(std::string const&)'
OSSolverDemo2.cpp:(.text+0x151): undefined reference to `OSResult::getSolutionStatusType(int)'
OSSolverDemo2.cpp:(.text+0x1a5): undefined reference to `OSResult::getOptimalObjValue(int, int)'
OSSolverDemo2.cpp:(.text+0x235): undefined reference to `OSResult::getOptimalPrimalVariableValues(int)'
OSSolverDemo2.cpp:(.text+0x365): undefined reference to `OSResult::getSolutionStatusDescription(int)'
OSSolverDemo2.cpp:(.text+0x3d7): undefined reference to `OSrLReader::~OSrLReader()'
OSSolverDemo2.o: In function `main':
OSSolverDemo2.cpp:(.text.startup+0x12): undefined reference to `WindowsErrorPopupBlocker()'
OSSolverDemo2.cpp:(.text.startup+0x27): undefined reference to `FileUtil::FileUtil()'
OSSolverDemo2.cpp:(.text.startup+0x17d): undefined reference to `OSmps2OS::OSmps2OS(std::string)'
OSSolverDemo2.cpp:(.text.startup+0x199): undefined reference to `OSmps2OS::createOSObjects()'
OSSolverDemo2.cpp:(.text.startup+0x1bb): undefined reference to `OSOption::OSOption()'
OSSolverDemo2.cpp:(.text.startup+0x294): undefined reference to `OSOption::setAnotherSolverOption(std::string, std::string, std::string, std::string, std::string, std::string)'
OSSolverDemo2.cpp:(.text.startup+0x3dd): undefined reference to `OSOption::setAnotherSolverOption(std::string, std::string, std::string, std::string, std::string, std::string)'
OSSolverDemo2.cpp:(.text.startup+0x46a): undefined reference to `OSoLWriter::OSoLWriter()'
OSSolverDemo2.cpp:(.text.startup+0x47d): undefined reference to `OSoLWriter::writeOSoL(OSOption*)'
OSSolverDemo2.cpp:(.text.startup+0x4bc): undefined reference to `CoinSolver::CoinSolver()'
OSSolverDemo2.cpp:(.text.startup+0x4ed): undefined reference to `OSmps2OS::~OSmps2OS()'
OSSolverDemo2.cpp:(.text.startup+0x50e): undefined reference to `OSOption::~OSOption()'
OSSolverDemo2.cpp:(.text.startup+0x523): undefined reference to `OSoLWriter::~OSoLWriter()'
OSSolverDemo2.cpp:(.text.startup+0x5fc): undefined reference to `FileUtil::getFileAsString(char const*)'
OSSolverDemo2.cpp:(.text.startup+0x63c): undefined reference to `OSiLReader::OSiLReader()'
OSSolverDemo2.cpp:(.text.startup+0x64e): undefined reference to `OSiLReader::readOSiL(std::string const&)'
OSSolverDemo2.cpp:(.text.startup+0x668): undefined reference to `OSOption::OSOption()'
OSSolverDemo2.cpp:(.text.startup+0x736): undefined reference to `OSOption::setAnotherSolverOption(std::string, std::string, std::string, std::string, std::string, std::string)'
OSSolverDemo2.cpp:(.text.startup+0x87c): undefined reference to `OSOption::setAnotherSolverOption(std::string, std::string, std::string, std::string, std::string, std::string)'
OSSolverDemo2.cpp:(.text.startup+0x9c2): undefined reference to `OSOption::setAnotherSolverOption(std::string, std::string, std::string, std::string, std::string, std::string)'
OSSolverDemo2.cpp:(.text.startup+0xb08): undefined reference to `OSOption::setAnotherSolverOption(std::string, std::string, std::string, std::string, std::string, std::string)'
OSSolverDemo2.cpp:(.text.startup+0xb95): undefined reference to `OSoLWriter::OSoLWriter()'
OSSolverDemo2.cpp:(.text.startup+0xba8): undefined reference to `OSoLWriter::writeOSoL(OSOption*)'
OSSolverDemo2.cpp:(.text.startup+0xbe7): undefined reference to `CoinSolver::CoinSolver()'
OSSolverDemo2.cpp:(.text.startup+0xc4f): undefined reference to `OSiLReader::~OSiLReader()'
OSSolverDemo2.cpp:(.text.startup+0xc70): undefined reference to `OSOption::~OSOption()'
OSSolverDemo2.cpp:(.text.startup+0xc85): undefined reference to `OSoLWriter::~OSoLWriter()'
OSSolverDemo2.cpp:(.text.startup+0xd6d): undefined reference to `OSnl2OS::OSnl2OS()'
OSSolverDemo2.cpp:(.text.startup+0xd92): undefined reference to `OSnl2OS::readNl(std::string)'
OSSolverDemo2.cpp:(.text.startup+0xdae): undefined reference to `OSnl2OS::createOSObjects()'
OSSolverDemo2.cpp:(.text.startup+0xdcc): undefined reference to `OSOption::OSOption()'
OSSolverDemo2.cpp:(.text.startup+0xea9): undefined reference to `OSOption::setAnotherSolverOption(std::string, std::string, std::string, std::string, std::string, std::string)'
OSSolverDemo2.cpp:(.text.startup+0xffe): undefined reference to `OSOption::setAnotherSolverOption(std::string, std::string, std::string, std::string, std::string, std::string)'
OSSolverDemo2.cpp:(.text.startup+0x1153): undefined reference to `OSOption::setAnotherSolverOption(std::string, std::string, std::string, std::string, std::string, std::string)'
OSSolverDemo2.cpp:(.text.startup+0x12a8): undefined reference to `OSOption::setAnotherSolverOption(std::string, std::string, std::string, std::string, std::string, std::string)'
OSSolverDemo2.cpp:(.text.startup+0x13fd): undefined reference to `OSOption::setAnotherSolverOption(std::string, std::string, std::string, std::string, std::string, std::string)'
OSSolverDemo2.o:OSSolverDemo2.cpp:(.text.startup+0x1552): more undefined references to `OSOption::setAnotherSolverOption(std::string, std::string, std::string, std::string, std::string, std::string)' follow
OSSolverDemo2.o: In function `main':
OSSolverDemo2.cpp:(.text.startup+0x15d4): undefined reference to `OSInstance::getVariableNumber()'
OSSolverDemo2.cpp:(.text.startup+0x162f): undefined reference to `OSOption::setInitVarValuesDense(int, double*)'
OSSolverDemo2.cpp:(.text.startup+0x1649): undefined reference to `OSoLWriter::OSoLWriter()'
OSSolverDemo2.cpp:(.text.startup+0x165c): undefined reference to `OSoLWriter::writeOSoL(OSOption*)'
OSSolverDemo2.cpp:(.text.startup+0x169b): undefined reference to `CouenneSolver::CouenneSolver()'
OSSolverDemo2.cpp:(.text.startup+0x1757): undefined reference to `OSOption::~OSOption()'
OSSolverDemo2.cpp:(.text.startup+0x1771): undefined reference to `OSoLWriter::~OSoLWriter()'
OSSolverDemo2.cpp:(.text.startup+0x1781): undefined reference to `OSnl2OS::~OSnl2OS()'
OSSolverDemo2.cpp:(.text.startup+0x185a): undefined reference to `FileUtil::getFileAsString(char const*)'
OSSolverDemo2.cpp:(.text.startup+0x189a): undefined reference to `OSiLReader::OSiLReader()'
OSSolverDemo2.cpp:(.text.startup+0x18ac): undefined reference to `OSiLReader::readOSiL(std::string const&)'
OSSolverDemo2.cpp:(.text.startup+0x18c6): undefined reference to `OSOption::OSOption()'
OSSolverDemo2.cpp:(.text.startup+0x1994): undefined reference to `OSOption::setAnotherSolverOption(std::string, std::string, std::string, std::string, std::string, std::string)'
OSSolverDemo2.cpp:(.text.startup+0x1a21): undefined reference to `OSoLWriter::OSoLWriter()'
OSSolverDemo2.cpp:(.text.startup+0x1a34): undefined reference to `OSoLWriter::writeOSoL(OSOption*)'
OSSolverDemo2.cpp:(.text.startup+0x1a73): undefined reference to `CoinSolver::CoinSolver()'
OSSolverDemo2.cpp:(.text.startup+0x1adf): undefined reference to `OSiLReader::~OSiLReader()'
OSSolverDemo2.cpp:(.text.startup+0x1b00): undefined reference to `OSOption::~OSOption()'
OSSolverDemo2.cpp:(.text.startup+0x1b15): undefined reference to `OSoLWriter::~OSoLWriter()'
OSSolverDemo2.cpp:(.text.startup+0x1bee): undefined reference to `FileUtil::getFileAsString(char const*)'
OSSolverDemo2.cpp:(.text.startup+0x1c29): undefined reference to `OSOption::OSOption()'
OSSolverDemo2.cpp:(.text.startup+0x1cf7): undefined reference to `OSOption::setAnotherSolverOption(std::string, std::string, std::string, std::string, std::string, std::string)'
OSSolverDemo2.cpp:(.text.startup+0x1e3d): undefined reference to `OSOption::setAnotherSolverOption(std::string, std::string, std::string, std::string, std::string, std::string)'
OSSolverDemo2.cpp:(.text.startup+0x1ee5): undefined reference to `OSOption::setInitVarValuesDense(int, double*)'
OSSolverDemo2.cpp:(.text.startup+0x1efa): undefined reference to `OSoLWriter::OSoLWriter()'
OSSolverDemo2.cpp:(.text.startup+0x1f10): undefined reference to `OSoLWriter::writeOSoL(OSOption*)'
OSSolverDemo2.cpp:(.text.startup+0x1f4f): undefined reference to `IpoptSolver::IpoptSolver()'
OSSolverDemo2.cpp:(.text.startup+0x1fc3): undefined reference to `OSOption::~OSOption()'
OSSolverDemo2.cpp:(.text.startup+0x1fd8): undefined reference to `OSoLWriter::~OSoLWriter()'
OSSolverDemo2.cpp:(.text.startup+0x20b1): undefined reference to `FileUtil::getFileAsString(char const*)'
OSSolverDemo2.cpp:(.text.startup+0x20ec): undefined reference to `OSiLReader::OSiLReader()'
OSSolverDemo2.cpp:(.text.startup+0x20f9): undefined reference to `OSiLReader::readOSiL(std::string const&)'
OSSolverDemo2.cpp:(.text.startup+0x2113): undefined reference to `OSOption::OSOption()'
OSSolverDemo2.cpp:(.text.startup+0x21de): undefined reference to `OSOption::setAnotherSolverOption(std::string, std::string, std::string, std::string, std::string, std::string)'
OSSolverDemo2.cpp:(.text.startup+0x226b): undefined reference to `OSoLWriter::OSoLWriter()'
OSSolverDemo2.cpp:(.text.startup+0x227e): undefined reference to `OSoLWriter::writeOSoL(OSOption*)'
OSSolverDemo2.cpp:(.text.startup+0x22bd): undefined reference to `BonminSolver::BonminSolver()'
OSSolverDemo2.cpp:(.text.startup+0x234b): undefined reference to `OSiLReader::~OSiLReader()'
OSSolverDemo2.cpp:(.text.startup+0x236a): undefined reference to `OSOption::~OSOption()'
OSSolverDemo2.cpp:(.text.startup+0x237f): undefined reference to `OSoLWriter::~OSoLWriter()'
OSSolverDemo2.cpp:(.text.startup+0x2394): undefined reference to `FileUtil::~FileUtil()'
OSSolverDemo2.cpp:(.text.startup+0x24b1): undefined reference to `FileUtil::~FileUtil()'
collect2: error: ld returned 1 exit status
make: *** [OSSolverDemo2] Error 1

I have tried also with other OS examples, but the same errors were generated.

I have executed the cpp example of Bonmin from ~/OS-2.10.1/build/Bonmin/examples/CppExample. The make command worked without any problems; I executed also the .exe generated file: also in this case everything worked perfectly.

Then I took a look at the OS unitTest from  ~/OS-2.10.1/OS/v2.0 which has worked and I have tried to extract from it the Couenne part for generating an example that I would can further use for my specific problem. Unfortunately I was unsuccessful in doing that.

In a last attempt I tried another version of OS: OS-2.10.0. There the compilation did not work: after creating a new folder build; cd build; ../configure the make thrown an error:

 g++ -DHAVE_CONFIG_H -I. -I../../../../Ipopt/src/Common -O3 -pipe -DNDEBUG -pedantic-errors -Wparentheses -Wreturn-type -Wcast-qual -Wall -Wpointer-arith -Wwrite-strings -Wconversion -Wno-unknown-pragmas -Wno-long-long -DIPOPT_BUILD -MT IpUtils.lo -MD -MP -MF .deps/IpUtils.Tpo -c ../../../../Ipopt/src/Common/IpUtils.cpp  -fPIC -DPIC -o .libs/IpUtils.o
../../../../Ipopt/src/Common/IpUtils.cpp:182:6: error: #error "don't have function for random number generator"
 #    error "don't have function for random number generator"
      ^
../../../../Ipopt/src/Common/IpUtils.cpp:203:6: error: #error "don't have function for random number generator"
 #    error "don't have function for random number generator"
      ^
../../../../Ipopt/src/Common/IpUtils.cpp: In function 'Ipopt::Number Ipopt::IpRandom01()':
../../../../Ipopt/src/Common/IpUtils.cpp:187:3: warning: no return statement in function returning non-void [-Wreturn-type]
   }
   ^
make[3]: *** [IpUtils.lo] Error 1
make[3]: Leaving directory `/home/bezrucav/OS-2.10.0/build/Ipopt/src/Common'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/bezrucav/OS-2.10.0/build/Ipopt/src/Common'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/bezrucav/OS-2.10.0/build/Ipopt'
make: *** [all-recursive] Error 1
bezrucav at rosel:~/OS-2.10.0/build$


Could you please tell me what I am doing wrong or what should I change in order to make the OS examples work?

Many thanks in advance!

Best regards,
Stefan Bezrucav
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/os/attachments/20171009/60b3467b/attachment-0001.html>


More information about the OS mailing list