Trying to compile and use boost on proprietary complier similar to MPICH2 CXX
Hi all, hope this is the right list for my question. So here it goes: When it try to use boost using a proprietary MPIC++ compiler I have no control over, I get the following errors: In file included from ../boost_1_43_0/boost/thread/detail/platform.hpp:17, from ../boost_1_43_0/boost/thread/thread.hpp:12, from ../boost_1_43_0/boost/thread.hpp:13, from test.cpp:37: ../boost_1_43_0/boost/config/requires_threads.hpp:47:5: error: #error "Compiler threading support is not turned on. Please set the correct command line options for threading: -pthread (Linux), -pthreads (Solaris) or -mthreads (Mingw32)" In file included from ../boost_1_43_0/boost/thread/thread.hpp:12, from ../boost_1_43_0/boost/thread.hpp:13, from test.cpp:37: ../boost_1_43_0/boost/thread/detail/platform.hpp:67:9: error: #error "Sorry, no boost threads are available for this platform." In file included from ../boost_1_43_0/boost/thread.hpp:13, from test.cpp:37: ../boost_1_43_0/boost/thread/thread.hpp:19:2: error: #error "Boost threads unavailable on this platform" The thing is, when I use the standard mpicxx from MPICH2, things work out fine. I'm now trying to find out if the problem lies in the complier, or if I simply did not compile and bootstrap boost properly. What I did when building boost is the following: ./bootstrap.sh --with-libraries=date_time,filesystem,serialization,iostreams,system,thread,mpi ./bjam cxxflags="-O2" release threading=multi link=static After bootstrap, I tried to manually edit the user-config.jam to add "using mpi ;" and explicitly added the path to the compiler, but this all did not change the above mentioned error when I try to compile my code that uses boost. Is this enough information for you to judge if I might have overlooked something when building boost? Many thanks, Chris
Hello Chris,
On Wed, Aug 29, 2012 at 10:44 AM, Chris
When it try to use boost using a proprietary MPIC++ compiler I have no control over, I get the following errors:
In file included from ../boost_1_43_0/boost/thread/detail/platform.hpp:17, from ../boost_1_43_0/boost/thread/thread.hpp:12, from ../boost_1_43_0/boost/thread.hpp:13, from test.cpp:37: ../boost_1_43_0/boost/config/requires_threads.hpp:47:5: error: #error "Compiler threading support is not turned on. Please set the correct command line options for threading: -pthread (Linux), -pthreads (Solaris) or -mthreads (Mingw32)"
This suggests that your compiler is not running with threads enabled, whereas you instructed `bjam` to compile the threaded version of Boost:
./bjam cxxflags="-O2" release threading=multi link=static
Try to compile with threading=single; if that works, you might want to check your compiler's docs on how to enable threading support. Cheers, Riccardo
On 08/31/2012 11:53 AM, Riccardo Murri wrote:
Hello Chris,
On Wed, Aug 29, 2012 at 10:44 AM, Chris
wrote: When it try to use boost using a proprietary MPIC++ compiler I have no control over, I get the following errors:
In file included from ../boost_1_43_0/boost/thread/detail/platform.hpp:17, from ../boost_1_43_0/boost/thread/thread.hpp:12, from ../boost_1_43_0/boost/thread.hpp:13, from test.cpp:37: ../boost_1_43_0/boost/config/requires_threads.hpp:47:5: error: #error "Compiler threading support is not turned on. Please set the correct command line options for threading: -pthread (Linux), -pthreads (Solaris) or -mthreads (Mingw32)"
This suggests that your compiler is not running with threads enabled, whereas you instructed `bjam` to compile the threaded version of Boost:
./bjam cxxflags="-O2" release threading=multi link=static
Try to compile with threading=single; if that works, you might want to check your compiler's docs on how to enable threading support.
Thanks Riccardo! I've tried that now, also together with things like omitting -pthreads or -lpthreads options for this compiler, but to no avail: the error message from Boost remains the same. Best, Chris
On Wed, Aug 29, 2012 at 10:44 AM, Chris
wrote: When it try to use boost using a proprietary MPIC++ compiler I have no control over, I get the following errors:
In file included from ../boost_1_43_0/boost/thread/detail/platform.hpp:17, from ../boost_1_43_0/boost/thread/thread.hpp:12, from ../boost_1_43_0/boost/thread.hpp:13, from test.cpp:37: ../boost_1_43_0/boost/config/requires_threads.hpp:47:5: error: #error "Compiler threading support is not turned on. Please set the correct command line options for threading: -pthread (Linux), -pthreads (Solaris) or -mthreads (Mingw32)"
This suggests that your compiler is not running with threads enabled, whereas you instructed `bjam` to compile the threaded version of Boost:
./bjam cxxflags="-O2" release threading=multi link=static
Try to compile with threading=single; if that works, you might want to check your compiler's docs on how to enable threading support.
Thanks Riccardo! I've tried that now, also together with things like omitting -pthreads or -lpthreads options for this compiler, but to no avail: the error message from Boost remains the same.
If you're trying to build the thread lib then you definitely would get errors trying to build in single threaded mode... my guess is that the compiler doesn't set any preprocessor flags (such as the usual _REENTRANT) to indicate it's thread safe. You could circumvent that test with: bjam define=BOOST_HAS_THREADS HTH, John.
participants (3)
-
Chris
-
John Maddock
-
Riccardo Murri