# Build problems on Gentoo and CentOS

**URL:** <https://discourse.slicer.org/t/build-problems-on-gentoo-and-centos/696>\
**Category:** Development\
**Created:** [July 16, 2017, 12:09pm UTC](https://discourse.slicer.org/t/build-problems-on-gentoo-and-centos/696 "2017-07-16T12:09:19Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![vnpavanelli](https://avatars.discourse-cdn.com/v4/letter/v/f04885/32.png) [@vnpavanelli](https://discourse.slicer.org/u/vnpavanelli)\
**Post date:** [July 16, 2017, 12:09pm UTC](https://discourse.slicer.org/t/build-problems-on-gentoo-and-centos/696/1 "2017-07-16T12:09:19Z")

</div>

I’m having some problems building 3D Slicer on Gentoo, I’m using GCC 7 and GCC 6, could not try on GCC 4 since it got some libraries problems with the ABI changes.

Can someone orient me about what GCC version and maybe Linux distro is best to build? I would like to use Gentoo, but if another works its a start for me.

I’ve tried also CentOS 7 with no luck, maybe I’m missing something. Been following the instructions on [https://www.slicer.org/wiki/Documentation/Nightly/Developers/Build\_Instructions](https://www.slicer.org/wiki/Documentation/Nightly/Developers/Build_Instructions)

The errors on Gentoo I’m stuck now are all like this:  
Slicer-SuperBuild-Debug/SimpleITK/Code/Common/include/Ancillary/TypeList.h:328:43: error: expected primary-expression before ‘\>’ token  
visitor.CLANG\_TEMPLATE operator()( );

And on CentOS I got:  
[1%] Completed ‘BRAINSTools’  
[1%] Built target BRAINSTools  
make[2]: \*\*\* No rule to make target `zlib-prefix/src/zlib-stamp/zlib-/root/src/Slicer-SuperBuild-Debug/version-zlib.txt', needed by`zlib-prefix/src/zlib-stamp/zlib-generate\_project\_description’. Stop.  
make[1]: \*\*\* [CMakeFiles/zlib.dir/all] Error 2

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [July 16, 2017, 7:19pm UTC](https://discourse.slicer.org/t/build-problems-on-gentoo-and-centos/696/2 "2017-07-16T19:19:34Z")

</div>

I’ve never used Gentoo, but things usually build fine on ubuntu.

You might try building ITK outside of Slicer and see if you can figure out the error that way.

Best,  
Steve

---

<div class="post-metadata">

**Author:** ![fedorov](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/fedorov/32/14_2.png) [@fedorov](https://discourse.slicer.org/u/fedorov)\
**Post date:** [July 17, 2017, 2:30am UTC](https://discourse.slicer.org/t/build-problems-on-gentoo-and-centos/696/3 "2017-07-17T02:30:03Z")

</div>

It may have to do with your compiler applying C++11 by default.

Can you let us know what is the output of `gcc -v`?

---

<div class="post-metadata">

**Author:** ![fedorov](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/fedorov/32/14_2.png) [@fedorov](https://discourse.slicer.org/u/fedorov)\
**Post date:** [July 17, 2017, 2:34am UTC](https://discourse.slicer.org/t/build-problems-on-gentoo-and-centos/696/4 "2017-07-17T02:34:51Z")

</div>

Sorry I didn’t read carefully your initial post that you use GCC 7 and 6.

As you can see from [https://gcc.gnu.org/gcc-6/changes.html](https://gcc.gnu.org/gcc-6/changes.html), GCC 6 default mode is C++14. As far as I know, you cannot compile Slicer with C++14, and I am not sure if/how you could configure your build to properly propagate flags to enforce C++98 throughout the superbuild.

This discussion _may_ be helpful: [https://github.com/QIICR/dcmqi/issues/235](https://github.com/QIICR/dcmqi/issues/235).

---

<div class="post-metadata">

**Author:** ![vnpavanelli](https://avatars.discourse-cdn.com/v4/letter/v/f04885/32.png) [@vnpavanelli](https://discourse.slicer.org/u/vnpavanelli)\
**Post date:** [July 17, 2017, 6:38am UTC](https://discourse.slicer.org/t/build-problems-on-gentoo-and-centos/696/5 "2017-07-17T06:38:04Z")

</div>

Thank you very much @pieper and @fedorov !  
I’m trying right now on Ubuntu 16.04 that have the GCC 5, it seems to be working.

That discussion is very helpful, will try later to make it works with the GCC 6/7, maybe I can contribute a little with the project.
