Boost logo

Boost Users :

From: Ben Hutchings (ben.hutchings_at_[hidden])
Date: 2005-11-08 12:33:54


Andreas Unterkircher wrote:

>I'm working on porting a large project to IA64. Therefore I'd like to
>use the boost thread package on IA64 using gcc 3.2.3 (standard compiler
>on the SL 3 Linux distribution).
>
For reference, I used Debian 3.1 (sarge) with g++ 3.3.5 and Boost from
CVS shortly before 1.33.

<snip>

>In the boost mailing list archive I found an IA64 patch posted by Ben
>Hutchings. Applying this patch and recompiling boost I get:
>
>g++ -g -O2 -pthread
>-I/opt/boostTest/include/boost-1_33
>-L/opt/boostTest/lib
>-lboost_filesystem-gcc-mt -lboost_thread-gcc-mt -lpthread
>-lboost_regex-gcc-mt prog.c
>
>
The patch is supposed to add a -D_REENTRANT to that. Are you
constructing this command-line yourself?

>In file included from
>/opt/boostTest/include/boost-1_33/boost/thread/detail/config.hpp:18,
> from
>/opt/boostTest/include/boost-1_33/boost/thread/mutex.hpp:15,
> from prog.c:2:
>/opt/boostTest/include/boost-1_33/boost/config/requires_threads.hpp:47:5:
>#error "Compiler threading support is not turned on. Please set the
>correct command line options for threading: -pthread (Linux), -pthreads
>(Solaris) or -mthreads (Mingw32)"
>
>But when I use "-DBOOST_HAS_THREADS" everything works fine:
>
>g++ -g -O2 -pthread -DBOOST_HAS_THREADS
>-I/op/boostTest/include/boost-1_33
>-L/opt/boostTest/lib
>-lboost_filesystem-gcc-mt -lboost_thread-gcc-mt -lpthread
>-lboost_regex-gcc-mt prog.c
>
>
<snip>

>Here are my questions:
>
>Boost 1.33.0 contains the file boost/detail/sp_counted_base_gcc_ia64.hpp,
>nevertheless thread support seems not to work with gcc3.2.3. Thread
>support works by applying the patch and using "-DBOOST_HAS_THREADS". What
>is the status of boost 1.33.0 concerning IA64 ? I guess the patch has not
>been incorporated into the boost distribution ?
>
>
Sorry, no, I seem to have missed committing the change to gcc-tools.jam.
Since I don't normally develop on IA64 this error wasn't obvious to me
until now.

>On IA32 I can compile and use boost 1.33.0 threads using gcc3.2.3 without
>using "-DBOOST_HAS_THREADS". Why is this the case ?
>
You're telling Boost that the compiler has been configured to use
thread-safe options (which unfortunately is not true if _REENTRANT is
not defined).

>Ideally I would like to use the same compiler flags to compile a project using boost on IA32 and IA64.
>
>
You can use the options -pthread -D_REENTRANT on both.

Ben.


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