Boost Mingw w64 compilation issues and fixes
Hi, I've been working on getting Boost to compile properly with Mingw w64 on Windows x64 (specifically, Mingw w64 with GCC 4.8.1 rev 2/Windows threads, http://sourceforge.net/projects/mingwbuilds/files/host- windows/releases/4.8.1/64-bit/threads-win32/seh/). Link to trac bug reports/patches: Boost config/Boost thread: https://svn.boost.org/trac/boost/ticket/8817 I believe this fix works with all target platforms, though I can't test with Windows CE to verify that it works. At least works with VS2012 and Mingw w64. Boost Python: https://svn.boost.org/trac/boost/ticket/8818 This fix again works with VS2012 and Mingw w64. It moves an #undef hypot directive (which python.h unfortunately uses) to be used any time python.h decides it needs to define it. I don't know if any platforms/compilers rely on having hypot being defined as a macro. Doesn't link for me because I think the official Windows Python release is built with VS, I'll need to find/build Python with Mingw w64 to see if it works. Boost Log: https://svn.boost.org/trac/boost/ticket/8819 (apparently has already been reported as https://svn.boost.org/trac/boost/ticket/8786) Boost Math: TBD There is some compile error with Boost Math which is causing my compiler to crash. I don't know if this is on the Boost Math side, or is a bug with Mingw w64. I'll submit a bug report and possibly a patch when I have a bit more time to dig into the issue. I think these are the main outstanding issues with getting Boost to compile with Mingw w64 on x64 Windows. I was able to get everything else to compile smoothly with Mingw w64 and VS2012 (targeting x64).
-----Original Message----- From: Boost [mailto:boost-bounces@lists.boost.org] On Behalf Of Andrew Ho Sent: Sunday, July 14, 2013 12:32 AM To: boost@lists.boost.org Subject: [boost] Boost Mingw w64 compilation issues and fixes
Hi, I've been working on getting Boost to compile properly with Mingw w64 on Windows x64 (specifically, Mingw w64 with GCC 4.8.1 rev 2/Windows threads, http://sourceforge.net/projects/mingwbuilds/files/host- windows/releases/4.8.1/64-bit/threads-win32/seh/).
Boost Math: TBD There is some compile error with Boost Math which is causing my compiler to crash. I don't know if this is on the Boost Math side, or is a bug with Mingw w64. I'll submit a bug report and possibly a patch when I have a bit more time to dig into the issue.
There are lots of worked examples in the Boost.Math /libs/math/examples folder. Many are very simple and should provide a good sanity test. You should also be able to run both the examples and the tests using the jamfile.v2 in /example (and also for a full workout in /test). To do this open a command window in the /example folder and run b2.exe preferably sending a log file. $ b2 > math_examples.log Please report your findings. Paul --- Paul A. Bristow, Prizet Farmhouse, Kendal LA8 8AB UK +44 1539 561830 07714330204 pbristow@hetp.u-net.com
There are lots of worked examples in the Boost.Math /libs/math/examples folder. Many are very simple and should provide a good sanity test.
You should also be able to run both the examples and the tests using the jamfile.v2 in /example (and also for a full workout in /test).
To do this open a command window in the /example folder and run b2.exe
preferably sending a log
file.
$ b2 > math_examples.log
Please report your findings.
I was able to compile Math examples without any problem. I tried compiling Boost Math and math tests and in both cases cc1plus.exe stops working (no useful information why it crashed). Compilation command: b2 install --with-math -a -q toolset=gcc-4.8.1 address-model=64 variant=debug,release threading=multi link=shared,static cxxflags=-std=c++11 I think this might actually be related to this: http://stackoverflow.com/questions/6811240/cc1plus-exe-has-stopped-working- while-compiling-boost-spirit-code However, I don't know if it is because there is no useful information in the log output (I snipped out just one log entry, but there are tons of them): gcc.compile.c++ ..\build\boost\bin.v2\libs\math\build\gcc-mingw- 4.8.1\debug\address-model-64\threading-multi\assoc_laguerre.o "g++" -ftemplate-depth-128 -O0 -fno-inline -Wall -g -mthreads -m64 - fvisibility=hidden -std=c++11 -Winvalid-pch -DBOOST_ALL_NO_LIB=1 - DBOOST_BUILD_PCH_ENABLED -DBOOST_MATH_TR1_DYN_LINK=1 - I"..\build\boost\bin.v2\libs\math\build\gcc-mingw-4.8.1\debug\address-model- 64\threading-multi\..\src\tr1" -I"." -I"libs\math\src\tr1" -c -o "..\build\boost\bin.v2\libs\math\build\gcc-mingw-4.8.1\debug\address-model- 64\threading-multi\assoc_laguerre.o" "libs\math\build\..\src\tr1\assoc_laguerre.cpp" ...failed gcc.compile.c++ ..\build\boost\bin.v2\libs\math\build\gcc-mingw- 4.8.1\debug\address-model-64\threading-multi\assoc_laguerre.o...
-----Original Message----- From: Boost [mailto:boost-bounces@lists.boost.org] On Behalf Of Andrew Ho Sent: Monday, July 15, 2013 3:18 AM To: boost@lists.boost.org Subject: Re: [boost] Boost Mingw w64 compilation issues and fixes
<snip>
Please report your findings.
I was able to compile Math examples without any problem.
I tried compiling Boost Math and math tests and in both cases cc1plus.exe stops working (no useful information why it crashed).
Compilation command:
b2 install --with-math -a -q toolset=gcc-4.8.1 address-model=64 variant=debug,release
:-) threading=multi
link=shared,static cxxflags=-std=c++11
I think this might actually be related to this: http://stackoverflow.com/questions/6811240/cc1plus-exe-has-stopped-working- while-compiling-boost-spirit-code
However, I don't know if it is because there is no useful information in the log output (I snipped out just one log entry, but there are tons of them):
gcc.compile.c++ ..\build\boost\bin.v2\libs\math\build\gcc-mingw- 4.8.1\debug\address-model-64\threading-multi\assoc_laguerre.o
"g++" -ftemplate-depth-128 -O0 -fno-inline -Wall -g -mthreads -m64 - fvisibility=hidden -std=c++11 - Winvalid-pch -DBOOST_ALL_NO_LIB=1 - DBOOST_BUILD_PCH_ENABLED - DBOOST_MATH_TR1_DYN_LINK=1 - I"..\build\boost\bin.v2\libs\math\build\gcc-mingw-4.8.1\debug\address-model- 64\threading-multi\..\src\tr1" -I"." -I"libs\math\src\tr1" -c -o "..\build\boost\bin.v2\libs\math\build\gcc-mingw-4.8.1\debug\address-model- 64\threading-multi\assoc_laguerre.o" "libs\math\build\..\src\tr1\assoc_laguerre.cpp"
...failed gcc.compile.c++ ..\build\boost\bin.v2\libs\math\build\gcc-mingw- 4.8.1\debug\address-model-64\threading-multi\assoc_laguerre.o...
This doesn't sound a problem with the Boost.Math code but I have no idea from this what the problem is. I trust you have read the Boost.Math section "If and How to Build a Boost.Math Library, and its Examples and Tests" It's most unusual to want/need to build a library - Boost.Math is most efficiently used as header-only. However the tests should run, and the test suite at http://www.boost.org/development/tests/trunk/developer/math.html and specifically the test using 4.8 MinGW-w64-4.8 jc-bell.com Boost Regression Test, Windows 7 x64, MinGW-w64, gcc 4.8 are showing mostly green. However it is showing a few unexpected failures (compared to previous gcc versions), for example: Test output: MinGW-w64-4.8 jc-bell.com - math - test_remez / gcc-mingw-4.8.0 Rev 84971 / Sun, 07 Jul 2013 14:27:48 +0000 Compile [2013-07-08 00:15:42 UTC]: fail "g++" -ftemplate-depth-128 -O0 -fno-inline -Wall -g -Winvalid-pch -DBOOST_ALL_NO_LIB=1 -DBOOST_BUILD_PCH_ENABLED -DBOOST_TEST_NO_AUTO_LINK=1 -DBOOST_UBLAS_UNSUPPORTED_COMPILER=0 -I"F:\boost\GCC\trunk\results\boost\bin.v2\libs\math\test\gcc-mingw-4.8.0\debug\link-static" -I".." -I"..\libs\math\test" -c -o "F:\boost\GCC\trunk\results\boost\bin.v2\libs\math\test\test_remez.test\gcc-mingw-4.8.0\debug\link-s tatic\test_remez.o" "..\libs\math\test\test_remez.cpp" which is another similarly unhelpful message (as are the others). So, to me, this looks like a compiler problem. (And your StackOverflow link above also suggests the same). Please report if you make any sense of/fix this. HTH Paul --- Paul A. Bristow, Prizet Farmhouse, Kendal LA8 8AB UK +44 1539 561830 07714330204 pbristow@hetp.u-net.com
I trust you have read the Boost.Math section
"If and How to Build a Boost.Math Library, and its Examples and Tests"
It's most unusual to want/need to build a library - Boost.Math is most
efficiently used as
header-only.
I'm trying to run an "as basic" build as possible, which includes building boost math as a library. There are a few other libraries which similarly have "optional" build libraries, I don't know how many of them by default are built (I believe MPI is the main library which isn't built by default).
However the tests should run, and the test suite at
http://www.boost.org/development/tests/trunk/developer/math.html
and specifically the test using 4.8
MinGW-w64-4.8 jc-bell.com
Boost Regression Test, Windows 7 x64, MinGW-w64, gcc 4.8
are showing mostly green.
mostly != all :P I haven't tried running the tests without the -j flag yet (stop on first error), so i don't know how many tests failed, and it's possible that multiple compile errors/crashes could be present in a single test. I don't have some "automatic terminate compiler on crash" script, so every compile error means I have to click the mouse (which is more than I want to). The test log suggests there's some script for running tests with an error timeout, I'll try to see if I can get that working so I can get the full report.
However it is showing a few unexpected failures (compared to previous gcc versions), for example:
Test output: MinGW-w64-4.8 jc-bell.com - math - test_remez / gcc-mingw- 4.8.0 Rev 84971 / Sun, 07 Jul 2013 14:27:48 +0000 Compile [2013-07-08 00:15:42 UTC]: fail
"g++" -ftemplate-depth-128 -O0 -fno-inline -Wall -g -Winvalid-pch - DBOOST_ALL_NO_LIB=1 -DBOOST_BUILD_PCH_ENABLED -DBOOST_TEST_NO_AUTO_LINK=1 -DBOOST_UBLAS_UNSUPPORTED_COMPILER=0 -I"F:\boost\GCC\trunk\results\boost\bin.v2\libs\math\test\gcc-mingw- 4.8.0\debug\link-static" -I".." -I"..\libs\math\test" -c -o
"F:\boost\GCC\trunk\results\boost\bin.v2\libs\math\test\test_remez.test\gcc- mingw-4.8.0\debug\link-s
tatic\test_remez.o" "..\libs\math\test\test_remez.cpp"
which is another similarly unhelpful message (as are the others).
So, to me, this looks like a compiler problem.
(And your StackOverflow link above also suggests the same).
Please report if you make any sense of/fix this.
I concur, it does appear to be a compiler problem.
I was able to compile Math examples without any problem.
I tried compiling Boost Math and math tests and in both cases cc1plus.exe stops working (no useful information why it crashed).
I tried the 32-bit mingw gcc-4.8.1 and that built fine. What happens if you try: b2 --with-math pch=off John.
-----Original Message----- From: Boost [mailto:boost-bounces@lists.boost.org] On Behalf Of Andrew Ho Sent: Monday, July 15, 2013 11:01 PM To: boost@lists.boost.org Subject: Re: [boost] Boost Mingw w64 compilation issues and fixes
What happens if you try:
b2 --with-math pch=off
Interestingly, I was able to compile the library with pch=off.
This agrees with the conclusions of this thread? http://sourceforge.net/mailarchive/message.php?msg_id=30821409 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56926 It would seem that a new compiler build is needed to increase stack size - and they are 'on the case'. So the workaround is a bit "Doctor, Doctor it hurts when I use PCH" - "don't use PCH". I'd also observe that building the Boost.Math library is not necessary for most users, so adding --without-math should also allow the build of the other libraries to continue. HTH Paul --- Paul A. Bristow, Prizet Farmhouse, Kendal LA8 8AB UK +44 1539 561830 07714330204 pbristow@hetp.u-net.com
I'd also observe that building the Boost.Math library is not necessary for
most users, so adding
--without-math
should also allow the build of the other libraries to continue.
True, even more so as time goes on. Do we want to change the default compilation to build --without-math, and/or bind directly to compiler libraries when available?
-----Original Message----- From: Boost [mailto:boost-bounces@lists.boost.org] On Behalf Of Andrew Ho Sent: Friday, July 19, 2013 7:42 AM To: boost@lists.boost.org Subject: Re: [boost] Boost Mingw w64 compilation issues and fixes
I'd also observe that building the Boost.Math library is not necessary for most users, so adding
--without-math
should also allow the build of the other libraries to continue.
True, even more so as time goes on. Do we want to change the default compilation to build --without- math, and/or bind directly to compiler libraries when available?
Probably - I'd like to see the 'Getting Started' default instructions describe a small set of the libraries that *must* be built and linked, and then a collection of command lines for other popular (and esoteric) combinations. But probably we should wait for GIT modularization when lots of things will be changed? Paul --- Paul A. Bristow, Prizet Farmhouse, Kendal LA8 8AB UK +44 1539 561830 07714330204 pbristow@hetp.u-net.com
participants (3)
-
Andrew Ho
-
John Maddock
-
Paul A. Bristow