Activating threads in rootcint

How can I activate threads in building the Dict file?

One of the header files requires threads:
/afs/ #error “Compiler threading support is not turned on. Please set the correct command line options for threading: -pthread (Linux), -pthreads (Solaris) or -mthreads (Mingw32)”

I used SCRAM which made:

/afs/ -v -f -c -pthread -DGNU_SOURCE -DG4USE_STD_NAMESPACE -DGNU_GCC -DPROJECT_NAME=ORCA -DPROJECT_VERSION=ORCA_8_7_1 -I/afs/ -I/afs/ -I/afs/ -I/afs/ -I/afs/ -I/afs/ -I/afs/ -I/afs/ -I/afs/ -I/afs/ -I/afs/ -I/afs/ -I/afs/ -I/afs/ -I/afs/ -I/afs/ LinkDef.h

What is the correct way of activating the threads?

Dear experts,

after all these years, the issue still presists. Could someone comment on how to deal with this threading problem?


Due to CINT limitation (and Boost use of the newest feature of the C++ language) we do not yet support boost (aka we strongly recommend to hide all the boost header file from rootcint using the MAKECINT macro as a selection).

Now apriori with ROOT 5.16/00 this might/should have work since we improve the amount of compiler macro being forwarded to the rootcint parser. Could you confirm which version of ROOT is still failing.



I can reproduce it even with the newest ROOT. The problem is that BOOST is extremely sensitive to CPP macros, and it needs tons of them. If you (kukarzev) manage to come up with the right set of preprocessor defines I can probably make the CPP parsing work with CINT. Right now I have

echo '#include <boost/thread.hpp>' | \ g++ -dDI -E -C -DG__LINUX=1 -DG__GNUC=3 -DG__GNUC_MINOR=4 -DG__GNUC_VER=3004 -DG__GLIBC=2 -DG__GLIBC_MINOR=3 -DG__ROOT=1 -DG__NATIVELONGLONG=1 -D__GNUC__=3 -D__GNUC_MINOR__=4 -D__x86_64__=1 -DR__B64 -DTRUE=1 -DFALSE=0 -Dexternalref=extern -DSYSV -D__MAKECINT__ -DG__CINTVERSION=50160021 \ -D_POSIX_THREADS=1 -D_REENTRANT -D!ADD_HERE! \ -I. -I/afs/ -D__CINT__ -I$ROOTSYS/cint/include -I$ROOTSYS/cint/stl -I$ROOTSYS/cint/lib -
With “-D_POSIX_THREADS=1 -D_REENTRANT”, GCC survives the thread part, but it now gets stuck in some int typedefing. You’ll need to replace “-D!ADD_HERE!” by some defines which will hopefully make it work…

Cheers, Axel.