[Osi] question on installing coin-or cplex interface

Stefan Vigerske stefan at math.hu-berlin.de
Sat Feb 16 10:27:41 EST 2019


Hi,

maybe you also need -ldl.

Have a look into Osi/config.log for details on why the test ("symbol 
CPXgetstat is available") failed.

Stefan

On 2/16/19 4:25 PM, T L wrote:
> Hi,
> 
> I just tried to compile against CPLEX directly, but got an error below (I
> have CPLEX installed in Ubuntu). Any pointers?
> 
> Thanks in advance,
> 
> $ ./configure
> --with-cplex-lib="-L/opt/ibm/ILOG/CPLEX_Studio128/cplex/lib/x86-64_linux/static_pic/
> -lcplex -lpthread -lm"
> -with-cplex-incdir="/opt/ibm/ILOG/CPLEX_Studio128/cplex/include/ilcplex"
> checking build system type... x86_64-unknown-linux-gnu
> checking whether we want to compile in debug mode... no
> checking for gcc... gcc
> checking for C compiler default output file name... a.out
> checking whether the C compiler works... yes
> checking whether we are cross compiling... no
> checking for suffix of executables...
> checking for suffix of object files... o
> checking whether we are using the GNU C compiler... yes
> checking whether gcc accepts -g... yes
> checking for gcc option to accept ANSI C... none needed
> configure: C compiler options are: -O3 -pipe -DNDEBUG -Wimplicit
> -Wparentheses -Wsequence-point -Wreturn-type -Wcast-qual -Wall
> -Wno-unknown-pragmas -Wno-long-long
> checking for g++... g++
> checking whether we are using the GNU C++ compiler... yes
> checking whether g++ accepts -g... yes
> checking whether C++ compiler g++ works... yes
> configure: C++ compiler options are: -O3 -pipe -DNDEBUG -Wparentheses
> -Wreturn-type -Wcast-qual -Wall -Wpointer-arith -Wwrite-strings
> -Wconversion -Wno-unknown-pragmas -Wno-long-long
> configure: Trying to determine Fortran compiler name
> checking for gfortran... gfortran
> checking whether we are using the GNU Fortran 77 compiler... yes
> checking whether gfortran accepts -g... yes
> configure: Fortran compiler options are: -O3 -pipe
> checking for egrep... grep -E
> checking whether ln -s works... yes
> checking for a BSD-compatible install... /usr/bin/install -c
> checking whether build environment is sane... yes
> checking for gawk... no
> checking for mawk... mawk
> checking whether make sets $(MAKE)... yes
> checking for style of include used by make... GNU
> checking dependency style of gcc... gcc3
> checking dependency style of g++... gcc3
> checking whether to enable maintainer-specific portions of Makefiles... no
> checking host system type... x86_64-unknown-linux-gnu
> checking for a sed that does not truncate output... /bin/sed
> checking for ld used by gcc... /usr/bin/ld
> checking if the linker (/usr/bin/ld) is GNU ld... yes
> checking for /usr/bin/ld option to reload object files... -r
> checking for BSD-compatible nm... /usr/bin/nm -B
> checking how to recognise dependent libraries... pass_all
> checking how to run the C preprocessor... gcc -E
> checking for ANSI C header files... yes
> checking for sys/types.h... yes
> checking for sys/stat.h... yes
> checking for stdlib.h... yes
> checking for string.h... yes
> checking for memory.h... yes
> checking for strings.h... yes
> checking for inttypes.h... yes
> checking for stdint.h... yes
> checking for unistd.h... yes
> checking dlfcn.h usability... yes
> checking dlfcn.h presence... yes
> checking for dlfcn.h... yes
> checking how to run the C++ preprocessor... g++ -E
> checking the maximum length of command line arguments... 32768
> checking command to parse /usr/bin/nm -B output from gcc object... ok
> checking for objdir... .libs
> checking for ar... ar
> checking for ranlib... ranlib
> checking for strip... strip
> checking if gcc supports -fno-rtti -fno-exceptions... no
> checking for gcc option to produce PIC... -fPIC
> checking if gcc PIC flag -fPIC works... yes
> checking if gcc static flag -static works... yes
> checking if gcc supports -c -o file.o... yes
> checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared
> libraries... yes
> checking whether -lc should be explicitly linked in... no
> checking dynamic linker characteristics... cat: /etc/ld.so.conf.d/opl.conf:
> Permission denied
> GNU/Linux ld.so
> checking how to hardcode library paths into programs... immediate
> checking whether stripping libraries is possible... yes
> checking if libtool supports shared libraries... yes
> checking whether to build shared libraries... yes
> checking whether to build static libraries... no
> configure: creating libtool
> appending configuration tag "CXX" to libtool
> checking for ld used by g++... /usr/bin/ld -m elf_x86_64
> checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes
> checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared
> libraries... yes
> checking for g++ option to produce PIC... -fPIC
> checking if g++ PIC flag -fPIC works... yes
> checking if g++ static flag -static works... yes
> checking if g++ supports -c -o file.o... yes
> checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared
> libraries... yes
> checking dynamic linker characteristics... cat: /etc/ld.so.conf.d/opl.conf:
> Permission denied
> GNU/Linux ld.so
> checking how to hardcode library paths into programs... immediate
> appending configuration tag "F77" to libtool
> checking if libtool supports shared libraries... yes
> checking whether to build shared libraries... yes
> checking whether to build static libraries... no
> checking for gfortran option to produce PIC... -fPIC
> checking if gfortran PIC flag -fPIC works... yes
> checking if gfortran static flag -static works... yes
> checking if gfortran supports -c -o file.o... yes
> checking whether the gfortran linker (/usr/bin/ld -m elf_x86_64) supports
> shared libraries... yes
> checking dynamic linker characteristics... cat: /etc/ld.so.conf.d/opl.conf:
> Permission denied
> GNU/Linux ld.so
> checking how to hardcode library paths into programs... immediate
> configure: Build is "x86_64-unknown-linux-gnu".
> checking if library version is set... no
> checking whether source of project Glpk is available and should be
> compiled... no
> checking whether source of project SoPlex is available and should be
> compiled... no
> checking whether source of project Blas is available and should be
> compiled... no
> checking whether source of project Lapack is available and should be
> compiled... no
> checking whether source of project Sample is available and should be
> compiled... no
> checking whether source of project Netlib is available and should be
> compiled... no
> checking whether source of project CoinUtils is available and should be
> compiled... no
> checking whether source of project Osi is available and should be
> compiled... yes, source in Osi
> configure: configuring doxygen documentation options
> checking for doxygen... no
> checking for latex... no
> checking for dot... NO
> checking for doxygen doc'n for CoinUtils ...
> NONE/share/coin/doc/CoinUtils/doxydoc (tag)
> checking for doxygen doc'n for Cgl ... NONE/share/coin/doc/Cgl/doxydoc (tag)
> checking for doxygen doc'n for Clp ... NONE/share/coin/doc/Clp/doxydoc (tag)
> checking for doxygen doc'n for DyLP ... NONE/share/coin/doc/DyLP/doxydoc
> (tag)
> checking for doxygen doc'n for Vol ... NONE/share/coin/doc/Vol/doxydoc (tag)
> checking for doxygen doc'n for SYMPHONY ...
> NONE/share/coin/doc/SYMPHONY/doxydoc (tag)
> checking which command should be used to link input files... ln -s
> configure: creating ./config.status
> config.status: creating Makefile
> config.status: creating doxydoc/doxygen.conf
> config.status: executing depfiles commands
> configure: configuring in Osi
> configure: running /bin/bash './configure' --prefix=/home/user/myosi/Osi
> '--with-cplex-lib=-L/opt/ibm/ILOG/CPLEX_Studio128/cplex/lib/x86-64_linux/static_pic/
> -lcplex -lpthread -lm'
> '-with-cplex-incdir=/opt/ibm/ILOG/CPLEX_Studio128/cplex/include/ilcplex'
> --cache-file=/dev/null --srcdir=.
> checking build system type... x86_64-unknown-linux-gnu
> checking for svnversion... no
> checking whether we want to compile in debug mode... no
> checking for gcc... gcc
> checking for C compiler default output file name... a.out
> checking whether the C compiler works... yes
> checking whether we are cross compiling... no
> checking for suffix of executables...
> checking for suffix of object files... o
> checking whether we are using the GNU C compiler... yes
> checking whether gcc accepts -g... yes
> checking for gcc option to accept ANSI C... none needed
> configure: C compiler options are: -O3 -pipe -DNDEBUG -Wimplicit
> -Wparentheses -Wsequence-point -Wreturn-type -Wcast-qual -Wall
> -Wno-unknown-pragmas -Wno-long-long   -DOSI_BUILD
> checking for g++... g++
> checking whether we are using the GNU C++ compiler... yes
> checking whether g++ accepts -g... yes
> checking whether C++ compiler g++ works... yes
> configure: C++ compiler options are: -O3 -pipe -DNDEBUG -Wparentheses
> -Wreturn-type -Wcast-qual -Wall -Wpointer-arith -Wwrite-strings
> -Wconversion -Wno-unknown-pragmas -Wno-long-long   -DOSI_BUILD
> checking for egrep... grep -E
> checking whether ln -s works... yes
> checking for a BSD-compatible install... /usr/bin/install -c
> checking whether build environment is sane... yes
> checking for gawk... no
> checking for mawk... mawk
> checking whether make sets $(MAKE)... yes
> checking for style of include used by make... GNU
> checking dependency style of gcc... gcc3
> checking dependency style of g++... gcc3
> checking whether to enable maintainer-specific portions of Makefiles... no
> configure: Using libtool script in directory ..
> checking if library version is set... no
> checking for pkg-config... pkg-config
> checking pkg-config is at least version 0.16.0... yes
> checking for COIN-OR package CoinUtils... yes: 2.10.14
> checking for COIN-OR package Glpk... not given: No package 'coinglpk' found
> checking for COIN-OR package SoPlex... not given: No package 'coinsoplex'
> found
> checking for COIN-OR package Sample... yes: 1.2.10
> checking for COIN-OR package Netlib... not given: No package
> 'coindatanetlib' found
> checking if user provides library for Cplex... yes
> checking whether symbol CPXgetstat is available with CPX... no
> configure: error: Cannot find symbol(s) CPXgetstat with CPX
> configure: error: /bin/bash './configure' failed for Osi
> 
> 
> On Sat, Feb 16, 2019 at 7:24 AM Stefan Vigerske <stefan at math.hu-berlin.de>
> wrote:
> 
>> Hi,
>>
>> it looks like configure didn't see the flags to build against Cplex and
>> then didn't build OsiCpx.
>>
>> Are you sure that you actually have the lazylpsolverlibs package installed?
>>
>> Have a look into the output of configure.
>>
>> It should be easier to first try building against CPLEX, etc, directly,
>> without the lazylpsolverlibs in between.
>>
>> Stefan
>>
>>
>> On 2/16/19 8:08 AM, T L wrote:
>>>    Hi List members,
>>>
>>> I have a quick question about installing the coin-or OSI interface for
>>> CPLEX.
>>>
>>> Following the OSI website <https://projects.coin-or.org/Osi>, I
>> compiled it
>>> from source (under Ubuntu 18.04) as follows:
>>>
>>> ./configure --with-cplex-incdir="$(pkg-config --variable=includedir
>>> lazycplex)/lazylpsolverlibs/ilcplex" \
>>>               --with-cplex-lib="$(pkg-config --libs lazycplex)" \
>>>               --with-gurobi-incdir="$(pkg-config --variable=includedir
>>> lazygurobi)/lazylpsolverlibs" \
>>>               --with-gurobi-lib="$(pkg-config --libs lazygurobi)" \
>>>               --with-xpress-incdir="$(pkg-config --variable=includedir
>>> lazyxprs)/lazylpsolverlibs" \
>>>               --with-xpress-lib="$(pkg-config --libs lazyxprs)"
>>> make
>>> make test
>>> sudo make install
>>>
>>> But I cannot find the header file for CPLEX OsiCplexSolverInterface.hpp
>> in
>>> /usr/inclde/coin/, while other files such as
>>> /usr/include/coin/OsiClpSolverInterface.hpp are present.
>>>
>>> However, it is inside the build folder as
>>> include/coin/OsiCpxSolverInterface.hpp.
>>>
>>> Then when I try to compile example code for cplex, it gives an error
>> about
>>> missing OsiCpxSolverInterface.hpp
>>>
>>> Do I need to add options to ./configure to let make install it to system
>>> folder?
>>>
>>> (I prefer to install in system folder, rather than individual users' home
>>> folder; I've asked a question on StackOverflow:
>>> https://stackoverflow.com/questions/54614995  but haven't got any
>> answer so
>>> far.)
>>>
>>> Thanks in advance,
>>>
>>>
>>> _______________________________________________
>>> Osi mailing list
>>> Osi at list.coin-or.org
>>> https://list.coin-or.org/mailman/listinfo/osi
>>>
>>
>>
> 



More information about the Osi mailing list