Activating threads in rootcint

How can I activate threads in building the Dict file?

One of the header files requires threads:
/afs/cern.ch/cms/external/lcg/external/Boost/1.31.0/slc3_ia32_gcc323/include/boost-1_31/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)”

I used SCRAM which made:

/afs/cern.ch/cms/external/lcg/external/root/3.10.02/slc3_ia32_gcc323/root/bin/rootcint -v -f LinkDef.cc -c -pthread -DGNU_SOURCE -DG4USE_STD_NAMESPACE -DGNU_GCC -DPROJECT_NAME=ORCA -DPROJECT_VERSION=ORCA_8_7_1 -I/afs/cern.ch/cms/Releases/COBRA/COBRA_8_1_0/src/Porting/Linux24-gcc3/wrappers -I/afs/cern.ch/user/d/dierlamm/scratch0/ORCA_8_7_1/src -I/afs/cern.ch/cms/Releases/ORCA/ORCA_8_7_1/src -I/afs/cern.ch/cms/Releases/COBRA/COBRA_8_1_0/src -I/afs/cern.ch/cms/external/lcg/app/releases/POOL/POOL_1_8_1/src -I/afs/cern.ch/cms/external/lcg/app/releases/POOL/POOL_1_8_1/include -I/afs/cern.ch/cms/external/lcg/app/releases/SEAL/SEAL_1_4_3/src -I/afs/cern.ch/cms/external/lcg/app/releases/SEAL/SEAL_1_4_3/include -I/afs/cern.ch/cms/external/lcg/app/releases/SEAL/SEAL_1_4_3/slc3_ia32_gcc323/include -I/afs/cern.ch/cms/external/lcg/external/root/3.10.02/slc3_ia32_gcc323/root/include -I/afs/cern.ch/cms/external/lcg/external/root/3.10.02/slc3_ia32_gcc323/root/cint -I/afs/cern.ch/cms/external/lcg/external/clhep/1.9.1.2/slc3_ia32_gcc323/include -I/afs/cern.ch/cms/external/lcg/external/GSL/1.4/slc3_ia32_gcc323/include -I/afs/cern.ch/cms/external/lcg/external/Boost/1.31.0/slc3_ia32_gcc323/include/boost-1_31 -I/afs/cern.ch/user/d/dierlamm/scratch0/ORCA_8_7_1/src -I/afs/cern.ch/cms/Releases/ORCA/ORCA_8_7_1/src 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?

Hi,

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.

Philippe

Hi,

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/cern.ch/cms/external/lcg/external/Boost/1.31.0/slc3_ia32_gcc323/include/boost-1_31 -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.