
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.

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 don't think this environment variables have any effect on Boost.Build.
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.
Sadly, I don't quite understand what emits the above error message, and I'm not sure this is 100% verbatim error message either.
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)
MSVC is surely the easiest. Just type: bjam --with-thread address-model=64 toolset=msvc install If you have one version of MSVC and it's installed in default paths, this should work without any configuration. For mingw, the right command line would be bjam --with-thread address-model=64 toolset=gcc install However, you would have to setup user-config.jam to point to the right gcc (mingw one, not cygwin one, at in the right location). See: http://www.boost.org/boost-build2/doc/html/bbv2/overview/configuration.html http://www.boost.org/boost-build2/doc/html/bbv2/reference/tools.html#bbv2.re... - Volodya

Volodya, Thank you for your response. You are correct in that the cited error was not verbatim. I tried to attach the build log but, unfortunately, it was too large for the thread. I have updated 'user-config.jam' in 'build/v2/'. Below is the gcc definition: using gcc : 3.2 : x86_64-w64-mingw32-g++ I have run the build using './bjam.exe -a address-model=64 --prefix=<output dir> --with-thread install'. Unfortunately, I get a casting error (see below). gcc.compile.c++ bin.v2\libs\thread\build\gcc-mingw-3.2\debug\address-model-64\link-static\threading-multi\win32\thread.o In file included from ./boost/thread/win32/basic_timed_mutex.hpp:14:0, from ./boost/thread/win32/mutex.hpp:8, from ./boost/thread/mutex.hpp:14, from ./boost/thread/detail/thread.hpp:13, from ./boost/thread/thread.hpp:22, from libs\thread\src\win32\thread.cpp:10: ./boost/thread/win32/interlocked_read.hpp: In function ‘void boost::detail::interlocked_write_release(void* volatile*, void*)’: ./boost/thread/win32/interlocked_read.hpp:71:13: error: cast from ‘void*’ to ‘long int’ loses precision In file included from ./boost/thread/win32/mutex.hpp:8:0, from ./boost/thread/mutex.hpp:14, from ./boost/thread/detail/thread.hpp:13, from ./boost/thread/thread.hpp:22, from libs\thread\src\win32\thread.cpp:10: ./boost/thread/win32/basic_timed_mutex.hpp: In member function ‘void* boost::detail::basic_timed_mutex::get_event()’: ./boost/thread/win32/basic_timed_mutex.hpp:183:43: error: cast from ‘void*’ to ‘long int’ loses precision In file included from ./boost/thread/once.hpp:14:0, from libs\thread\src\win32\thread.cpp:17: ./boost/thread/win32/once.hpp: In function ‘void boost::call_once(boost::once_flag&, Function)’: ./boost/thread/win32/once.hpp:136:20: error: ‘_InterlockedCompareExchange’ is not a member of ‘boost::detail’ ./boost/thread/win32/once.hpp:152:25: error: ‘_InterlockedIncrement’ is not a member of ‘boost::detail’ ./boost/thread/win32/once.hpp:155:21: error: ‘_InterlockedExchange’ is not a member of ‘boost::detail’ ./boost/thread/win32/once.hpp:169:21: error: ‘_InterlockedExchange’ is not a member of ‘boost::detail’ ./boost/thread/win32/once.hpp:184:17: error: ‘_InterlockedIncrement’ is not a member of ‘boost::detail’ "x86_64-w64-mingw32-g++" -ftemplate-depth-128 -O0 -fno-inline -Wall -g -mthreads -m64 -Wno-long-long -DBOOST_ALL_NO_LIB=1 -DBOOST_THREAD_BUILD_LIB=1 -I"." -c -o "bin.v2\libs\thread\build\gcc-mingw-3.2\debug\address-model-64\link-static\threading-multi\win32\thread.o" "libs\thread\src\win32\thread.cpp" ...failed gcc.compile.c++ bin.v2\libs\thread\build\gcc-mingw-3.2\debug\address-model-64\link-static\threading-multi\win32\thread.o... ...skipped <pbin.v2\libs\thread\build\gcc-mingw-3.2\debug\address-model-64\link-static\threading-multi>libboost_thread-mgw32-mt-d-1_45.a(clean) for lack of <pbin.v2\libs\thread\build\gcc-mingw-3.2\debug\address-model-64\link-static\threading-multi>win32\thread.o... ...skipped <pbin.v2\libs\thread\build\gcc-mingw-3.2\debug\address-model-64\link-static\threading-multi>libboost_thread-mgw32-mt-d-1_45.a for lack of <pbin.v2\libs\thread\build\gcc-mingw-3.2\debug\address-model-64\link-static\threading-multi>win32\thread.o... ...skipped <p\cygdrive\c\Users\cliffodt\tmp\boost-1.45.0\lib>libboost_thread-mgw32-mt-d-1_45.a for lack of <pbin.v2\libs\thread\build\gcc-mingw-3.2\debug\address-model-64\link-static\threading-multi>libboost_thread-mgw32-mt-d-1_45.a... ...failed updating 2 targets... ...skipped 6 targets... I have an MSVC build of boost but when I perform a build against this using our GCC build I get the errors below. I do not get these errors with other libraries build with MinGW64. Do you have any insight into this? I’m wondering if it’s a mangling issue. 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_t<boost::thread>)]+0x131): undefined reference to `boost::thread::~thread()' I received a patch this weekend that is said to allow for building boost under MinGW. I am going to try this and see what I get. Thanks for all your help and I would greatly appreciate any more input you may have. Dustin -----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of Vladimir Prus Sent: Friday, December 31, 2010 1:34 AM To: boost-users@lists.boost.org Subject: Re: [Boost-users] Mingw64 Boost Threads Build 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 don't think this environment variables have any effect on Boost.Build.
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.
Sadly, I don't quite understand what emits the above error message, and I'm not sure this is 100% verbatim error message either.
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)
MSVC is surely the easiest. Just type: bjam --with-thread address-model=64 toolset=msvc install If you have one version of MSVC and it's installed in default paths, this should work without any configuration. For mingw, the right command line would be bjam --with-thread address-model=64 toolset=gcc install However, you would have to setup user-config.jam to point to the right gcc (mingw one, not cygwin one, at in the right location). See: http://www.boost.org/boost-build2/doc/html/bbv2/overview/configuration.html http://www.boost.org/boost-build2/doc/html/bbv2/reference/tools.html#bbv2.re... - Volodya _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users

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%20Win64/Personal%20Builds/rubenvb/>. 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-bjam> 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.

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.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%20Win64/Personal%20Builds/rubenvb/><http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/rubenvb/>. 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-bjam><http://www.boost.org/doc/libs/1_45_0/more/getting_started/windows.html#get-bjam> 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.
participants (3)
-
Dustin T. Clifford
-
Jim Bell
-
Vladimir Prus