Problem installing 10.7.1 on CentOS with PTL

Hello all!

I successfully compiled Geant4 on Windows, Ubuntu but I have troubles to build it on CentOS7… I get the error message:

In file included from …geant4-10.7.1/source/externals/ptl/include/PTL/TBBTaskGroup.hh:32:0,
from …geant4-10.7.1/source/externals/ptl/include/PTL/TaskRunManager.hh:28,
from …geant4-10.7.1/source/externals/ptl/src/
…geant4-10.7.1/source/externals/ptl/include/PTL/TaskGroup.hh:125:24: error: function ‘PTL::JoinFunction<void, void>::JoinFunction(PTL::JoinFunction<void, void>&&)’ defaulted on its first declaration with an exception-specification that differs from the implicit declaration ‘PTL::JoinFunction<void, void>::JoinFunction(PTL::JoinFunction<void, void>&&)’
…geant4-10.7.1/source/externals/ptl/include/PTL/TaskGroup.hh:59:9: note: in definition of macro ‘PTL_DEFAULT_OBJECT’
NAME(NAME&&) noexcept = default;
…geant4-10.7.1/source/externals/ptl/include/PTL/TaskGroup.hh:61:15: error: function ‘PTL::JoinFunction<void, void>& PTL::JoinFunction<void, void>::operator=(PTL::JoinFunction<void, void>&&)’ defaulted on its first declaration with an exception-specification that differs from the implicit declaration ‘PTL::JoinFunction<void, void>& PTL::JoinFunction<void, void>::operator=(PTL::JoinFunction<void, void>&&)’
NAME& operator=(NAME&&) noexcept = default;
…geant4-10.7.1/source/externals/ptl/include/PTL/TaskGroup.hh:125:5: note: in expansion of macro ‘PTL_DEFAULT_OBJECT’
make[2]: *** [source/externals/ptl/CMakeFiles/ptl-shared.dir/src/] Error 1
make[1]: *** [source/externals/ptl/CMakeFiles/ptl-shared.dir/all] Error 2

What can be wrong??
I use GCC 9.3 + CMAKE 3.17.5

Sincerely Yours,

Could you post the cmake commands/arguments used, and its output, along with the full compiler command line for the file causing the first error please?

Dear Benjamin.

I put some CMAKE-generated filesCMakeOutput.txt (48.2 KB) CMakeCache.txt (26.6 KB) from my computer.

But I see in CMakeOutput.log what everywhere “gcc 4.8.5” is mentioned, BUT we have GCC 9.3 build from source and installed on the computer!

Could it be a reason???

Sincerely Yours,
Vyacheslav Porosev


We fixed the problem. We used a solution that allows having few different versions of GCC on the same computer - CentOS SCL.

sudo yum install centos-release-scl
sudo yum install devtoolset-7

and run a new shell with new GCC:

scl enable devtoolset-7 bash

after that, it was successfully compiled.


I was about to lose my mind on this problem. On my Ubuntu it was easier to install.



I am facing similar problems in trying to install 10.7.p03 in centos 7. I tried the solution mentioned in this thread but it didn’t work. I have attached the screenshot of the error message. I am also attaching the cmake error log and the cmake output file. Please help!

CMakeOutput.txt (53.9 KB)
CMakeError.txt (1.7 KB)

From the CMakeOutput.txt file, it’s clearly picking up the system compiler:

gcc version 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC)

Did you run CMake then make in a scl session, i.e.:

$ scl enable devtoolset-7 bash
[scl]$ cmake <args>
[scl]$ make

? NB: the prompt after the first line won’t literally be “[scl]$” , I just used that to illustrate that a new shell should have been started.

If that was what was done, what does

$ scl enable devtoolset-7 bash
$ gcc --version
$ which gcc
$ which cc
$ env | grep "CC"


1 Like

Thank you! I got it now. It is working now.