Changes between Version 82 and Version 83 of WikiStart


Ignore:
Timestamp:
Sep 30, 2016 2:02:41 PM (2 years ago)
Author:
unxusr
Comment:

info on building parallel CBC in Visual Studio

Legend:

Unmodified
Added
Removed
Modified
  • WikiStart

    v82 v83  
    8181
    8282It is also possible to build Cbc with the Visual Studio compiler from the command line using the procedure for Unix-like environments, using the Msys2 shell or CYGWIN. This is the recommended and best-supported way of building Cbc in Windows from source.
     83
     84If you want to build a '''parallel version''' of CBC using Visual Studio you can following instructions: (thanks to Tobias Stengel and Alexis Guigue).
     85
     86Assumptions:
     87
     88- A VS solution with all necessary projects (libCbc, libClp, libCbcSolver, libCgl, libCoinUtils, libOsi, libOsiCbc, libOsiClp). The project files can be found inside the "MSVisualStudio" folders.
     89
     90Steps (based on VS 2013):
     91
     921. for each of the lib* projects do:
     93
     94   add "CBC_THREAD" under Properties -> Configuration Properties -> C/C++ -> Preprocessor -> Preprocessor Definitions (a subset of the lib* projects may be sufficient, but it doesn't hurt to do it for all)
     95
     962. Link against a pthreads library. [https://www.sourceware.org/pthreads-win32/ PThreadsWin32]  works (even in 64 bits systems) and is distributed under the LGPL. If you decide to use the precompiled binaries: both pthreadVC2.^[#noteVS note]^ and pthreadVS2.^[#noteVS note]^ seem to work. Otherwise: third party VS project files for pthreads4win can be found on github.
     97
     98[=#noteVS Note:]  if you use C++/Cli, make sure that no callback (eventHandlers, custom cut generators, custom heuristics, ...) contains managed code. Otherwise your code will crash at runtime with AssembyNotFoundExceptions inside the native threads created by Cbc. Even if not, problems with the GC are likely.
     99
     1003. Iff you link statically against pthreads4win, you have to define PTW32_STATIC_LIB when building your program/Cbc (e.g. via Properties -> C/C++/Preprocessor ->  Preprocessor Definitions) AND - only if you build pthreads yourself - when building pthreads. Linking pthreads dynamically works without additional preprocessor definitions.
     101
     1024. pass "-threads" "yourNumber" to CbcMain1
    83103
    84104== Documentation ==