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). There are some problems which I describe
below and at the end of the mail I pose my questions. Thanks for any
comments !
To test I use the following code:
#include
#include
int main() {
boost::mutex mut;
return 0;
}
I downloaded boost 1.33.0 & build & install it. When I try to compile it
with
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
I get
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)"
[many more "not declared" messages]
Now I use "-DBOOST_HAS_THREADS", but this also does not help :
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
/usr/bin/ld: cannot find -lboost_thread-gcc-mt
collect2: ld returned 1 exit status
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
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
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 ?
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 ? Ideally I would like
to use the same compiler flags to compile a project using boost on IA32
and IA64.
For some reasons I'd prefer to use boost 1.32.0 on IA64 but I could not
get the thread package to work. Does boost 1.32.0 threads work on
IA64/gcc3.2.3 ? Or is it only with boost 1.33.0 + patch that I can use
them on IA64 ?
Best regards,
Andreas