Error during compiling ROOTVecOps on ROOT v6.14.04


ROOT Version: 6.14.04
Platform: Scientific Linux 6
Compiler: gcc 4.9.1


I’m trying to install ROOT 6.14.04 on a PC running Scientific Linux 6 as the OS, and having trouble with the compilation of ROOTVecOps. It’s important that I install ROOT on this machine rather than using e.g. lxplus, as it’s a requirement for a piece of software that must also be installed locally. I’m aware that the default versions of cmake and gcc that come with SL6 are too low for compiling ROOT, but I have switched to cmake 3.4.1 and gcc 4.9.1. The output of gcc --version is:

gcc (GCC) 4.9.1 20140922 (Red Hat 4.9.1-10)

and cmake3 --version is:

cmake version 3.4.1

This is the error message given during compilation:

[ 88%] Building CXX object math/vecops/CMakeFiles/ROOTVecOps.dir/G__ROOTVecOps.cxx.o
In file included from /home/dreamtest/dqmsoftware/root-6.14.04/obj/math/vecops/G__ROOTVecOps.cxx:41:0:
/home/dreamtest/dqmsoftware/root-6.14.04/obj/include/ROOT/RVec.hxx:826:1: error: ambiguous template specialization ‘fdim<>’ for ‘ROOT::VecOps::RVec<double> ROOT::VecOps::fdim(const ROOT::VecOps::RVec<double>&, const ROOT::VecOps::RVec<double>&)’
 TVEC_EXTERN_STD_FUNCTIONS(double)
 ^
/home/dreamtest/dqmsoftware/root-6.14.04/obj/include/ROOT/RVec.hxx:502:1: note: candidates are: template<class T0, class T1> ROOT::VecOps::RVec<decltype ((typename ROOT::VecOps::PromoteTypeImpl<T>::Type() + typename ROOT::VecOps::PromoteTypeImpl<V>::Type()))> ROOT::VecOps::fdim(const T0&, const ROOT::VecOps::RVec<T1>&)
 TVEC_STD_BINARY_FUNCTION(fdim)
 ^
/home/dreamtest/dqmsoftware/root-6.14.04/obj/include/ROOT/RVec.hxx:502:1: note:                 template<class T0, class T1> ROOT::VecOps::RVec<decltype ((typename ROOT::VecOps::PromoteTypeImpl<T>::Type() + typename ROOT::VecOps::PromoteTypeImpl<V>::Type()))> ROOT::VecOps::fdim(const ROOT::VecOps::RVec<T>&, const T1&)
 TVEC_STD_BINARY_FUNCTION(fdim)
 ^
/home/dreamtest/dqmsoftware/root-6.14.04/obj/include/ROOT/RVec.hxx:502:1: note:                 template<class T0, class T1> ROOT::VecOps::RVec<decltype ((typename ROOT::VecOps::PromoteTypeImpl<T>::Type() + typename ROOT::VecOps::PromoteTypeImpl<V>::Type()))> ROOT::VecOps::fdim(const ROOT::VecOps::RVec<T>&, const ROOT::VecOps::RVec<T1>&)
 TVEC_STD_BINARY_FUNCTION(fdim)
 ^
/home/dreamtest/dqmsoftware/root-6.14.04/obj/include/ROOT/RVec.hxx:826:1: error: ambiguous template specialization ‘fmod<>’ for ‘ROOT::VecOps::RVec<double> ROOT::VecOps::fmod(const ROOT::VecOps::RVec<double>&, const ROOT::VecOps::RVec<double>&)’
 TVEC_EXTERN_STD_FUNCTIONS(double)
 ^
/home/dreamtest/dqmsoftware/root-6.14.04/obj/include/ROOT/RVec.hxx:503:1: note: candidates are: template<class T0, class T1> ROOT::VecOps::RVec<decltype ((typename ROOT::VecOps::PromoteTypeImpl<T>::Type() + typename ROOT::VecOps::PromoteTypeImpl<V>::Type()))> ROOT::VecOps::fmod(const T0&, const ROOT::VecOps::RVec<T1>&)
 TVEC_STD_BINARY_FUNCTION(fmod)
 ^
/home/dreamtest/dqmsoftware/root-6.14.04/obj/include/ROOT/RVec.hxx:503:1: note:                 template<class T0, class T1> ROOT::VecOps::RVec<decltype ((typename ROOT::VecOps::PromoteTypeImpl<T>::Type() + typename ROOT::VecOps::PromoteTypeImpl<V>::Type()))> ROOT::VecOps::fmod(const ROOT::VecOps::RVec<T>&, const T1&)
 TVEC_STD_BINARY_FUNCTION(fmod)
 ^
/home/dreamtest/dqmsoftware/root-6.14.04/obj/include/ROOT/RVec.hxx:503:1: note:                 template<class T0, class T1> ROOT::VecOps::RVec<decltype ((typename ROOT::VecOps::PromoteTypeImpl<T>::Type() + typename ROOT::VecOps::PromoteTypeImpl<V>::Type()))> ROOT::VecOps::fmod(const ROOT::VecOps::RVec<T>&, const ROOT::VecOps::RVec<T1>&)
 TVEC_STD_BINARY_FUNCTION(fmod)
 ^
/home/dreamtest/dqmsoftware/root-6.14.04/obj/include/ROOT/RVec.hxx:826:1: error: ambiguous template specialization ‘remainder<>’ for ‘ROOT::VecOps::RVec<double> ROOT::VecOps::remainder(const ROOT::VecOps::RVec<double>&, const ROOT::VecOps::RVec<double>&)’
 TVEC_EXTERN_STD_FUNCTIONS(double)
 ^
/home/dreamtest/dqmsoftware/root-6.14.04/obj/include/ROOT/RVec.hxx:504:1: note: candidates are: template<class T0, class T1> ROOT::VecOps::RVec<decltype ((typename ROOT::VecOps::PromoteTypeImpl<T>::Type() + typename ROOT::VecOps::PromoteTypeImpl<V>::Type()))> ROOT::VecOps::remainder(const T0&, const ROOT::VecOps::RVec<T1>&)
 TVEC_STD_BINARY_FUNCTION(remainder)
 ^
/home/dreamtest/dqmsoftware/root-6.14.04/obj/include/ROOT/RVec.hxx:504:1: note:                 template<class T0, class T1> ROOT::VecOps::RVec<decltype ((typename ROOT::VecOps::PromoteTypeImpl<T>::Type() + typename ROOT::VecOps::PromoteTypeImpl<V>::Type()))> ROOT::VecOps::remainder(const ROOT::VecOps::RVec<T>&, const T1&)
 TVEC_STD_BINARY_FUNCTION(remainder)
 ^
/home/dreamtest/dqmsoftware/root-6.14.04/obj/include/ROOT/RVec.hxx:504:1: note:                 template<class T0, class T1> ROOT::VecOps::RVec<decltype ((typename ROOT::VecOps::PromoteTypeImpl<T>::Type() + typename ROOT::VecOps::PromoteTypeImpl<V>::Type()))> ROOT::VecOps::remainder(const ROOT::VecOps::RVec<T>&, const ROOT::VecOps::RVec<T1>&)
 TVEC_STD_BINARY_FUNCTION(remainder)
 ^
/home/dreamtest/dqmsoftware/root-6.14.04/obj/include/ROOT/RVec.hxx:826:1: error: ambiguous template specialization ‘pow<>’ for ‘ROOT::VecOps::RVec<double> ROOT::VecOps::pow(const ROOT::VecOps::RVec<double>&, const ROOT::VecOps::RVec<double>&)’
 TVEC_EXTERN_STD_FUNCTIONS(double)
 ^
/home/dreamtest/dqmsoftware/root-6.14.04/obj/include/ROOT/RVec.hxx:515:1: note: candidates are: template<class T0, class T1> ROOT::VecOps::RVec<decltype ((typename ROOT::VecOps::PromoteTypeImpl<T>::Type() + typename ROOT::VecOps::PromoteTypeImpl<V>::Type()))> ROOT::VecOps::pow(const T0&, const ROOT::VecOps::RVec<T1>&)
 TVEC_STD_BINARY_FUNCTION(pow)
 ^
/home/dreamtest/dqmsoftware/root-6.14.04/obj/include/ROOT/RVec.hxx:515:1: note:                 template<class T0, class T1> ROOT::VecOps::RVec<decltype ((typename ROOT::VecOps::PromoteTypeImpl<T>::Type() + typename ROOT::VecOps::PromoteTypeImpl<V>::Type()))> ROOT::VecOps::pow(const ROOT::VecOps::RVec<T>&, const T1&)
 TVEC_STD_BINARY_FUNCTION(pow)
 ^
/home/dreamtest/dqmsoftware/root-6.14.04/obj/include/ROOT/RVec.hxx:515:1: note:                 template<class T0, class T1> ROOT::VecOps::RVec<decltype ((typename ROOT::VecOps::PromoteTypeImpl<T>::Type() + typename ROOT::VecOps::PromoteTypeImpl<V>::Type()))> ROOT::VecOps::pow(const ROOT::VecOps::RVec<T>&, const ROOT::VecOps::RVec<T1>&)
 TVEC_STD_BINARY_FUNCTION(pow)
 ^
/home/dreamtest/dqmsoftware/root-6.14.04/obj/include/ROOT/RVec.hxx:826:1: error: ambiguous template specialization ‘hypot<>’ for ‘ROOT::VecOps::RVec<double> ROOT::VecOps::hypot(const ROOT::VecOps::RVec<double>&, const ROOT::VecOps::RVec<double>&)’
 TVEC_EXTERN_STD_FUNCTIONS(double)
 ^
/home/dreamtest/dqmsoftware/root-6.14.04/obj/include/ROOT/RVec.hxx:518:1: note: candidates are: template<class T0, class T1> ROOT::VecOps::RVec<decltype ((typename ROOT::VecOps::PromoteTypeImpl<T>::Type() + typename ROOT::VecOps::PromoteTypeImpl<V>::Type()))> ROOT::VecOps::hypot(const T0&, const ROOT::VecOps::RVec<T1>&)
 TVEC_STD_BINARY_FUNCTION(hypot)
 ^
/home/dreamtest/dqmsoftware/root-6.14.04/obj/include/ROOT/RVec.hxx:518:1: note:                 template<class T0, class T1> ROOT::VecOps::RVec<decltype ((typename ROOT::VecOps::PromoteTypeImpl<T>::Type() + typename ROOT::VecOps::PromoteTypeImpl<V>::Type()))> ROOT::VecOps::hypot(const ROOT::VecOps::RVec<T>&, const T1&)
 TVEC_STD_BINARY_FUNCTION(hypot)
 ^
/home/dreamtest/dqmsoftware/root-6.14.04/obj/include/ROOT/RVec.hxx:518:1: note:                 template<class T0, class T1> ROOT::VecOps::RVec<decltype ((typename ROOT::VecOps::PromoteTypeImpl<T>::Type() + typename ROOT::VecOps::PromoteTypeImpl<V>::Type()))> ROOT::VecOps::hypot(const ROOT::VecOps::RVec<T>&, const ROOT::VecOps::RVec<T1>&)
 TVEC_STD_BINARY_FUNCTION(hypot)
 ^
/home/dreamtest/dqmsoftware/root-6.14.04/obj/include/ROOT/RVec.hxx:826:1: error: ambiguous template specialization ‘atan2<>’ for ‘ROOT::VecOps::RVec<double> ROOT::VecOps::atan2(const ROOT::VecOps::RVec<double>&, const ROOT::VecOps::RVec<double>&)’
 TVEC_EXTERN_STD_FUNCTIONS(double)
 ^
/home/dreamtest/dqmsoftware/root-6.14.04/obj/include/ROOT/RVec.hxx:526:1: note: candidates are: template<class T0, class T1> ROOT::VecOps::RVec<decltype ((typename ROOT::VecOps::PromoteTypeImpl<T>::Type() + typename ROOT::VecOps::PromoteTypeImpl<V>::Type()))> ROOT::VecOps::atan2(const T0&, const ROOT::VecOps::RVec<T1>&)
 TVEC_STD_BINARY_FUNCTION(atan2)
 ^
/home/dreamtest/dqmsoftware/root-6.14.04/obj/include/ROOT/RVec.hxx:526:1: note:                 template<class T0, class T1> ROOT::VecOps::RVec<decltype ((typename ROOT::VecOps::PromoteTypeImpl<T>::Type() + typename ROOT::VecOps::PromoteTypeImpl<V>::Type()))> ROOT::VecOps::atan2(const ROOT::VecOps::RVec<T>&, const T1&)
 TVEC_STD_BINARY_FUNCTION(atan2)
 ^
/home/dreamtest/dqmsoftware/root-6.14.04/obj/include/ROOT/RVec.hxx:526:1: note:                 template<class T0, class T1> ROOT::VecOps::RVec<decltype ((typename ROOT::VecOps::PromoteTypeImpl<T>::Type() + typename ROOT::VecOps::PromoteTypeImpl<V>::Type()))> ROOT::VecOps::atan2(const ROOT::VecOps::RVec<T>&, const ROOT::VecOps::RVec<T1>&)
 TVEC_STD_BINARY_FUNCTION(atan2)
 ^
gmake[2]: *** [math/vecops/CMakeFiles/ROOTVecOps.dir/G__ROOTVecOps.cxx.o] Error 1
gmake[1]: *** [math/vecops/CMakeFiles/ROOTVecOps.dir/all] Error 2
gmake: *** [all] Error 2

I searched for previous cases of this problem, and found two solutions here and here, neither of which work for me. The line set_property(GLOBAL APPEND PROPERTY ROOT_BUILTIN_TARGETS VDT) is already present in the correct place in cmake/modules/SearchInstalledSoftware.cmake and when I use the command cmake3 --build . --target VDT the terminal responds with only:

Built target VDT

and further attempts at compiling ROOT after this have the same issue as above. What am I missing for compiling this?

Note that your “gcc” compiler must not come from the “devtoolset”.

Thanks for the quick response. Is there any workaround? Almost all resources I can find for installing different versions of gcc on SL6 involve using devtoolset.

If you have CVMFS, you could try one of the “/cvmfs/sft.cern.ch/lcg/contrib/gcc/” compilers or the “LCG Software Elements”.

So I did manage to solve my problem! Despite the claim that devtoolset won’t work, I managed to compile using it. I had a suspicion it was because of an uncleaned build folder from previous failed attempts with lower versions of gcc, though I was hesitant to try a fresh build because of how long a ROOT build takes. But I created a clean build folder to run a build from scratch using gcc 4.9 and left it running over lunch.

The installation failed on not finding VDT, but I fixed this by going into CMakeCache.txt in the build folder, and editing the line builtin_vdt:BOOL=OFF to ON, then recompiling. This build attempt succeeded and the software I had to install that depended on ROOT also works perfectly.

You will still run into problems if you use anything C++11, like move constructors in std::string or std::chrono etc. But good if if works for you!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.