[Osi] How to link Osi with CPLEX

Cristián Serpell cristian at serpell.cl
Mon Oct 7 12:03:31 EDT 2013


Hi all,

I have been trying to get Osi linked with CPLEX in my Ubuntu and failed...

I started with lazylpsolverlibs, following instructions in [1] and [2]. It
didn't work with my version of CPLEX: 12.5.1. It seems this version is not
compatible backwards. I opened an issue for this project: [3].

Then, I tried compiling Osi directly to use CPLEX library, without using
lazylpsolverlibs (Note that include/ilcplex has the .h files):

./configure
--with-cplex-incdir="/opt/ibm/ILOG/CPLEX_Studio1251/cplex/include/ilcplex"
--with-cplex-lib=/opt/ibm/ILOG/CPLEX_Studio1251/cplex/bin/x86-64_sles10_4.1/libcplex1251.so

make

make test

It fails, when linking libraries:

g++ -O3 -pipe -DNDEBUG -pedantic-errors -Wparentheses -Wreturn-type
-Wcast-qual -Wall -Wpointer-arith -Wwrite-strings -Wconversion
-Wno-unknown-pragmas -Wno-long-long -DOSI_BUILD -o .libs/unitTest
unitTest.o OsiTestSolver.o OsiTestSolverInterface.o
OsiTestSolverInterfaceIO.o OsiTestSolverInterfaceTest.o
OsiCpxSolverInterfaceTest.o
/opt/ibm/ILOG/CPLEX_Studio1251/cplex/bin/x86-64_sles10_4.1/libcplex1251.so
../src/OsiCommonTest/.libs/libOsiCommonTests.so
../src/OsiCpx/.libs/libOsiCpx.so ../src/Osi/.libs/libOsi.so
/home/cserpell/Projects/RoLT/downloads/Osi/Osi-0.106.2/CoinUtils/src/.libs/libCoinUtils.so
-lbz2 -lz -llapack -lblas -lm -Wl,--rpath
-Wl,/home/cserpell/Projects/RoLT/downloads/Osi/Osi-0.106.2/lib
../src/OsiCpx/.libs/libOsiCpx.so: undefined reference to `CPXgetobj'
../src/OsiCpx/.libs/libOsiCpx.so: undefined reference to `CPXcopymipstart'
...
../src/OsiCpx/.libs/libOsiCpx.so: undefined reference to `CPXgetsense'
collect2: error: ld returned 1 exit status
make[2]: *** [unitTest] Error 1
make[1]: *** [test] Error 2
make: *** [test] Error 2

I imagine this has to do with backwards compatibility. So my question is:
Is someone successfully using this version of CPLEX via Osi?

My problem is when compiling the test, not while running, like [4].

[1] https://code.google.com/p/lazylpsolverlibs/wiki/HowToSetup
[2] http://list.coin-or.org/pipermail/osi/2012-July/000514.html
[3] https://code.google.com/p/lazylpsolverlibs/issues/detail?id=8
[4] https://projects.coin-or.org/Osi/ticket/102

Thanks a lot for your help,
Cristián
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/osi/attachments/20131007/44697b3f/attachment.html>


More information about the Osi mailing list