[Cbc] VS 2019 Cbc build problems

Stefan Vigerske svigerske at gams.com
Wed Feb 5 04:13:50 EST 2020


Hi,

sounds good.
I've done some (or all?) of these changes to the _EXPORT definitions 
now. It's not tested, of course.

Stefan

On 2/4/20 10:26 PM, Jan-Willem Goossens wrote:
> Stefan,
> 
> Thanks for the libCoinUtils fix and the WSMP_FUNC suggestion!
> Currently, for me none of the Cbc/Clp/Cgl Visual Studio projects build ‘out of the box’—without config.
> 
> For WSMP_FUNC, I compared the older stable Clp Visual Studio v10 project, and indeed all such special functions are by default Excluded from the project. I propose the same for the v16 project.
> 
> For libCoinUtils, and similar issue with the new xxxLIB_EXPORT, the Visual Studio projects can simply be the plain vanilla builds to work out of the box, without any external components. But for that the sections for xxLIB_EXPORT in the relevant config_default.h and config_xxx_default.h need a minor fix:
> #ifndef COINUTILSLIB_EXPORT
> #ifdef _WIN32
> #ifdef DLL_EXPORT
> /* assuming we build a CoinUtils DLL */
> #define COINUTILSLIB_EXPORT __declspec(dllexport)
> #else
> #define COINUTILSLIB_EXPORT
> #endif
> #endif
> #endif
> (so use DLL_EXPORT, as in CoinUtilsConfig.h)
> Since all VS projects are set to build Static Lib rather than DLLs.
> Similar fixes can be applied to Cbc (and CbcSolver), Cgl and Clp (and OsiClp).
> 
> Cbc\src\CbcSolverConfig.h  (ifdef CBCSOLVER_BUILD -> ifdef DLL_EXPORT)
> Cbc\src\config_default.h
> Cbc\src\config_cbc_default.h
> Cgl\src\CglCommon\config_default.h
> Cgl\src\CglCommon\config_cgl_default.h
> Clp\src\config_default.h
> Clp\src\config_clp_default.h
> Clp\src\OsiClp\OsiClpConfig.h (ifdef OSICLP_BUILD -> ifdef DDL_EXPORT)
> 
> If that’s a reasonable approach, I can create some PRs for the above to make all these projects and solutions build using Visual Studio and v16 projects and solutions.
> On the other hand, I might be going the wrong direction..
> 
> Thanks for your help.
> Regards,
> 
> Jan-Willem
> 
> From: Stefan Vigerske<mailto:svigerske at gams.com>
> Sent: Monday, February 3, 2020 10:58 AM
> To: Jan-Willem Goossens<mailto:jhmgoossens at hotmail.com>; cbc at list.coin-or.org<mailto:cbc at list.coin-or.org>
> Subject: Re: [Cbc] VS 2019 Cbc build problems
> 
> Hi,
> 
> On 2/2/20 10:09 PM, Jan-Willem Goossens wrote:
>> Dear all,
>>
>> I’m trying to build the latest (master) Cbc using Visual Studio 2019 and the v16 solution, together with the latest master of all relevant related repos (BuildTools, CoinUtils, Cgl, etc., etc.)
>>
>> First, I encountered an issue loading the Cbc solution, due to a ReleaseParallel configuration, but I think I worked around that.
>> Next, libCoinUtils wouldn’t compile, due to a #define COINUTILSLIB_EXPORT was missing.
> 
> This might be fixed now.
> 
>> After that, libClp wouldn’t compile, due unknown WSMP_FUNC in ClpCholeskyWssmp.cpp.
> 
> Then you should add a define for WSMP_FUNC according to the name
> mangling scheme that your Wsmp library uses.
> That is, if you don't have Wsmp, don't try to build ClpCholeskyWssmp.cpp.
> 
>> By now, I’m wondering what I’m might be doing wrong?
> 
> The main supported buildsystem for CoinUtils, Clp, Cbc, etc is the
> autotools-based system, which should work with MS compilers under MSys2
> on Windows, too.
> This buildsystem has been updated in the master branches, that is, the
> current development versions of CoinUtils, Clp, Cbc, etc., recently,
> which also brought some changes to the code itself. This very likely
> broke these MSVS project files. Noone looked into fixing these so far.
> 
> Stefan
> 
>> Thank you for any help.
>>
>> Regards,
>>
>> Jan-Willem
>> (BTW, eliminate root directory was a great move)
>>
>>
>>
>>
>> _______________________________________________
>> Cbc mailing list
>> Cbc at list.coin-or.org
>> https://nam05.safelinks.protection.outlook.com/?url=https%3A%2F%2Flist.coin-or.org%2Fmailman%2Flistinfo%2Fcbc&data=02%7C01%7C%7C252b10ff9ac14410d54208d7a88f9260%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637163206895150171&sdata=YuJN%2FsWhaSfqsyXdqxkpqjd%2FzivvMTKEe5zhkc2r6Yc%3D&reserved=0
>>
> 
> 



More information about the Cbc mailing list