You are here

utility::thread namespace error while trying to build with boost_thread

2 posts / 0 new
Last post
utility::thread namespace error while trying to build with boost_thread

Hello, I'm trying to build Rosetta 2015-.12.57698 in Ubuntu 14.04.2 LTS using gcc 4.8.2. I can successfully build Rosetta using:

./ -j2 bin mode=release


but when I try with "extras=boost_thread" (i.e., ./ -j2 bin mode=release extras=boost_thread), I get the following error:

g++ -o build/src/release/linux/3.16/64/x86/gcc/4.8/boost_thread/protocols/fldsgn/potentials/sspot/HSPairPotential.os -c -std=c++98 -isystem external/boost_1_55_0/ -isystem external/include/ -isystem external/dbio/ -pipe -ffor-scope -Wall -Wextra -pedantic -Werror -Wno-long-long -Wno-strict-aliasing -O3 -ffast-math -funroll-loops -finline-functions -finline-limit=20000 -s -Wno-unused-variable -Wno-unused-parameter -pthread -fPIC -DBOOST_ERROR_CODE_HEADER_ONLY -DBOOST_SYSTEM_NO_DEPRECATED -DPTR_BOOST -DNDEBUG -DUSE_BOOST_THREAD -DMULTI_THREADED -Isrc -Iexternal/include -Isrc/platform/linux/64/gcc/4.8 -Isrc/platform/linux/64/gcc -Isrc/platform/linux/64 -Isrc/platform/linux -Iexternal/boost_1_55_0 -Iexternal/dbio -I/usr/include -I/usr/local/include src/protocols/fldsgn/potentials/sspot/

In file included from src/protocols/hotspot_hashing/

src/core/scoring/sc/MolecularSurfaceCalculator.hh:273:2: error: 'thread' in namespace 'utility' does not name a type

utility::thread::ReadWriteMutex sc_radii_mutex_;

Post Situation: 
Tue, 2015-05-19 08:37

Multithreading isn't well supported in Rosetta at this point - it's something we're working on, but it's a little rough around the edges. Particularly, when we get better multi-threading support in Rosetta it will be based off of native C++11 threading, rather than boost threading.

For that reason, I would only recommend building with extras=boost_thread if you use the few protocols which explicitly mention they make use of it (such as the fragment picker), as it's not going to help general Rosetta protocols. Also, if you can set things up so that you can use multi-processing distribution rather than multi-threading, then I'd recommend that.

If you absolutely need the boost_thread build of Rosetta, then to fix this bug you need to add preprocessing guards for CXX11 threading around this particular use case, as it's C++11 threading specific:

#ifdef CXX11
utility::thread::ReadWriteMutex sc_radii_mutex_;

You'll need to do something similar to src/core/scoring/sc/ as well at around line 255

Mon, 2015-05-25 10:56