# Problem installing 10.7.1 on CentOS with PTL

**URL:** <https://geant4-forum.web.cern.ch/t/problem-installing-10-7-1-on-centos-with-ptl/4858>\
**Category:** Getting Started\
**Created:** [April 7, 2021, 3:52am UTC](https://geant4-forum.web.cern.ch/t/problem-installing-10-7-1-on-centos-with-ptl/4858 "2021-04-07T03:52:16Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vyacheslav\_Porosev](https://geant4-forum.web.cern.ch/user_avatar/geant4-forum.web.cern.ch/vyacheslav_porosev/32/5070_2.png) [@Vyacheslav\_Porosev](https://geant4-forum.web.cern.ch/u/Vyacheslav_Porosev)\
**Post date:** [April 7, 2021, 3:52am UTC](https://geant4-forum.web.cern.ch/t/problem-installing-10-7-1-on-centos-with-ptl/4858/1 "2021-04-07T03:52:16Z")

</div>

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/TaskRunManager.cc:22:  
…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\>&&)’  
PTL\_DEFAULT\_OBJECT(JoinFunction)  
^  
…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’  
PTL\_DEFAULT\_OBJECT(JoinFunction)  
^  
make[2]: \*\*\* [source/externals/ptl/CMakeFiles/ptl-shared.dir/src/TaskRunManager.cc.o] 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,  
Vyacheslav

---

<div class="post-metadata">

**Author:** ![bmorgan](https://geant4-forum.web.cern.ch/user_avatar/geant4-forum.web.cern.ch/bmorgan/32/7_2.png) [@bmorgan](https://geant4-forum.web.cern.ch/u/bmorgan)\
**Post date:** [April 9, 2021, 9:05am UTC](https://geant4-forum.web.cern.ch/t/problem-installing-10-7-1-on-centos-with-ptl/4858/2 "2021-04-09T09:05:45Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Vyacheslav\_Porosev](https://geant4-forum.web.cern.ch/user_avatar/geant4-forum.web.cern.ch/vyacheslav_porosev/32/5070_2.png) [@Vyacheslav\_Porosev](https://geant4-forum.web.cern.ch/u/Vyacheslav_Porosev)\
**Post date:** [April 9, 2021, 11:45am UTC](https://geant4-forum.web.cern.ch/t/problem-installing-10-7-1-on-centos-with-ptl/4858/3 "2021-04-09T11:45:03Z")

</div>

Dear Benjamin.

I put some CMAKE-generated files[CMakeOutput.txt](https://geant4-forum.web.cern.ch/uploads/short-url/d4czpPihdGgAnNNp8P9BBOMOOt8.txt) (48.2 KB) [CMakeCache.txt](https://geant4-forum.web.cern.ch/uploads/short-url/1ggB3aJH0kx7aOH9Rn76dn4sS4N.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

---

<div class="post-metadata">

**Author:** ![Vyacheslav\_Porosev](https://geant4-forum.web.cern.ch/user_avatar/geant4-forum.web.cern.ch/vyacheslav_porosev/32/5070_2.png) [@Vyacheslav\_Porosev](https://geant4-forum.web.cern.ch/u/Vyacheslav_Porosev)\
**Post date:** [April 13, 2021, 8:48am UTC](https://geant4-forum.web.cern.ch/t/problem-installing-10-7-1-on-centos-with-ptl/4858/4 "2021-04-13T08:48:29Z")

</div>

Hello!

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

```auto
sudo yum install centos-release-scl

```

```auto
sudo yum install devtoolset-7

```

and run a new shell with new GCC:

```auto
scl enable devtoolset-7 bash

```

after that, it was successfully compiled.

---

<div class="post-metadata">

**Author:** ![claretta-guidi](https://geant4-forum.web.cern.ch/user_avatar/geant4-forum.web.cern.ch/claretta-guidi/32/4355_2.png) [@claretta-guidi](https://geant4-forum.web.cern.ch/u/claretta-guidi)\
**Post date:** [April 1, 2022, 10:02am UTC](https://geant4-forum.web.cern.ch/t/problem-installing-10-7-1-on-centos-with-ptl/4858/5 "2022-04-01T10:02:22Z")

</div>

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

Cheers

Claretta

---

<div class="post-metadata">

**Author:** ![mustak-21](https://geant4-forum.web.cern.ch/user_avatar/geant4-forum.web.cern.ch/mustak-21/32/3839_2.png) [@mustak-21](https://geant4-forum.web.cern.ch/u/mustak-21)\
**Post date:** [April 26, 2022, 1:33pm UTC](https://geant4-forum.web.cern.ch/t/problem-installing-10-7-1-on-centos-with-ptl/4858/6 "2022-04-26T13:33:25Z")

</div>

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!

 ![Screenshot from 2022-04-26 19-02-14](https://geant4-forum.web.cern.ch/uploads/default/original/2X/3/35ade4b29df564f788f05f86173317648105d8c7.png)

[CMakeOutput.txt](https://geant4-forum.web.cern.ch/uploads/short-url/sFBETAux0ltbXl7ONXtOpwS6S5Z.txt) (53.9 KB)  
[CMakeError.txt](https://geant4-forum.web.cern.ch/uploads/short-url/7HtAuxsKnRRjhTY0EY0N5948RlA.txt) (1.7 KB)

---

<div class="post-metadata">

**Author:** ![bmorgan](https://geant4-forum.web.cern.ch/user_avatar/geant4-forum.web.cern.ch/bmorgan/32/7_2.png) [@bmorgan](https://geant4-forum.web.cern.ch/u/bmorgan)\
**Post date:** [April 26, 2022, 4:25pm UTC](https://geant4-forum.web.cern.ch/t/problem-installing-10-7-1-on-centos-with-ptl/4858/7 "2022-04-26T16:25:40Z")

</div>

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

```auto
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.:

```nohighlight
$ 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

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

```

print?

---

<div class="post-metadata">

**Author:** ![mustak-21](https://geant4-forum.web.cern.ch/user_avatar/geant4-forum.web.cern.ch/mustak-21/32/3839_2.png) [@mustak-21](https://geant4-forum.web.cern.ch/u/mustak-21)\
**Post date:** [April 29, 2022, 8:50am UTC](https://geant4-forum.web.cern.ch/t/problem-installing-10-7-1-on-centos-with-ptl/4858/8 "2022-04-29T08:50:31Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![bmorgan](https://geant4-forum.web.cern.ch/user_avatar/geant4-forum.web.cern.ch/bmorgan/32/7_2.png) [@bmorgan](https://geant4-forum.web.cern.ch/u/bmorgan)\
**Post date:** [July 2, 2022, 4:54pm UTC](https://geant4-forum.web.cern.ch/t/problem-installing-10-7-1-on-centos-with-ptl/4858/9 "2022-07-02T16:54:45Z")

</div>


