Build problems on Gentoo and CentOS

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

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 byzlib-prefix/src/zlib-stamp/zlib-generate_project_description’. Stop.
make[1]: *** [CMakeFiles/zlib.dir/all] Error 2

Thanks in advance!

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

1 Like

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?

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, 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.

1 Like

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.