Boost logo

Boost Users :

From: mojmir.svoboda_at_[hidden]
Date: 2006-09-19 10:47:07


hello,

i'm trying to build opendiameter (uses boost) with gcc 3.4.3 on a hp box:
    HP-UX bruno B.11.23 U 9000/800 1532750548 unlimited-user license

and i've encountered following error when compiling libdiamparser:

    boost_1_33_1/boost/pool/detail/mutex.hpp:41:4:
    #error Unable to determine platform mutex type; define BOOST_NO_MT to
    assume single-threaded

well, according to <sys/unistd.h> _POSIX_THREADS is still undefined on HP-UX:

    /************************************************************************
     * The following defines are specified in the standard, but are not yet
     * implemented:
     * _POSIX_THREADS can't be defined until all features are implemented
     ...

i've found similar problem in python and the solution uses check for
_SC_THREADS instead of _POSIX_THREADS. yet better solution may use
BOOST_HAS_PTHREADS:

    boost_1_33_1/boost/pool/detail $ diff -Naur mutex.hpp.orig mutex.hpp
    --- mutex.hpp.orig 2006-09-19 14:20:53.000000000 +0200
    +++ mutex.hpp 2006-09-19 16:11:50.000000000 +0200
    @@ -31,7 +31,7 @@
         #define BOOST_MUTEX_HELPER BOOST_MUTEX_HELPER_WIN32
       #else
         #include <unistd.h>
    - #ifdef _POSIX_THREADS
    + #ifdef BOOST_HAS_PTHREADS
           #define BOOST_MUTEX_HELPER BOOST_MUTEX_HELPER_PTHREAD
         #endif
       #endif
    @@ -45,7 +45,7 @@
     # ifdef BOOST_WINDOWS
     # include <windows.h>
     # endif
    -# ifdef _POSIX_THREADS
    +# ifdef BOOST_HAS_PTHREADS
     # include <pthread.h>
     # endif
     #endif
    @@ -83,7 +83,7 @@
     
     #endif // defined(BOOST_WINDOWS)
     
    -#ifdef _POSIX_THREADS
    +#ifdef BOOST_HAS_PTHREADS
     
     class pthread_mutex
     {
    @@ -107,7 +107,7 @@
         { pthread_mutex_unlock(&mtx); }
     };
     
    -#endif // defined(_POSIX_THREADS)
    +#endif // defined(BOOST_HAS_PTHREADS)
     
     #endif // !defined(BOOST_NO_MT)

because the file <boost/config/platform/hpux.hpp> defines
BOOST_HAS_PTHREADS for us on the hpux+gcc.

is it allright?

thanks fya,
mojmir

This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net