[config] PGI config file doesn't defines BOOST_HAS_THREADS

There is an issue on Boost.Thread regression test for PGI compiler. See https://svn.boost.org/trac/boost/ticket/6354. "pgCC" -INLINE:none -Kieee -fpic -fPIC -gopt -Minform=warn -DBOOST_ALL_NO_LIB=1 -DBOOST_TEST_NO_AUTO_LINK=1 -DBOOST_THREAD_POSIX -DBOOST_THREAD_USE_DLL=1 -D__need_IOV_MAX -I".." -c -o "/scratch/kbelco/boost/results/boost/bin.v2/libs/thread/test/test_barrier.test/pgi-11.9/debug/threading-multi/test_barrier.o" "../libs/thread/test/test_barrier.cpp" "../boost/config/requires_threads.hpp", line 86: catastrophic error: #error directive: "Compiler threading support is not turned on. Please consult your compiler's documentation for the appropriate options to use" # error "Compiler threading support is not turned on. Please consult your compiler's documentation for the appropriate options to use" boost/config/compiler/pgi.hpp defines BOOST_HAS_PTHREADS but not BOOST_HAS_THREADS, resulting in failure in the requires_threads.hpp header. It seems that adding #define BOOST_HAS_THREADS inboost/config/compiler/pgi.hpp solves the issue. John, what do you think? Could I add it? Best, Vicente

There is an issue on Boost.Thread regression test for PGI compiler. See https://svn.boost.org/trac/boost/ticket/6354.
"pgCC" -INLINE:none -Kieee -fpic -fPIC -gopt -Minform=warn -DBOOST_ALL_NO_LIB=1 -DBOOST_TEST_NO_AUTO_LINK=1 -DBOOST_THREAD_POSIX -DBOOST_THREAD_USE_DLL=1 -D__need_IOV_MAX -I".." -c -o "/scratch/kbelco/boost/results/boost/bin.v2/libs/thread/test/test_barrier.test/pgi-11.9/debug/threading-multi/test_barrier.o" "../libs/thread/test/test_barrier.cpp"
"../boost/config/requires_threads.hpp", line 86: catastrophic error: #error directive: "Compiler threading support is not turned on. Please consult your compiler's documentation for the appropriate options to use" # error "Compiler threading support is not turned on. Please consult your compiler's documentation for the appropriate options to use"
boost/config/compiler/pgi.hpp defines BOOST_HAS_PTHREADS but not BOOST_HAS_THREADS, resulting in failure in the requires_threads.hpp header.
It seems that adding
#define BOOST_HAS_THREADS
inboost/config/compiler/pgi.hpp solves the issue.
John, what do you think?
If it's true that the compiler always supports threads, then yes go for it. John.

On 03/22/2012 11:41 AM, John Maddock wrote:
There is an issue on Boost.Thread regression test for PGI compiler. See https://svn.boost.org/trac/boost/ticket/6354.
"pgCC" -INLINE:none -Kieee -fpic -fPIC -gopt -Minform=warn -DBOOST_ALL_NO_LIB=1 -DBOOST_TEST_NO_AUTO_LINK=1 -DBOOST_THREAD_POSIX -DBOOST_THREAD_USE_DLL=1 -D__need_IOV_MAX -I".." -c -o "/scratch/kbelco/boost/results/boost/bin.v2/libs/thread/test/test_barrier.test/pgi-11.9/debug/threading-multi/test_barrier.o" "../libs/thread/test/test_barrier.cpp"
"../boost/config/requires_threads.hpp", line 86: catastrophic error: #error directive: "Compiler threading support is not turned on. Please consult your compiler's documentation for the appropriate options to use" # error "Compiler threading support is not turned on. Please consult your compiler's documentation for the appropriate options to use"
boost/config/compiler/pgi.hpp defines BOOST_HAS_PTHREADS but not BOOST_HAS_THREADS, resulting in failure in the requires_threads.hpp header.
It seems that adding
#define BOOST_HAS_THREADS
inboost/config/compiler/pgi.hpp solves the issue.
John, what do you think?
If it's true that the compiler always supports threads, then yes go for it.
John.
I tested the define it with both PGI 11.9 and 12. It works fine.

Le 22/03/12 17:41, John Maddock a écrit :
There is an issue on Boost.Thread regression test for PGI compiler. See https://svn.boost.org/trac/boost/ticket/6354.
"pgCC" -INLINE:none -Kieee -fpic -fPIC -gopt -Minform=warn -DBOOST_ALL_NO_LIB=1 -DBOOST_TEST_NO_AUTO_LINK=1 -DBOOST_THREAD_POSIX -DBOOST_THREAD_USE_DLL=1 -D__need_IOV_MAX -I".." -c -o "/scratch/kbelco/boost/results/boost/bin.v2/libs/thread/test/test_barrier.test/pgi-11.9/debug/threading-multi/test_barrier.o" "../libs/thread/test/test_barrier.cpp"
"../boost/config/requires_threads.hpp", line 86: catastrophic error: #error directive: "Compiler threading support is not turned on. Please consult your compiler's documentation for the appropriate options to use" # error "Compiler threading support is not turned on. Please consult your compiler's documentation for the appropriate options to use"
boost/config/compiler/pgi.hpp defines BOOST_HAS_PTHREADS but not BOOST_HAS_THREADS, resulting in failure in the requires_threads.hpp header.
It seems that adding
#define BOOST_HAS_THREADS
inboost/config/compiler/pgi.hpp solves the issue.
John, what do you think?
If it's true that the compiler always supports threads, then yes go for it.
Hi John, I have added it just fro version higher equal than 11 #if __PGIC__ >= 11 // options requested by configure --enable-test #define BOOST_HAS_PTHREADS *#define BOOST_HAS_THREADS* Committed revision 77487. I will check how this works on trunk. Vicente

Le 22/03/12 22:35, Vicente J. Botet Escriba a écrit :
Le 22/03/12 17:41, John Maddock a écrit :
There is an issue on Boost.Thread regression test for PGI compiler. See https://svn.boost.org/trac/boost/ticket/6354.
"pgCC" -INLINE:none -Kieee -fpic -fPIC -gopt -Minform=warn -DBOOST_ALL_NO_LIB=1 -DBOOST_TEST_NO_AUTO_LINK=1 -DBOOST_THREAD_POSIX -DBOOST_THREAD_USE_DLL=1 -D__need_IOV_MAX -I".." -c -o "/scratch/kbelco/boost/results/boost/bin.v2/libs/thread/test/test_barrier.test/pgi-11.9/debug/threading-multi/test_barrier.o" "../libs/thread/test/test_barrier.cpp"
"../boost/config/requires_threads.hpp", line 86: catastrophic error: #error directive: "Compiler threading support is not turned on. Please consult your compiler's documentation for the appropriate options to use" # error "Compiler threading support is not turned on. Please consult your compiler's documentation for the appropriate options to use"
boost/config/compiler/pgi.hpp defines BOOST_HAS_PTHREADS but not BOOST_HAS_THREADS, resulting in failure in the requires_threads.hpp header.
It seems that adding
#define BOOST_HAS_THREADS
inboost/config/compiler/pgi.hpp solves the issue.
John, what do you think?
If it's true that the compiler always supports threads, then yes go for it.
Hi John,
I have added it just fro version higher equal than 11
#if __PGIC__ >= 11
// options requested by configure --enable-test #define BOOST_HAS_PTHREADS *#define BOOST_HAS_THREADS*
Committed revision 77487.
I will check how this works on trunk. Vicente The regression test are working now. I'm wondering if it couldn't be better to update ../boost/config/requires_threads.hpp instead.
Best, Vicente

The regression test are working now. I'm wondering if it couldn't be better to update ../boost/config/requires_threads.hpp instead.
??? It's there for a reason - if Boost.Config thinks threads are turned off in the compiler then it's not safe to call the threading API's, and yes, you can have pthreads or Win32 threads available, but the compiler not generate thread safe code so BOOST_HAS_THREADS is deliberately unset. John.
participants (3)
-
Ioannis Papadopoulos
-
John Maddock
-
Vicente J. Botet Escriba