coin-or / Cbc

COIN-OR Branch-and-Cut solver
Other
813 stars 116 forks source link

multithreading windows 10 #264

Closed flacroze closed 5 years ago

flacroze commented 5 years ago

Hello,

I struggle for months with multithreads version of CBC (32 bits) for windows 10.

Has someone succeed to make it ? And can publish the method step by step ?

We followed these instructions found on CBC project, but no result. Has someone tried it with success ?


If you want to build a parallel version of CBC using Visual Studio you can following instructions: (thanks to Tobias Stengel and Alexis Guigue).

Assumptions:

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. Steps (based on VS 2013):

for each of the lib projects do: 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)

Link against a pthreads library. PThreadsWin32 works (even in 64 bits systems) and is distributed under the LGPL. If you decide to use the precompiled binaries: both pthreadVC2 and pthreadVS2 seem to work. Otherwise: third party VS project files for pthreads4win can be found on github.

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.

If 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.

pass "-threads" "yourNumber" to CbcMain1

Thanks

tkralphs commented 5 years ago

If you say what steps you followed and where they failed, it will be easier to help.

flacroze commented 5 years ago

Hello Ted,

As I wrote, we followed all the steps mentionned on the CBC web site :

If you want to build a parallel version of CBC using Visual Studio you can following instructions: (thanks to Tobias Stengel and Alexis Guigue).

Assumptions:

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.

Steps (based on VS 2013):

for each of the lib projects do: 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)

Link against a pthreads library. PThreadsWin32 works (even in 64 bits systems) and is distributed under the LGPL. If you decide to use the precompiled binaries: both pthreadVC2 and pthreadVS2 seem to work. Otherwise: third party VS project files for pthreads4win can be found on github.

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.

If 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.

pass "-threads" "yourNumber" to CbcMain1

Any failure during the compilation, but finally the produced version is MONOthread during Branch & Cut (we understood that during the LP relaxation it is monothread)

Have you ever create a MULTITHREAD version for Windows ? Could you indicate your method ?

Thanks

Frederic

De : Ted Ralphs notifications@github.com Envoyé : lundi 23 septembre 2019 19:32 À : coin-or/Cbc Cbc@noreply.github.com Cc : Frédéric LACROZE frederic.lacroze@digiway.fr; Author author@noreply.github.com Objet : Re: [coin-or/Cbc] multithreading windows 10 (#264)

If you say what steps you followed and where they failed, it will be easier to help.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/coin-or/Cbc/issues/264?email_source=notifications&email_token=ABZPPIS3T3KO27YRGNIZQVTQLD4PLA5CNFSM4IZNQSTKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7LUREY#issuecomment-534202515, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ABZPPIVH5PGHK6HMJYWP3TLQLD4PLANCNFSM4IZNQSTA.

svigerske commented 5 years ago

Building multithreaded Cbc works for me with MinGW and MSVC or Intel compilers. I use this in my config.site:

CC=cl
CXX=cl
enable_msvc=yes
OPT_CXXFLAGS="-O2 -EHsc -GR -MD -DNDEBUG"
OPT_CFLAGS="-O2 -EHsc -GR -MD -DNDEBUG"
OPT_FFLAGS="-O3 -fpp -MD"
ADD_CXXFLAGS="-nologo -wd4274 -D_CRT_SECURE_NO_DEPRECATE -DDISALLOW_PRINTING -DCLP_FAST_CODE -DCOIN_FAST_CODE -DNEW_STYLE_SOLVER=0 -DCBC_QUIET=1 -DCBC_THREAD_SAFE"
ADD_CXXFLAGS="$ADD_CXXFLAGS -DHAVE_PTW32_CONFIG_H"
ADD_CFLAGS="-nologo -wd4274 -D_CRT_SECURE_NO_DEPRECATE"
ADD_FFLAGS="-nologo"

enable_cbc_parallel=yes
with_pthreadsw32_lib=/path/to/pthreads-w32/pthreads.lib
with_pthreadsw32_incdir=/path/to/pthreads-w32

One may not need all of these flags.

flacroze commented 5 years ago

Good News But could explain the followed steps Thanks

Frederic

Le 3 oct. 2019 à 16:25, Stefan Vigerske notifications@github.com a écrit :



Building multithreaded Cbc works for me with MinGW and MSVC or Intel compilers. I use this in my config.site:

CC=cl CXX=cl enable_msvc=yes OPT_CXXFLAGS="-O2 -EHsc -GR -MD -DNDEBUG" OPT_CFLAGS="-O2 -EHsc -GR -MD -DNDEBUG" OPT_FFLAGS="-O3 -fpp -MD" ADD_CXXFLAGS="-nologo -wd4274 -D_CRT_SECURE_NO_DEPRECATE -DDISALLOW_PRINTING -DCLP_FAST_CODE -DCOIN_FAST_CODE -DNEW_STYLE_SOLVER=0 -DCBC_QUIET=1 -DCBC_THREAD_SAFE" ADD_CXXFLAGS="$ADD_CXXFLAGS -DHAVE_PTW32_CONFIG_H" ADD_CFLAGS="-nologo -wd4274 -D_CRT_SECURE_NO_DEPRECATE" ADD_FFLAGS="-nologo"

enable_cbc_parallel=yes with_pthreadsw32_lib=/path/to/pthreads-w32/pthreads.lib with_pthreadsw32_incdir=/path/to/pthreads-w32

One may not need all of these flags.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/coin-or/Cbc/issues/264?email_source=notifications&email_token=ABZPPIWVDZJ23G6YQWC3OTDQMX6DVA5CNFSM4IZNQSTKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEAIMAUI#issuecomment-537968721, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ABZPPIQAILEBZJOOI43TQILQMX6DVANCNFSM4IZNQSTA.

svigerske commented 5 years ago

When using the usual COIN-OR build procedure (before "coinbrew"):

svn co https://projects.coin-or.org/svn/Cbc/stable/2.10 Cbc-2.10
cd Cbc-2.10
mkdir build
cd build
mkdir share
cp /path/to/above/text share/config.site
../configure -C
make
make test
make install

See also https://github.com/coin-or-tools/BuildTools/wiki

If using coinbrew, then maybe pass these as arguments to coinbrew, so they are passed on to configure, as I'm not sure that builds by coinbrew would pick up a /share/config.site at the moment.

tkralphs commented 5 years ago

It should be easy to add the ability to read a config.site file to coinbrew, but in the meantime, in case it was not clear, you can add those flags that @svigerske specified to the coinbrew command line, e.g.,

coinbrew build Cbc CC=cl CXX=cl --enable_msvc ADD_CXXFLAGS="-nologo -wd4274 -D_CRT_SECURE_NO_DEPRECATE -DDISALLOW_PRINTING -DCLP_FAST_CODE -DCOIN_FAST_CODE -DNEW_STYLE_SOLVER=0 -DCBC_QUIET=1 -DCBC_THREAD_SAFE" ...

It's not necessary to set CC and CXX when also setting --enable-msvc, as cl is the default. It's likely that some of the other flags are also not necessary. In general, it's probably best not to set the OPT_* variables, just use the ADD_* variables to add flags as needed. I would try with only those first and see if it works. You probably only need

coinbrew --enable-msvc --enable-cbc-parallel --with-pthreadsw32-lib=/path/to/pthreads-w32/pthreads.lib --with-pthreadsw32-incdir=/path/to/pthreads-w32 ADD_CXXFLAGS=-DCBC_THREAD_SAFE"

I would steer clear of using the old build procedure, as that is deprecated and will not be working for long.

flacroze commented 5 years ago

Hi Ted, Thank you for this instructions.

I have followed the steps Windows Command line I installed Msys2https://msys2.github.io/ [OK]

manually add msys64\usr\bin, msys64\mingw32\bin, and msys64\mingw64\bin to your Windows path). [OK] Once you have bash installed and in your PATH, open a Windows terminal and type bash -> [OK] pacman -S make wget tar patch dos2unix diffutils git svn -> [OK] git clone https://www.github.com/coin-or/coinbrew -> [OK] Next, to check out source code for and build all the necessary projects (including dependencies), execute the script in the COIN-OR-OptimizationSuite subdirectory. [I don’t have this subdirectory…]

To execute the script, do cd coinbrew -> [OK] chmod u+x coinbrew -> [OK] ./coinbrew -> [KO – see further down] But I have a problem : [cid:image001.jpg@01D57EED.C1C5C3D0]

Windows said that coinbrew is not a command ? What’s wrong ?

Thank you for your help

Frederic

De : Ted Ralphs notifications@github.com Envoyé : lundi 7 octobre 2019 22:22 À : coin-or/Cbc Cbc@noreply.github.com Cc : Frédéric LACROZE frederic.lacroze@digiway.fr; Author author@noreply.github.com Objet : Re: [coin-or/Cbc] multithreading windows 10 (#264)

It should be easy to add the ability to read a config.site file to coinbrew, but in the meantime, in case it was not clear, you can add those flags that @svigerskehttps://github.com/svigerske specified to the coinbrew command line, e.g.,

coinbrew build Cbc CC=cl CXX=cl --enable_msvc ADD_CXXFLAGS="-nologo -wd4274 -D_CRT_SECURE_NO_DEPRECATE -DDISALLOW_PRINTING -DCLP_FAST_CODE -DCOIN_FAST_CODE -DNEW_STYLE_SOLVER=0 -DCBC_QUIET=1 -DCBC_THREAD_SAFE" ...

It's not necessary to set CC and CXX when also setting --enable-msvc, as cl is the default. It's likely that some of the other flags are also not necessary. In general, it's probably best not to set the OPT* variables, just use the ADD* variables to add flags as needed. I would try with only those first and see if it works. You probably only need

coinbrew --enable-cbc-parallel --with-pthreadsw32-lib=/path/to/pthreads-w32/pthreads.lib --with-pthreadsw32-incdir=/path/to/pthreads-w32 ADD_CXXFLAGS=-DCBC_THREAD_SAFE"

I would steer clear of using the old build procedure, as that is deprecated and will not be working for long.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/coin-or/Cbc/issues/264?email_source=notifications&email_token=ABZPPIWYA7ZBOA4B3YWIYQ3QNOK7VA5CNFSM4IZNQSTKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEARVURQ#issuecomment-539187782, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ABZPPIQA45VSBLOGIPV2RXDQNOK7VANCNFSM4IZNQSTA.

tkralphs commented 5 years ago

It seems the image containing the error got stripped out. Could you either attach it again or just cut and paste the exact text?

flacroze commented 5 years ago

Hi Ted,

I have followed the steps Windows Command line I installed Msys2https://msys2.github.io/ [OK]

manually add msys64\usr\bin, msys64\mingw32\bin, and msys64\mingw64\bin to your Windows path). [OK] Once you have bash installed and in your PATH, open a Windows terminal and type bash -> [OK] pacman -S make wget tar patch dos2unix diffutils git svn -> [OK] git clone https://www.github.com/coin-or/coinbrew -> [OK] Next, to check out source code for and build all the necessary projects (including dependencies), execute the script in the COIN-OR-OptimizationSuite subdirectory. [I don’t have this subdirectory…]

To execute the script, do cd coinbrew -> [OK] chmod u+x coinbrew -> [OK] ./coinbrew -> [KO – see further down] In the subdirectory coinbrew, I have : 2 subdirectories .ci and .git 2 files .gitignore (285 octets), coinbrew (51 595 octets) When I try to execute coinbrew in the ms-dos command window (./coinbrew or coinbrew), I get a error message : “coinbrew is not a valid command”

What’s wrong ?

Thank you for your help

Frederic

De : Ted Ralphs notifications@github.com Envoyé : jeudi 10 octobre 2019 04:16 À : coin-or/Cbc Cbc@noreply.github.com Cc : Frédéric LACROZE frederic.lacroze@digiway.fr; Author author@noreply.github.com Objet : Re: [coin-or/Cbc] multithreading windows 10 (#264)

It seems the image containing the error got stripped out. Could you either attach it again or just cut and paste the exact text?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/coin-or/Cbc/issues/264?email_source=notifications&email_token=ABZPPIUFT3AO42OTKLYT2S3QN2F57A5CNFSM4IZNQSTKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEA2EZVA#issuecomment-540298452, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABZPPIUTAOHCZVMMDVXL5D3QN2F57ANCNFSM4IZNQSTA.

svigerske commented 5 years ago

You should be in MSys' bash, not the "ms-dos command window".

flacroze commented 5 years ago

Thank you Stephan

I still have an error

/c/Users/frede/coinbrew

##################################################

Configuring ThirdParty/ASL

##################################################

configure: error: no acceptable C compiler found in $PATH See `config.log' for more details.

In my $PATH I have C:\msys64\usr\bin, C:\msys64\mingw32\bin, and C:\msys64\mingw64\bin

Regards Frederic

De : Stefan Vigerske notifications@github.com Envoyé : jeudi 10 octobre 2019 11:23 À : coin-or/Cbc Cbc@noreply.github.com Cc : Frédéric LACROZE frederic.lacroze@digiway.fr; Author author@noreply.github.com Objet : Re: [coin-or/Cbc] multithreading windows 10 (#264)

You should be in MSys' bash, not the "ms-dos command window".

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/coin-or/Cbc/issues/264?email_source=notifications&email_token=ABZPPIURL6SPF7GM7KANJHTQN3X7ZA5CNFSM4IZNQSTKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEA3RPQI#issuecomment-540481473, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABZPPISMJSBFQY52KKF7JHLQN3X7ZANCNFSM4IZNQSTA.

svigerske commented 5 years ago

Looks like you need to make C and C++ compilers available.

flacroze commented 5 years ago

But I do have Msys

[cid:image002.jpg@01D57F65.894EE090]

De : Stefan Vigerske notifications@github.com Envoyé : jeudi 10 octobre 2019 12:19 À : coin-or/Cbc Cbc@noreply.github.com Cc : Frédéric LACROZE frederic.lacroze@digiway.fr; Author author@noreply.github.com Objet : Re: [coin-or/Cbc] multithreading windows 10 (#264)

Looks like you need to make C and C++ compilers available.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/coin-or/Cbc/issues/264?email_source=notifications&email_token=ABZPPIX2H5M5MSQBXT4WLJTQN36SFA5CNFSM4IZNQSTKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEA3WYTA#issuecomment-540503116, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABZPPIQXBWICTFEVQ3DILD3QN36SFANCNFSM4IZNQSTA.

flacroze commented 5 years ago

I see in bash

bash: $PATH /mingw64/bin:/usr/local/bin:/usr/bin:/bin:/c/Windows/System32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0/:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:

How do I modify this variable to add c/msys64/mingw64/bin ?

De : Stefan Vigerske notifications@github.com Envoyé : jeudi 10 octobre 2019 12:19 À : coin-or/Cbc Cbc@noreply.github.com Cc : Frédéric LACROZE frederic.lacroze@digiway.fr; Author author@noreply.github.com Objet : Re: [coin-or/Cbc] multithreading windows 10 (#264)

Looks like you need to make C and C++ compilers available.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/coin-or/Cbc/issues/264?email_source=notifications&email_token=ABZPPIX2H5M5MSQBXT4WLJTQN36SFA5CNFSM4IZNQSTKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEA3WYTA#issuecomment-540503116, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABZPPIQXBWICTFEVQ3DILD3QN36SFANCNFSM4IZNQSTA.

flacroze commented 5 years ago

In the $PATH (from config.log)

PATH: /mingw64/bin PATH: /usr/local/bin PATH: /usr/bin PATH: /bin PATH: /c/Windows/System32 PATH: /c/Windows PATH: /c/Windows/System32/Wbem PATH: /c/Windows/System32/WindowsPowerShell/v1.0/ PATH: /usr/bin/site_perl PATH: /usr/bin/vendor_perl PATH: /usr/bin/core_perl PATH: c/msys64/mingw64/bin PATH: c/msys64/mingw32/bin PATH: c/msys64/usr/bin PATH: /c/msys64/mingw64/bin PATH: /c/msys64/usr/bin PATH: /c/msys64/mingw32/bin

De : Stefan Vigerske notifications@github.com Envoyé : jeudi 10 octobre 2019 12:19 À : coin-or/Cbc Cbc@noreply.github.com Cc : Frédéric LACROZE frederic.lacroze@digiway.fr; Author author@noreply.github.com Objet : Re: [coin-or/Cbc] multithreading windows 10 (#264)

Looks like you need to make C and C++ compilers available.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/coin-or/Cbc/issues/264?email_source=notifications&email_token=ABZPPIX2H5M5MSQBXT4WLJTQN36SFA5CNFSM4IZNQSTKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEA3WYTA#issuecomment-540503116, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABZPPIQXBWICTFEVQ3DILD3QN36SFANCNFSM4IZNQSTA.

tkralphs commented 5 years ago

You may not have the compilers installed. If you do which gcc, what happens? To be sure, you can do

pacman -S mingw-w64-i686-toolchain mingw-w64-x86_64-toolchain

This should install both 32- and 64-bit versions of MinGW.

flacroze commented 5 years ago

Hi

I’m progressing but I still have an error

Package will be installed to dist/

Caching configuration options... Options to be passed to configure: --with-coin-instdir=/c/test/coinbrew/dist Disabling uninstalled packages

##################################################

Configuring ThirdParty/ASL

##################################################

Invalid configuration i686-pc-msys': systemmsys' not recognized configure: error: /bin/sh /c/test/coinbrew/ThirdParty/ASL/config.sub i686-pc-msys failed


I used

pacman -S mingw-w64-i686-toolchain mingw-w64-x86_64-toolchain pacman -Syuu (until everything is up to date, I see that in a post)

Thanks Frederic

De : Ted Ralphs notifications@github.com Envoyé : jeudi 10 octobre 2019 17:48 À : coin-or/Cbc Cbc@noreply.github.com Cc : Frédéric LACROZE frederic.lacroze@digiway.fr; Author author@noreply.github.com Objet : Re: [coin-or/Cbc] multithreading windows 10 (#264)

You may not have the compilers installed. If you do which gcc, what happens? To be sure, you can do

pacman -S mingw-w64-i686-toolchain mingw-w64-x86_64-toolchain

THis should install both 32- and 64-bit versions of MinGW.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/coin-or/Cbc/issues/264?email_source=notifications&email_token=ABZPPIVZWGY3HBRUBTFLQNDQN5FERA5CNFSM4IZNQSTKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEA42U3A#issuecomment-540650092, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABZPPIV4YRWP2L6KBIEHIC3QN5FERANCNFSM4IZNQSTA.

svigerske commented 5 years ago

Try to add --build=x86_64-w64-mingw32 to the call of coinbrew.

flacroze commented 5 years ago

Thanks : It seems better : compilation is beginning … I’ tell you if it’s ok when it will finish

De : Stefan Vigerske notifications@github.com Envoyé : vendredi 11 octobre 2019 17:50 À : coin-or/Cbc Cbc@noreply.github.com Cc : Frédéric LACROZE frederic.lacroze@digiway.fr; Author author@noreply.github.com Objet : Re: [coin-or/Cbc] multithreading windows 10 (#264)

Try to add --build=x86_64-w64-mingw32 to the call of coinbrew.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/coin-or/Cbc/issues/264?email_source=notifications&email_token=ABZPPIQCW2W4CPAJGONCXK3QOCOC5A5CNFSM4IZNQSTKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBANHBQ#issuecomment-541119366, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABZPPIQKTKMZU6T6DGMMPHLQOCOC5ANCNFSM4IZNQSTA.

tkralphs commented 5 years ago

I just updated the documentation at https://coin-or.github.io/user_introduction.html with a lot more details, especially for the Windows case (including adding the trick that Stefan just pointed out). See https://coin-or.github.io/user_introduction.html#windows-1 If you get stuck again.

flacroze commented 5 years ago

Hi Ted

First thank you for this update.

I succeed to compile versions 32 and 64 bits, but the files are quite big (around 10 Mo for both) compare to yours ?

Now, I need more information to make a parallel version.

  1. I downloaded Pthreads : ftp://sourceware.org/pub/pthreads-win32/pthreads-w32-2-9-1-release.zip I don’t find the pthreads.lib

I have lib/x86 : pthreadVC2.lib, pthreadVCE2.lib, pthreadVSE2.lib And lib/x64 : pthreadVC2.lib

Question : is it the good one ?

Thanks,

Fred

De : Ted Ralphs notifications@github.com Envoyé : vendredi 11 octobre 2019 22:07 À : coin-or/Cbc Cbc@noreply.github.com Cc : Frédéric LACROZE frederic.lacroze@digiway.fr; Author author@noreply.github.com Objet : Re: [coin-or/Cbc] multithreading windows 10 (#264)

I just updated the documentation at https://coin-or.github.io/user_introduction.html with a lot more details, especially for the Windows case (including adding the trick that Stefan just pointed out). See https://coin-or.github.io/user_introduction.html#windows-1 If you get stuck again.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/coin-or/Cbc/issues/264?email_source=notifications&email_token=ABZPPISFAXMBXV6AON2NII3QODMGZA5CNFSM4IZNQSTKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBBCOVY#issuecomment-541206359, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABZPPIS76PIX36HRTUP6PNDQODMGZANCNFSM4IZNQSTA.

fl8k commented 2 years ago

I just updated the documentation at https://coin-or.github.io/user_introduction.html with a lot more details, especially for the Windows case (including adding the trick that Stefan just pointed out). See https://coin-or.github.io/user_introduction.html#windows-1 If you get stuck again.

Hi @tkralphs - I followed the instructions you reference, and I get errors while attempting to use the CBC that was built - the errors indicate missing dlls: libbz2-1.dll and libz1.dll

I used Msys2 + coinbrew approach.

fl8k commented 2 years ago

I just updated the documentation at https://coin-or.github.io/user_introduction.html with a lot more details, especially for the Windows case (including adding the trick that Stefan just pointed out). See https://coin-or.github.io/user_introduction.html#windows-1 If you get stuck again.

Hi @tkralphs - I followed the instructions you reference, and I get errors while attempting to use the CBC that was built - the errors indicate missing dlls: libbz2-1.dll and libz1.dll

I used Msys2 + coinbrew approach.

The reason I am trying to build cbc manually is because the version I have hangs for some reason. I see that the thread were changed, but it just stops and doesn't do anything: image

tkralphs commented 2 years ago

What version do you have? What version are you trying to build? With what compiler? I guess you are trying to build master. Can you delete the build directory and re-run the build with --verbosity 4, then attach the output here (as a file, not copy-paste). If possible, you could also attach build/CoinUtils/master/config.log.

fl8k commented 2 years ago

What version do you have? What version are you trying to build? With what compiler? I guess you are trying to build master. Can you delete the build directory and re-run the build with --verbosity 4, then attach the output here (as a file, not copy-paste). If possible, you could also attach build/CoinUtils/master/config.log. cbc_build.log

coinutils_config.log

Yes, I am trying to build the latest version. I have attached the requested files. Here is the build command I used. ./coinbrew build Cbc --build=x86_64-w64-mingw32 --enable-cbc-parallel --verbosity 4 --with-pthreadsw32-lib=/home/<user>/coinbrew/prebuilt-dll-2-9-1-release/lib/x64/pthreadVC2.lib --with-pthreadsw32-incdir=/home/<user>/coinbrew/prebuilt-dll-2-9-1-release/include ADD_CXXFLAGS=-DCBC_THREAD_SAFE

tkralphs commented 2 years ago

OK, sorry, I didn't realize that the build was successful, so the problem is not there. It's probably then just a paths issue. You probably need to add whatever directory those DLLs are in to your Windows PATH variable. On my computer, the directory would be C:\msys64\usr\bin. You would do something like

set PATH=%PATH%;C:\msys64\usr\bin