[cctbxbb] --enable-boost-threads flag

Luc Bourhis luc_j_bourhis at mac.com
Thu Oct 18 07:04:43 PDT 2012


Hi Jeffrey,

>   My assumption is: if I compile cctbx with -DBOOST_DISABLE_THREADS and link to the libraries from programs that were not compiled with that flag, I will run into issues of having differing implementations of smart_ptrs.

That was my assumption too indeed.

> Am I correct in inferring that the latest SVN version of cctbx will configure (by default) to not use -pthreads and not use -DBOOST_DISABLE_THREADS?

Yes, indeed.

> I would like to have just one copy of cctbx built, and be able to use the libiotbx_pdb.so library in both single and multithreaded code.
> [...]
> However, for the purposes of my package it is easiest for me to compile cctbx once.

Imho you should be able to achieve that by compiling the both of your program and the cctbx without BOOST_DISABLE_THREADS. The only influence of that flags is whether to disallow using atomic increment and decrement of the reference count used by shared ptr. Atomic in the sense of thread-safe, just to be crystal clear. Iiuc, without -D BOOST_DISABLE_THREADS (unless you define some other macros but I am sure you don't) for Intel processors, shared ptr should end up using increment and decrement written in Intel assembly language that use the Intel specific instruction "lock" to make those operations atomic. That code works however many threads are involved, the only issue being the performance degradation compared to non-atomic increments or decrements. But in practice, for what we do, this should be anecdotical.

> If you could point me to a good SCons tutorial or a good example script that has documentation, that would be very useful.

Our SConscript's are the stuff of nightmares, agreed! I am not sure a generic SCons tutorial would be an useful considering how idiosyncratic our SConscript's are. There are two places to start, that you may already know, the SCons documentation and the SCons manpage. Eventually I reckon you just ask around on this forum every time you scratch your head for more than a few minutes! There are more than a handful of SCons expert split in 2 time zones, thus providing nearly a 24-hour service ;-)

Best wishes,

Luc
 


More information about the cctbxbb mailing list