Build failure with Geant4 Multithreading on
$ cat /etc/redhat-release Fedora release 23 (Twenty Three)
$ gcc --version gcc (GCC) 5.1.1 20150618 (Red Hat 5.1.1-4)
Clone into $HOME/bdsim/ then build in $HOME/BDSIM-build
$ cmake ../bdsim/
-- The C compiler identification is GNU 5.1.1
-- The CXX compiler identification is GNU 5.1.1
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring BDSIM 0.8.0
-- Build Type RelWithDebInfo
-- Compiler supports C++11
-- Looking for CLHEP... - found
-- Found CLHEP 2.3.1.0 in /usr/local/lib/CLHEP-2.3.1.0/../../include
-- Looking for ROOT...
-- Found ROOT 5.34/32 in /usr
-- ROOT support ON
-- GDML support ON
-- Looking for XML2... - found
-- LCDD support ON
-- Geant4 Use File: /usr/local/lib64/Geant4-10.1.2/UseGeant4.cmake
-- Geant4 Definitions: -DG4_STORE_TRAJECTORY;-DG4VERBOSE;-DG4UI_USE;-DG4VIS_USE;-DG4MULTITHREADED;-DG4UI_USE_TCSH;-DG4INTY_USE_XT;-DG4VIS_USE_RAYTRACERX;-DG4UI_USE_XM;-DG4VIS_USE_OPENGLXM;-DG4VIS_USE_OPENGLX;-DG4VIS_USE_OPENGL
-- G4_VERSION: 10.1.2
-- Found Doxygen: /usr/bin/doxygen (found version "1.8.9.1")
-- Found BISON: /usr/bin/bison (found version "3.0.4")
-- Found FLEX: /usr/bin/flex (found version "2.5.39")
-- Found Sphinx: /usr/bin/sphinx-build
-- Configuring done
-- Generating done
-- Build files have been written to: /home/molson/BDSIM-build
make ->
[ 63%] Building CXX object CMakeFiles/bdsim.dir/src/BDSRunManager.cc.o /home/molson/bdsim/src/BDSRunManager.cc:22:31: error: thread-local declaration of ‘BDSRunManager BDSRunManager::fRunManager’ follows non-thread-local declaration BDSRunManager BDSRunManager::fRunManager = 0; ^ In file included from /home/molson/bdsim/src/BDSRunManager.cc:12:0: /home/molson/bdsim/include/BDSRunManager.hh:26:25: note: ‘BDSRunManager BDSRunManager::fRunManager’ previously declared here static BDSRunManager fRunManager; // needed since singleton inheritance won't work ^ /home/molson/bdsim/src/BDSRunManager.cc:22:31: error: declaration of ‘BDSRunManager BDSRunManager::fRunManager’ outside of class is not definition [-fpermissive] BDSRunManager BDSRunManager::fRunManager = 0;
Comments (5)
-
-
-
assigned issue to
- changed title to Build failure with Geant4 Multithreading on
-
assigned issue to
-
reporter Yes, I had it enabled.
Rebuilding with the geant4 multithreading off allowed BDSIM to finish building successfully.
-
Thanks for the feedback. I will put a check on that flag at configuration with a meaningful error.
In the future we'll likely support multithreading, but that will need some internal reworking.
-
- changed status to resolved
The latest develop version checks in the configuration step if Geant4 is built with multithreading and fails if so.
- Log in to comment
Thanks for the report. This is most likely since Geant4 was built with multithreading on (GEANT4_BUILD_MULTITHREADED). We currently don't support that, so please build Geant4 with the flag off.
We should put a check on this though, and we'll likely support it in the future.