Re: [Boost-users] Mingw64 Boost Threads Build
Jim, The build worked! It's the first successful MinGW64 build that I have had. This build was performed from within Cygwin using the mingw64 toolset. I am attempting a build with the MinGW build you pointed me to. Thank again! However, when I attempt to compile the archive into my library I get the below error. Isdmain.o:Isdmain.cpp:(.text+0x16c3): undefined reference to `boost::thread::start_thread()' Isdmain.o:Isdmain.cpp:(.text+0x9982): undefined reference to `boost::thread::~thread()' Isdmain.o:Isdmain.cpp:(.text+0x9d1a): undefined reference to `boost::thread::~thread()' Isdmain.o:Isdmain.cpp:(.text+0x9dee): undefined reference to `boost::thread::~thread()' Isdmain.o:Isdmain.cpp:(.text+0x9e65): undefined reference to `boost::thread::~thread()' Isdmain.o:Isdmain.cpp:(.text+0xbbc3): undefined reference to `boost::thread::start_thread()' Isdmain.o:Isdmain.cpp:(.text+0xbc7e): undefined reference to `boost::thread::~thread()' Isdmain.o:Isdmain.cpp:(.text+0xbc96): undefined reference to `boost::thread::~thread()' Isdmain.o:Isdmain.cpp:(.text+0xca96): undefined reference to `boost::thread::~thread()' Isdmain.o:Isdmain.cpp:(.text+0xe23a): undefined reference to `boost::thread::thread()' Isdmain.o:Isdmain.cpp:(.text+0xe252): undefined reference to `boost::thread::thread()' Isdmain.o:Isdmain.cpp:(.text+0x10): undefined reference to `boost::thread::~thread()' Isdmain.o:Isdmain.cpp:(.text+0x30): undefined reference to `boost::thread::~thread()' Isdmain.o:Isdmain.cpp:(.text$_ZN5boost6threadaSENS_6detail13thread_move_tIS0_EE[boost::thread::operator=(boost::detail::thread_move_tboost::thread)]+0x131): undefined reference to `boost::thread::~thread()' I have examined the library symbols and, indeed, I cannot find the appropriate externs. I jumped from 1.35.0 to 1.45.0. I was just wondering if you have any idea why this would start happening? Am I missing something? Any help would be greatly appreciated. Dustin P.S. I will let you know if this changes with the new MinGW64 build. From: Jim Bell [mailto:Jim@JC-Bell.com] Sent: Tuesday, January 04, 2011 12:04 PM To: Dustin T. Clifford Subject: Re: [Boost-users] Mingw64 Boost Threads Build I did run the regression test last night, FYI... http://www.boost.org/development/tests/trunk/developer/thread.html Last column. All tests pass but one. HTH. -Jim On 1/4/2011 10:39 AM, Dustin T. Clifford wrote: Jim, Thank you. I am going to try your patch now. I will let you know how things work out. Thanks again! Dustin From: Jim Bell [mailto:Jim@JC-Bell.com] Sent: Friday, December 31, 2010 10:35 AM To: boost-users@lists.boost.orgmailto:boost-users@lists.boost.org Cc: Dustin T. Clifford Subject: Re: [Boost-users] Mingw64 Boost Threads Build I have a trunk regression-test platform that runs Mingw64 on Win7-64. It's experimental and isn't in the regression matrix right now, but works as well as any MinGW platform (or pretty close). I use GCC 4.6 from here http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Wi...http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Wi.... CygWin's not installed on this machine. I've attached my complete set of patches. A little cryptic (and patches a pretty recent trunk revision), but should give you a set of changes that ought to get you close. You should be able to use the pre-built bjam (32-bit). http://www.boost.org/doc/libs/1_45_0/more/getting_started/windows.html#get-b...http://www.boost.org/doc/libs/1_45_0/more/getting_started/windows.html#get-b... boostrap.bat needs a little hacking for gcc. Good luck! -Jim On 1:59 PM, Dustin T. Clifford wrote: Good Afternoon, We have been using boost-threads for our native APIs and, thus far, Boost has been a godsend! We had a recent request to build a 64-bit version of this API. To accomplish this we have attempted to build using MinGW64. Unfortunately, I have had zero luck getting boost-threads to build. I can build the 32-bit address model without a problem but 64-bit continues to elude me. I first tried Boost 1.35.0 and have now moved on to 1.45.0. I believe that the environment is set up correctly (see below). This build is being performed on a Windows 7 64-bit using MinGW64 from Cygwin. export CC=x86_64-w64-mingw32-gcc.exe export CXX=x86_64-w64-mingw32-g++.exe export LD=x86_64-w64-mingw32-ld.exe I have, also, modified my PATH to use the appropriate 64-bit bintools and aliased gcc, g++ and ld to the 64-bit MinGW64 compilers and linkers. To build Boost I have used the following with no success. boostrap.sh address-model=64 -prefix=<install> --with-libraries=thread; bjam -a install; boostrap.sh -prefix=<install> --with-libraries=thread; bjam -a address-model=64 install; boostrap.sh -prefix=<install> --with-libraries=thread; bjam -a install; The last build attempt succeeds but appears to have built 32-bit binaries. The previous two fail in building boost-threads complaining that 'address-model-64' is not found for certain build artifacts. I have, also, tried the above with a prebuilt bjam with the same results. I have tried much more than what I have cited here (including MSVC builds) with no success (some built but resulted in 32-bit binaries). I have scoured Google and found many talking about this but most either had no resolution or contained instructions that conflicted or made no sense. Does anybody have any insight into how I can produce a 64-bit boost-threads archive? Any help would be greatly appreciated. Thanks in advance, Dustin P.S. If I have missed any information or you need more (build logs are too big to attach), please, let me know.
On 1:59 PM, Dustin T. Clifford wrote:
Jim,
The build worked! It's the first successful MinGW64 build that I have had. This build was performed from within Cygwin using the mingw64 toolset. I am attempting a build with the MinGW build you pointed me to. Thank again!
Glad to hear it!
However, when I attempt to compile the archive into my library I get the below error.
Isdmain.o:Isdmain.cpp:(.text+0x16c3): undefined reference to `boost::thread::start_thread()'
[...]
Isdmain.o:Isdmain.cpp:(.text+0x9e65): undefined reference to `boost::thread::~thread()'
[...]
Isdmain.o:Isdmain.cpp:(.text+0xe23a): undefined reference to `boost::thread::thread()'
[...]
Isdmain.o:Isdmain.cpp:(.text$_ZN5boost6threadaSENS_6detail13thread_move_tIS0_EE[boost::thread::operator=(boost::detail::thread_move_tboost::thread)]+0x131): undefined reference to `boost::thread::~thread()'
Assuming your linker command-line is right ... can you tell if any references are defined? Are you compiling with the BOOST_THREAD_USE_DLL or BOOST_THREAD_USE_LIB flags? They're not well-documented but necessary https://svn.boost.org/trac/boost/ticket/4921. As a point of reference, the regression tests are linking correctly.
I have examined the library symbols and, indeed, I cannot find the appropriate externs. I jumped from 1.35.0 to 1.45.0. I was just wondering if you have any idea why this would start happening? Am I missing something? Any help would be greatly appreciated.
[...]
I did run the regression test last night, FYI...
http://www.boost.org/development/tests/trunk/developer/thread.html
Last column. All tests pass but one.
HTH. -Jim
Jim, I am compiling with BOOST_THREAD_USE_LIB. I am not linking with it though. The CPP should only need it on compile, right? I see that the regressions look good other than that one test. I have tried both the MSVC build and your patched build and I get this same set of errors. Are you aware of anything that changed between 1.35 and 1.45 that would cause these symbols to have changed (I doubt it but it's worth asking)? I've looked but the usage pertinent to our code seems to be the same as 1.35.0. Dustin From: Jim Bell [mailto:Jim@JC-Bell.com] Sent: Tuesday, January 04, 2011 3:37 PM To: boost-users@lists.boost.org Cc: Dustin T. Clifford Subject: Re: Re: [Boost-users] Mingw64 Boost Threads Build On 1:59 PM, Dustin T. Clifford wrote: Jim, The build worked! It's the first successful MinGW64 build that I have had. This build was performed from within Cygwin using the mingw64 toolset. I am attempting a build with the MinGW build you pointed me to. Thank again! Glad to hear it! However, when I attempt to compile the archive into my library I get the below error. Isdmain.o:Isdmain.cpp:(.text+0x16c3): undefined reference to `boost::thread::start_thread()' [...] Isdmain.o:Isdmain.cpp:(.text+0x9e65): undefined reference to `boost::thread::~thread()' [...] Isdmain.o:Isdmain.cpp:(.text+0xe23a): undefined reference to `boost::thread::thread()' [...] Isdmain.o:Isdmain.cpp:(.text$_ZN5boost6threadaSENS_6detail13thread_move_tIS0_EE[boost::thread::operator=(boost::detail::thread_move_tboost::thread)]+0x131): undefined reference to `boost::thread::~thread()' Assuming your linker command-line is right ... can you tell if any references are defined? Are you compiling with the BOOST_THREAD_USE_DLL or BOOST_THREAD_USE_LIB flags? They're not well-documented but necessary https://svn.boost.org/trac/boost/ticket/4921https://svn.boost.org/trac/boost/ticket/4921. As a point of reference, the regression tests are linking correctly. I have examined the library symbols and, indeed, I cannot find the appropriate externs. I jumped from 1.35.0 to 1.45.0. I was just wondering if you have any idea why this would start happening? Am I missing something? Any help would be greatly appreciated. [...] I did run the regression test last night, FYI... http://www.boost.org/development/tests/trunk/developer/thread.html Last column. All tests pass but one. HTH. -Jim
On 1/4/2011 3:18 PM, Dustin T. Clifford wrote:
Jim,
I am compiling with BOOST_THREAD_USE_LIB. I am not linking with it though. The CPP should only need it on compile, right?
Yes.
I see that the regressions look good other than that one test. I have tried both the MSVC build and your patched build and I get this same set of errors.
Are you aware of anything that changed between 1.35 and 1.45 that would cause these symbols to have changed (I doubt it but it's worth asking)? I've looked but the usage pertinent to our code seems to be the same as 1.35.0.
Worth asking, but not that I know of. Here are the working command-lines from the regression test's bjam.log, building & linking test_thread_lib, which passes: "g++" -ftemplate-depth-128 -O0 -fno-inline -Wall -g -mthreads -DBOOST_ALL_NO_LIB=1 -DBOOST_TEST_NO_AUTO_LINK=1 -DBOOST_THREAD_USE_LIB=1 -I".." -c -o "C:\Users\Jim\boost_rt\trunk\results\boost\bin.v2\libs\thread\test\test_thread_lib.test\gcc-mingw-4.6.0\debug\threading-multi\test_thread.o" "..\libs\thread\test\test_thread.cpp" "g++" -ftemplate-depth-128 -O0 -fno-inline -Wall -g -mthreads -DBOOST_ALL_NO_LIB=1 -DBOOST_TEST_NO_AUTO_LINK=1 -DBOOST_THREAD_USE_LIB=1 -I".." -c -o "C:\Users\Jim\boost_rt\trunk\results\boost\bin.v2\libs\thread\test\test_thread_lib.test\gcc-mingw-4.6.0\debug\threading-multi\tss_null.o" "..\libs\thread\test\..\src\tss_null.cpp" "g++" -o "C:\Users\Jim\boost_rt\trunk\results\boost\bin.v2\libs\thread\test\test_thread_lib.test\gcc-mingw-4.6.0\debug\threading-multi\test_thread_lib.exe" -Wl,--start-group "C:\Users\Jim\boost_rt\trunk\results\boost\bin.v2\libs\thread\test\test_thread_lib.test\gcc-mingw-4.6.0\debug\threading-multi\test_thread.o" "C:\Users\Jim\boost_rt\trunk\results\boost\bin.v2\libs\thread\test\test_thread_lib.test\gcc-mingw-4.6.0\debug\threading-multi\tss_null.o" "C:\Users\Jim\boost_rt\trunk\results\boost\bin.v2\libs\test\build\gcc-mingw-4.6.0\debug\link-static\threading-multi\libboost_unit_test_framework-mgw46-mt-d-1_46.a" "C:\Users\Jim\boost_rt\trunk\results\boost\bin.v2\libs\thread\build\gcc-mingw-4.6.0\debug\link-static\threading-multi\libboost_thread-mgw46-mt-d-1_46.a" -Wl,-Bstatic -Wl,-Bdynamic -Wl,--end-group -g -mthreads (Not sure why it brings in tss_null...)
participants (2)
-
Dustin T. Clifford
-
Jim Bell