[Bonmin] Setting up Bonmin 1.8.7 with CPLEX 12.9

Stefan Vigerske stefan at math.hu-berlin.de
Wed Jul 3 10:42:00 EDT 2019


Try without the space after -L then.
On 7/3/19 4:40 PM, Neumann, Christoph (IOR) wrote:
> Hi Stefan,
> 
> cool, that helped. I now used
> 
> bash coinbrew build Bonmin --with-cplex-lib="-L /opt/ibm/ILOG/CPLEX_Studio129/cplex/lib/x86-64_linux/static_pic -lcplex -ldl -lm -lpthread" --with-cplex-incdir="-L /opt/ibm/ILOG/CPLEX_Studio129/cplex/include/ilcplex"
> 
> which now yields
> 
> /usr/bin/ld: cannot find -lcplex
> collect2: error: ld returned 1 exit status
> Makefile:441: recipe for target 'libOsiCpx.la' failed
> 
> Thanks so much for helping me out!
> 
> Cheers
> Christoph
> 
> 
> 
> -----Ursprüngliche Nachricht-----
> Von: Stefan Vigerske <stefan at math.hu-berlin.de>
> Gesendet: Mittwoch, 3. Juli 2019 16:06
> An: Neumann, Christoph (IOR) <christoph.neumann at kit.edu>
> Cc: bonmin at list.coin-or.org; Ted Ralphs <ted at lehigh.edu>
> Betreff: Re: AW: AW: [Bonmin] Setting up Bonmin 1.8.7 with CPLEX 12.9
> 
> Hi,
> 
> well, it's not exactly the same. At least the path is now accepted:
> 
> configure:23311: gcc -o conftest -O3 -pipe -DNDEBUG -Wimplicit -Wparentheses -Wsequence-point -Wreturn-type -Wcast-qual -Wall
> -Wno-unknown-pragmas -Wno-long-long   -DOSI_BUILD   conftest.c -L
> /opt/ibm/ILOG/CPLEX_Studio129/cplex/lib -lcplex -ldl -lm -lpthread  >&5
> conftest.c: In function 'main':
> conftest.c:37:1: warning: implicit declaration of function 'CPXgetstat'
> [-Wimplicit-function-declaration]
>    CPXgetstat()
>    ^~~~~~~~~~
> /usr/bin/ld: cannot find -lcplex
> 
> 
> Is there a libcplex.so or libcplex.a in
> /opt/ibm/ILOG/CPLEX_Studio129/cplex/lib ?
> I thought there is usually a static_pic subdirectory somewhere.
> 
> Stefan
> 
> On 7/3/19 4:00 PM, Neumann, Christoph (IOR) wrote:
>> Thanks Stefan,
>>
>> if I understand it correctly, you suggested to build using
>>
>> bash coinbrew build Bonmin --with-cplex-lib="-L /opt/ibm/ILOG/CPLEX_Studio129/cplex/lib -lcplex -ldl -lm -lpthread" --with-cplex-incdir="-L /opt/ibm/ILOG/CPLEX_Studio129/cplex/include/ilcplex"
>>
>> Is that correct? Unfortunately, this yields the same error.
>>
>> Cheers,
>> Christoph
>>
>> -----Ursprüngliche Nachricht-----
>> Von: Stefan Vigerske <stefan at math.hu-berlin.de>
>> Gesendet: Dienstag, 2. Juli 2019 17:18
>> An: Neumann, Christoph (IOR) <christoph.neumann at kit.edu>; Ted Ralphs <ted at lehigh.edu>
>> Cc: Pierre Bonami <pierre.bonami at gmail.com>; bonmin at list.coin-or.org
>> Betreff: Re: AW: [Bonmin] Setting up Bonmin 1.8.7 with CPLEX 12.9
>>
>>    From your config.log:
>>
>> configure:23311: gcc -o conftest -O3 -pipe -DNDEBUG -Wimplicit -Wparentheses -Wsequence-point -Wreturn-type -Wcast-qual -Wall
>> -Wno-unknown-pragmas -Wno-long-long   -DOSI_BUILD   conftest.c
>> /opt/ibm/ILOG/CPLEX_Studio129/cplex/lib -lcplex -lm -lpthread  >&5
>> conftest.c: In function 'main':
>> conftest.c:37:1: warning: implicit declaration of function 'CPXgetstat'
>> [-Wimplicit-function-declaration]
>>     CPXgetstat()
>>     ^~~~~~~~~~
>> /usr/bin/ld: cannot find /opt/ibm/ILOG/CPLEX_Studio129/cplex/lib: File format not recognized
>> /usr/bin/ld: cannot find -lcplex
>>
>>
>> I believe you meant -L/opt/ibm/...
>>
>> Probably you'll also need -ldl.
>>
>> Stefan
>>
>> On 7/2/19 5:12 PM, Neumann, Christoph (IOR) wrote:
>>> Thanks Ted,
>>>
>>>     
>>>
>>> actually I don’t want to link Visual Studio libraries, it just happened that I used the Windows installer to install cplex. I re-installed cplex using WSL and the linux-binaries for cplex. If I understand you correctly, this should be appropriate to link the libraries for bonmin.
>>>
>>>     
>>>
>>> The cplex.h is now located in
>>>
>>>     
>>>
>>> /opt/ibm/ILOG/CPLEX_Studio129/cplex/include/ilcplex/cplex.h
>>>
>>>     
>>>
>>> and libcplex.a in
>>>
>>>     
>>>
>>> /opt/ibm/ILOG/CPLEX_Studio129/cplex/lib/x86-64_linux/static_pic/libcpl
>>> ex.a
>>>
>>>     
>>>
>>> I used the command
>>>
>>>     
>>>
>>> bash coinbrew build Bonmin
>>> --with-cplex-lib="/opt/ibm/ILOG/CPLEX_Studio129/cplex/lib -lcplex -lm
>>> -lpthread"
>>> --with-cplex-incdir=/opt/ibm/ILOG/CPLEX_Studio129/cplex/include/ilcple
>>> x
>>>
>>>     
>>>
>>> which now exits with:
>>>
>>>     
>>>
>>> configure: Build is "x86_64-unknown-linux-gnu".
>>>
>>> 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.11
>>>
>>> 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
>>>
>>> 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
>>>
>>>     
>>>
>>> I also attached the config.log in the OSI folder.
>>>
>>>     
>>>
>>> Again, many thanks!
>>>
>>>     
>>>
>>> Christoph
>>>
>>>     
>>>
>>>     
>>>
>>> Von: Ted Ralphs <ted at lehigh.edu>
>>> Gesendet: Montag, 1. Juli 2019 16:05
>>> An: Neumann, Christoph (IOR) <christoph.neumann at kit.edu>
>>> Cc: Stefan Vigerske <stefan at math.hu-berlin.de>; Pierre Bonami
>>> <pierre.bonami at gmail.com>; bonmin at list.coin-or.org
>>> Betreff: Re: [Bonmin] Setting up Bonmin 1.8.7 with CPLEX 12.9
>>>
>>>     
>>>
>>> In WSL, you are really building in Linux so you need to link to the Linux libraries, not the Visual Studio ones. If you want to link to Visual Studio libraries, you can follow the instructions for building under Msys2, but you will either need a Visual Studio compatible Fortran compiler (like Intel's ifort) or figure out how to make libraries built with MinGW compilers (Windows port of gcc and gfortran) link to Visual studio (this is possible, but a bit difficult and I have never tried it).
>>>
>>>     
>>>
>>> Once you install Msys, you will get another bash installed (make sure it comes first in your path). You just need to have the Visual Studio compiler and your Fortran compiler in the Windows Path, then you can build using the same incantation except that you need to add the argument --enable-msvc to coinbrew.
>>>
>>>     
>>>
>>> Let us know how it goes.
>>>
>>>     
>>>
>>> Cheers,
>>>
>>>     
>>>
>>> Ted
>>>
>>>     
>>>
>>> On Mon, Jul 1, 2019 at 8:22 AM Neumann, Christoph (IOR) <christoph.neumann at kit.edu <mailto:christoph.neumann at kit.edu> > wrote:
>>>
>>> Okay, amazing, the coinbrew script really facilitates the process! I used the command:
>>>
>>>     
>>>
>>> bash coinbrew build Bonmin
>>> --with-cplex-lib=/mnt/c/IBM/ILOG/CPLEX_Studio129/cplex/lib/x64_windows
>>> _vs2017/stat_mda/cplex1290.lib
>>> --with-cplex-incdir=/mnt/c/IBM/ILOG/CPLEX_Studio129/cplex/include/ilcp
>>> lex
>>>
>>>     
>>>
>>> and now I get the error I’ve been waiting for the whole time: one that has to do with the reference to the Cplex-library.
>>>
>>>     
>>>
>>> /mnt/c/coinbrew-master/build/Osi/src/OsiCpx/.libs/libOsiCpx.so: undefined reference to `CPXgetobj'
>>>
>>> (…)
>>>
>>> /mnt/c/coinbrew-master/build/Osi/src/OsiCpx/.libs/libOsiCpx.so: undefined reference to `CPXgetsense'
>>>
>>> collect2: error: ld returned 1 exit status
>>>
>>> Makefile:877: recipe for target 'cbc' failed
>>>
>>>     
>>>
>>> which brings me back to the question of how to link the cplex-library under windows.
>>>
>>>     
>>>
>>> As a reminder of the previous message: The CPLEX-documentation states:
>>>
>>> lib\<compiler>\<libformat>: Library files that contain CPLEX (cplex1290.lib) and  CPLEX extensions to the C++ version of Concert Technology (ilocplex.lib).
>>>
>>> Again, thanks so much for your help.
>>>
>>>     
>>>
>>> Christoph
>>>
>>>     
>>>
>>> Von: Ted Ralphs <ted at lehigh.edu <mailto:ted at lehigh.edu> >
>>> Gesendet: Freitag, 28. Juni 2019 04:25
>>> An: Neumann, Christoph (IOR) <christoph.neumann at kit.edu
>>> <mailto:christoph.neumann at kit.edu> >
>>> Cc: Stefan Vigerske <stefan at math.hu-berlin.de
>>> <mailto:stefan at math.hu-berlin.de> >; Pierre Bonami
>>> <pierre.bonami at gmail.com <mailto:pierre.bonami at gmail.com> >;
>>> bonmin at list.coin-or.org <mailto:bonmin at list.coin-or.org>
>>> Betreff: Re: [Bonmin] Setting up Bonmin 1.8.7 with CPLEX 12.9
>>>
>>>     
>>>
>>> Hi Christoph,
>>>
>>>     
>>>
>>> Thanks for the report. This is a bit strange. I've never actually seen that particular linker error. Seems to be something with the Fortran library itself. I've been building Bonmin on WSL (Ubuntu) and have had no issues myself, but you are using a deprecated build method (sorry for the documentation being out of date, we have 20 projects to update and not enough time!), so any number of things could be going wrong.
>>>
>>>     
>>>
>>> So, first, would you mind opening on an issue on the Bonmin github site (https://github.com/coin-or/Bonmin). We're in the process of moving all project management over to github and it would be helpful to follow up on this there.
>>>
>>>     
>>>
>>> Second, can you try building using the "coinbrew" script, which is now
>>> the recommended method of building? (We are in the midst of moving to
>>> git and thus can no longer depend on SVN externals for checking out
>>> dependencies)
>>>
>>>     
>>>
>>> https://github.com/coin-or/coinbrew
>>>
>>>     
>>>
>>> Documentation here:
>>>
>>>     
>>>
>>> https://coin-or.github.io/coinbrew/
>>>
>>>     
>>>
>>> You won't need to check anything out first, just get the script, fetch the source, and build.
>>>
>>>     
>>>
>>> If you get the same error, you should try using the system Blas and Lapack rather than the COIN-OR built version. You can do this by either commenting the lines in the Dependencies file or using '--skip "ThirdParty/Blas ThirdParty/Lapack"'
>>>
>>>     
>>>
>>> Cheers,
>>>
>>>     
>>>
>>> Ted
>>>
>>>     
>>>
>>> On Thu, Jun 27, 2019 at 12:05 PM Neumann, Christoph (IOR) <christoph.neumann at kit.edu <mailto:christoph.neumann at kit.edu> > wrote:
>>>
>>> Hi Pierre, Stefan and Ted
>>>
>>> Thanks to all of you for your help! Stefan, your advice actually fixed the problem I described but I got stuck at another point so I figured that I'd try Pierre's approach, getting WSL (ubuntu).
>>>
>>> Using WSL, the configuration script with CPLEX worked - yeah, we're one step further! Yet, the make command still results in an error. I have attached both, the config.log as well as the output of make and hope that you can make some sense out of it...
>>>
>>> Cheers,
>>> Christoph
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> -----Ursprüngliche Nachricht-----
>>> Von: Stefan Vigerske <stefan at math.hu-berlin.de
>>> <mailto:stefan at math.hu-berlin.de> >
>>> Gesendet: Donnerstag, 6. Juni 2019 12:53
>>> An: Neumann, Christoph (IOR) <christoph.neumann at kit.edu
>>> <mailto:christoph.neumann at kit.edu> >; Ted Ralphs <ted at lehigh.edu
>>> <mailto:ted at lehigh.edu> >; Pierre Bonami <pierre.bonami at gmail.com
>>> <mailto:pierre.bonami at gmail.com> >
>>> Cc: bonmin at list.coin-or.org <mailto:bonmin at list.coin-or.org>
>>> Betreff: Re: [Bonmin] Setting up Bonmin 1.8.7 with CPLEX 12.9
>>>
>>> Hi,
>>>
>>> for this particular one about the build system type, you could try
>>> running configure with --build=x86_64-pc-mingw32
>>>
>>> The autotools version used by Bonmin is still a bit old and doesn't know how to handle msys yet.
>>>
>>> Stefan
>>>
>>> On 6/5/19 6:25 PM, Neumann, Christoph (IOR) wrote:
>>>> Thanks for helping me out here! The reason for building in CYGWIN was that the process is layed out specifically for Bonmin here <https://projects.coin-or.org/Bonmin/wiki/CygwinInstall>  and that my expertise of compilation processes is very limited.
>>>>
>>>>      
>>>>
>>>> So I switched to Msys2 but got stuck a bit earlier in the process
>>>> with the error message
>>>>
>>>>      
>>>>
>>>> checking build system type... Invalid configuration `x86_64-pc-msys':
>>>> system `msys' not recognized
>>>>
>>>> configure: error: /bin/sh ../config.sub x86_64-pc-msys failed
>>>>
>>>>      
>>>>
>>>> I found a similar error in this github issue <https://github.com/coin-or/COIN-OR-OptimizationSuite/issues/6>  but `pacman -Syuu` returns that everything is already up to date. I set the path variables "C:\msys64\usr\bin" and "C:\msys64\usr\local\bin" and ran through things described here <https://www.devdungeon.com/content/install-gcc-compiler-windows-msys2-cc> .
>>>>
>>>>      
>>>>
>>>> Again, any help is greatly appreciated!
>>>>
>>>>      
>>>>
>>>> Cheers,
>>>>
>>>> Christoph
>>>>
>>>>      
>>>>
>>>>      
>>>>
>>>>      
>>>>
>>>> Von: Ted Ralphs <ted at lehigh.edu <mailto:ted at lehigh.edu> >
>>>> Gesendet: Mittwoch, 5. Juni 2019 05:27
>>>> An: Pierre Bonami <pierre.bonami at gmail.com
>>>> <mailto:pierre.bonami at gmail.com> >
>>>> Cc: bonmin at list.coin-or.org <mailto:bonmin at list.coin-or.org> ;
>>>> Neumann, Christoph (IOR) <christoph.neumann at kit.edu
>>>> <mailto:christoph.neumann at kit.edu> >
>>>> Betreff: Re: [Bonmin] Setting up Bonmin 1.8.7 with CPLEX 12.9
>>>>
>>>>      
>>>>
>>>> Pierre, thanks for replying to this e-mail and reminding me about it. Christoph, I can certainly also help with getting you building. Is there a reason you really want to build in CYGWIN? These days, Msys2 and/or Windows Subsystem for Linux are much better options. We have not really kept up the CYGWIN support, since these better options exist and since it has some "eccentricities."
>>>>
>>>>      
>>>>
>>>> If you really want to build with CYGWIN, then sending your config.log is a good first step. Are you building with the Microsoft compilers or with gcc? I suspect it may have something to do with specifying Windows paths rather than POSIX paths.
>>>>
>>>>      
>>>>
>>>> Cheers,
>>>>
>>>>      
>>>>
>>>> Ted
>>>>
>>>>      
>>>>
>>>> On Mon, Jun 3, 2019 at 8:18 PM Pierre Bonami <pierre.bonami at gmail.com <mailto:pierre.bonami at gmail.com>  <mailto:pierre.bonami at gmail.com <mailto:pierre.bonami at gmail.com> > > wrote:
>>>>
>>>> Dera Christoph,
>>>>
>>>>      
>>>>
>>>> I don’t have a windows machine so I am really unsure how to do it.
>>>>
>>>> Can you please send your config.log and the output of make so that I can see what is the error.
>>>>
>>>>      
>>>>
>>>> I have not done it in a long time but compiling from windows was always painful and very long. You might consider using a virtual machine in linux.
>>>>
>>>>      
>>>>
>>>> Best regards,
>>>>
>>>> Pierre
>>>>
>>>> On 21 May 2019, 16:55 +0200, Neumann, Christoph (IOR) <christoph.neumann at kit.edu <mailto:christoph.neumann at kit.edu>  <mailto:christoph.neumann at kit.edu <mailto:christoph.neumann at kit.edu> > >, wrote:
>>>>
>>>>
>>>>
>>>> Dear experts,
>>>>
>>>>      
>>>>
>>>> I am trying to set up Bonmin 1.8.7 with CPLEX as MILP-Solver under Windows 10 using Cygwin and could really use some help. The configure script runs through successfully but I get an error message when executing the build command:
>>>>
>>>>      
>>>>
>>>> make[1]:Leaving directory
>>>> „/cygdrive/c/Programme/Bonmin-1.8.7/build/Cbc“
>>>>
>>>> make: *** [Makefile:312: all-recursive] Error 1
>>>>
>>>>      
>>>>
>>>> I had previously installed Bonmin (1.8.6) without CPLEX and it worked fine so I assume that the problem has to do with CPLEX even though the error occurs after leaving the Cbc folder.
>>>>
>>>>      
>>>>
>>>> Below, I provide some details that seem relevant:
>>>>
>>>> I installed an academic version of CPLEX 12.9, obtained the required
>>>> third party code for Bonmin as described in the instructions and used
>>>> the command
>>>>
>>>>      
>>>>
>>>> ./configure --with-cplex-lib="C:\Programme\IBM\ILOG\CPLEX_Studio129\cplex\lib\x64_windows_vs2017\stat_mdd\cplex1290.
>>>>
>>>> lib" \
>>>>
>>>> --with-cplex-incdir="C:\Programme\IBM\ILOG\CPLEX_Studio129\cplex\include\ilcplex"
>>>>
>>>>      
>>>>
>>>> for the configuration. It exits with the message `Main configuration of Bonmin successful`, so at least it seems that this part worked. I was a bit confused when specifying the path to the CPLEX library, as I did not find a libcplex.a file. Instead, the CPLEX-documentation  states:
>>>>
>>>>      
>>>>
>>>>       lib\<compiler>\<libformat>:
>>>>
>>>>                     Library files that contain CPLEX (cplex1290.lib)
>>>> and
>>>>
>>>>                     CPLEX extensions to the C++ version of Concert Technology (ilocplex.lib).
>>>>
>>>>      
>>>>
>>>> so I assumed that cplex1290.lib is the required file(?).
>>>>
>>>>      
>>>>
>>>> For <compiler> I had the options: <x64_windows_vs2015, x64_windows_vs2017> and for <libformat>: <stat_mda, stat_mdd> and I tried out all four variations.
>>>>
>>>>      
>>>>
>>>> Any help is greatly appreciated!
>>>>
>>>>      
>>>>
>>>> Kind regards
>>>>
>>>> Christoph
>>>>
>>>> _______________________________________________
>>>> Bonmin mailing list
>>>> Bonmin at list.coin-or.org <mailto:Bonmin at list.coin-or.org>
>>>> <mailto:Bonmin at list.coin-or.org <mailto:Bonmin at list.coin-or.org> >
>>>> https://list.coin-or.org/mailman/listinfo/bonmin
>>>>
>>>> _______________________________________________
>>>> Bonmin mailing list
>>>> Bonmin at list.coin-or.org <mailto:Bonmin at list.coin-or.org>
>>>> <mailto:Bonmin at list.coin-or.org <mailto:Bonmin at list.coin-or.org> >
>>>> https://list.coin-or.org/mailman/listinfo/bonmin
>>>>
>>>>
>>>>
>>>>
>>>>      
>>>>
>>>>
>>>> _______________________________________________
>>>> Bonmin mailing list
>>>> Bonmin at list.coin-or.org <mailto:Bonmin at list.coin-or.org>
>>>> https://list.coin-or.org/mailman/listinfo/bonmin
>>>>
>>>
>>>
>>>
>>>
>>>     
>>>
>>
> 



More information about the Bonmin mailing list