This is a fresh Linux install, all I’ve done is install all of ROOT’s prerequisites, CUDA, and CuDNN. I had the same issue with the TMVA part of the build when I tried it on Ubuntu 20.04.
Could the issue be coming from CUDA? When I installed it I installed cuda-11.3.1-1 and cudnn-8.2.1.32-1, but when I run nvidia-smi it says cuda version 11.4. I don’t know if that could have any effect.
From what I’ve found the “/usr/bin/ld” implies there’s something wrong with linking the TMVA library maybe? There’s a lot of errors about
Method*.cxx undefined reference to 'std::__throw_bad_array_new_length()'
and
Method*.cxx undefined reference to 'std::__exception_ptr::exception_ptr::_M_release()'
Here is the full output starting from the linking libTMVA.so step
[ 95%] Linking CXX shared library ../../lib/libTMVA.so
[ 95%] Built target Gviz3d
Consolidate compiler generated dependencies of target Eve
[ 95%] Linking CXX shared library ../../lib/libEve.so
[ 95%] Built target RooFit
[ 95%] Generating G__RooStats.cxx, ../../lib/RooStats.pcm
[ 95%] Generating G__RooFitMore.cxx, ../../lib/RooFitMore.pcm
/usr/bin/ld: CMakeFiles/TMVA.dir/src/BinarySearchTree.cxx.o: in function `std::deque<std::pair<TMVA::BinarySearchTreeNode const*, int>, std::allocator<std::pair<TMVA::BinarySearchTreeNode const*, int> > >::_M_reallocate_map(unsigned long, bool)':
BinarySearchTree.cxx:(.text._ZNSt5dequeISt4pairIPKN4TMVA20BinarySearchTreeNodeEiESaIS5_EE17_M_reallocate_mapEmb[_ZNSt5dequeISt4pairIPKN4TMVA20BinarySearchTreeNodeEiESaIS5_EE17_M_reallocate_mapEmb]+0x197): undefined reference to `std::__throw_bad_array_new_length()'
/usr/bin/ld: CMakeFiles/TMVA.dir/src/BinarySearchTreeNode.cxx.o: in function `TMVA::BinarySearchTreeNode::BinarySearchTreeNode(TMVA::BinarySearchTreeNode const&, TMVA::BinarySearchTreeNode*)':
BinarySearchTreeNode.cxx:(.text+0xd26): undefined reference to `std::__throw_bad_array_new_length()'
/usr/bin/ld: BinarySearchTreeNode.cxx:(.text+0xd66): undefined reference to `std::__throw_bad_array_new_length()'
/usr/bin/ld: CMakeFiles/TMVA.dir/src/Classification.cxx.o: in function `std::_Rb_tree_node<std::pair<unsigned int const, std::vector<std::tuple<float, float, bool>, std::allocator<std::tuple<float, float, bool> > > > >* std::_Rb_tree<unsigned int, std::pair<unsigned int const, std::vector<std::tuple<float, float, bool>, std::allocator<std::tuple<float, float, bool> > > >, std::_Select1st<std::pair<unsigned int const, std::vector<std::tuple<float, float, bool>, std::allocator<std::tuple<float, float, bool> > > > >, std::less<unsigned int>, std::allocator<std::pair<unsigned int const, std::vector<std::tuple<float, float, bool>, std::allocator<std::tuple<float, float, bool> > > > > >::_M_copy<false, std::_Rb_tree<unsigned int, std::pair<unsigned int const, std::vector<std::tuple<float, float, bool>, std::allocator<std::tuple<float, float, bool> > > >, std::_Select1st<std::pair<unsigned int const, std::vector<std::tuple<float, float, bool>, std::allocator<std::tuple<float, float, bool> > > > >, std::less<unsigned int>, std::allocator<std::pair<unsigned int const, std::vector<std::tuple<float, float, bool>, std::allocator<std::tuple<float, float, bool> > > > > >::_Reuse_or_alloc_node>(std::_Rb_tree_node<std::pair<unsigned int const, std::vector<std::tuple<float, float, bool>, std::allocator<std::tuple<float, float, bool> > > > >*, std::_Rb_tree_node_base*, std::_Rb_tree<unsigned int, std::pair<unsigned int const, std::vector<std::tuple<float, float, bool>, std::allocator<std::tuple<float, float, bool> > > >, std::_Select1st<std::pair<unsigned int const, std::vector<std::tuple<float, float, bool>, std::allocator<std::tuple<float, float, bool> > > > >, std::less<unsigned int>, std::allocator<std::pair<unsigned int const, std::vector<std::tuple<float, float, bool>, std::allocator<std::tuple<float, float, bool> > > > > >::_Reuse_or_alloc_node&) [clone .isra.0]':
Classification.cxx:(.text+0x7bc): undefined reference to `std::__throw_bad_array_new_length()'
/usr/bin/ld: Classification.cxx:(.text+0x7cb): undefined reference to `std::__throw_bad_array_new_length()'
/usr/bin/ld: CMakeFiles/TMVA.dir/src/Classification.cxx.o:Classification.cxx:(.text+0x7d5): more undefined references to `std::__throw_bad_array_new_length()' follow
/usr/bin/ld: CMakeFiles/TMVA.dir/src/MethodDNN.cxx.o: in function `std::__future_base::_State_baseV2::_M_break_promise(std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter>)':
MethodDNN.cxx:(.text._ZNSt13__future_base13_State_baseV216_M_break_promiseESt10unique_ptrINS_12_Result_baseENS2_8_DeleterEE[_ZNSt13__future_base13_State_baseV216_M_break_promiseESt10unique_ptrINS_12_Result_baseENS2_8_DeleterEE]+0x17b): undefined reference to `std::__exception_ptr::exception_ptr::_M_release()'
/usr/bin/ld: MethodDNN.cxx:(.text._ZNSt13__future_base13_State_baseV216_M_break_promiseESt10unique_ptrINS_12_Result_baseENS2_8_DeleterEE[_ZNSt13__future_base13_State_baseV216_M_break_promiseESt10unique_ptrINS_12_Result_baseENS2_8_DeleterEE]+0x18a): undefined reference to `std::__exception_ptr::exception_ptr::_M_release()'
/usr/bin/ld: CMakeFiles/TMVA.dir/src/MethodDNN.cxx.o: in function `std::vector<double, std::allocator<double> >::vector(std::vector<double, std::allocator<double> > const&)':
MethodDNN.cxx:(.text._ZNSt6vectorIdSaIdEEC2ERKS1_[_ZNSt6vectorIdSaIdEEC5ERKS1_]+0x8e): undefined reference to `std::__throw_bad_array_new_length()'
/usr/bin/ld: CMakeFiles/TMVA.dir/src/MethodDNN.cxx.o: in function `TMVA::DNN::TNet<TMVA::DNN::TCpu<float>, TMVA::DNN::TLayer<TMVA::DNN::TCpu<float> > >::TNet(TMVA::DNN::TNet<TMVA::DNN::TCpu<float>, TMVA::DNN::TLayer<TMVA::DNN::TCpu<float> > > const&)':
MethodDNN.cxx:(.text._ZN4TMVA3DNN4TNetINS0_4TCpuIfEENS0_6TLayerIS3_EEEC2ERKS6_[_ZN4TMVA3DNN4TNetINS0_4TCpuIfEENS0_6TLayerIS3_EEEC5ERKS6_]+0x100): undefined reference to `std::__throw_bad_array_new_length()'
/usr/bin/ld: CMakeFiles/TMVA.dir/src/MethodDNN.cxx.o: in function `TMVA::DNN::LayerData* std::__uninitialized_copy<false>::__uninit_copy<TMVA::DNN::LayerData const*, TMVA::DNN::LayerData*>(TMVA::DNN::LayerData const*, TMVA::DNN::LayerData const*, TMVA::DNN::LayerData*)':
MethodDNN.cxx:(.text._ZNSt20__uninitialized_copyILb0EE13__uninit_copyIPKN4TMVA3DNN9LayerDataEPS4_EET0_T_S9_S8_[_ZNSt20__uninitialized_copyILb0EE13__uninit_copyIPKN4TMVA3DNN9LayerDataEPS4_EET0_T_S9_S8_]+0x2d6): undefined reference to `std::__throw_bad_array_new_length()'
/usr/bin/ld: MethodDNN.cxx:(.text._ZNSt20__uninitialized_copyILb0EE13__uninit_copyIPKN4TMVA3DNN9LayerDataEPS4_EET0_T_S9_S8_[_ZNSt20__uninitialized_copyILb0EE13__uninit_copyIPKN4TMVA3DNN9LayerDataEPS4_EET0_T_S9_S8_]+0x2e6): undefined reference to `std::__throw_bad_array_new_length()'
/usr/bin/ld: MethodDNN.cxx:(.text._ZNSt20__uninitialized_copyILb0EE13__uninit_copyIPKN4TMVA3DNN9LayerDataEPS4_EET0_T_S9_S8_[_ZNSt20__uninitialized_copyILb0EE13__uninit_copyIPKN4TMVA3DNN9LayerDataEPS4_EET0_T_S9_S8_]+0x2f6): undefined reference to `std::__throw_bad_array_new_length()'
/usr/bin/ld: CMakeFiles/TMVA.dir/src/MethodDNN.cxx.o:MethodDNN.cxx:(.text._ZNSt6vectorIN4TMVA3DNN9LayerDataESaIS2_EE17_M_realloc_insertIJS2_EEEvN9__gnu_cxx17__normal_iteratorIPS2_S4_EEDpOT_[_ZNSt6vectorIN4TMVA3DNN9LayerDataESaIS2_EE17_M_realloc_insertIJS2_EEEvN9__gnu_cxx17__normal_iteratorIPS2_S4_EEDpOT_]+0x4c6): more undefined references to `std::__throw_bad_array_new_length()' follow
/usr/bin/ld: CMakeFiles/TMVA.dir/src/MethodDNN.cxx.o: in function `std::_Function_handler<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> (), std::__future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<double>, std::__future_base::_Result_base::_Deleter>, std::thread::_Invoker<std::tuple<TMVA::DNN::Net::trainCycle<__gnu_cxx::__normal_iterator<Pattern*, std::vector<Pattern, std::allocator<Pattern> > >, TMVA::DNN::Steepest>(TMVA::DNN::Steepest&, std::vector<double, std::allocator<double> >&, __gnu_cxx::__normal_iterator<Pattern*, std::vector<Pattern, std::allocator<Pattern> > >, __gnu_cxx::__normal_iterator<Pattern*, std::vector<Pattern, std::allocator<Pattern> > >, TMVA::DNN::Settings&, std::vector<char, std::allocator<char> >&)::{lambda()#1}> >, double> >::_M_invoke(std::_Any_data const&)':
MethodDNN.cxx:(.text._ZNSt17_Function_handlerIFSt10unique_ptrINSt13__future_base12_Result_baseENS2_8_DeleterEEvENS1_12_Task_setterIS0_INS1_7_ResultIdEES3_ENSt6thread8_InvokerISt5tupleIJZN4TMVA3DNN3Net10trainCycleIN9__gnu_cxx17__normal_iteratorIP7PatternSt6vectorISJ_SaISJ_EEEENSE_8SteepestEEEdRT0_RSL_IdSaIdEET_SV_RNSE_8SettingsERSL_IcSaIcEEEUlvE_EEEEdEEE9_M_invokeERKSt9_Any_data[_ZNSt17_Function_handlerIFSt10unique_ptrINSt13__future_base12_Result_baseENS2_8_DeleterEEvENS1_12_Task_setterIS0_INS1_7_ResultIdEES3_ENSt6thread8_InvokerISt5tupleIJZN4TMVA3DNN3Net10trainCycleIN9__gnu_cxx17__normal_iteratorIP7PatternSt6vectorISJ_SaISJ_EEEENSE_8SteepestEEEdRT0_RSL_IdSaIdEET_SV_RNSE_8SettingsERSL_IcSaIcEEEUlvE_EEEEdEEE9_M_invokeERKSt9_Any_data]+0x443): undefined reference to `std::__exception_ptr::exception_ptr::_M_release()'
/usr/bin/ld: MethodDNN.cxx:(.text._ZNSt17_Function_handlerIFSt10unique_ptrINSt13__future_base12_Result_baseENS2_8_DeleterEEvENS1_12_Task_setterIS0_INS1_7_ResultIdEES3_ENSt6thread8_InvokerISt5tupleIJZN4TMVA3DNN3Net10trainCycleIN9__gnu_cxx17__normal_iteratorIP7PatternSt6vectorISJ_SaISJ_EEEENSE_8SteepestEEEdRT0_RSL_IdSaIdEET_SV_RNSE_8SettingsERSL_IcSaIcEEEUlvE_EEEEdEEE9_M_invokeERKSt9_Any_data[_ZNSt17_Function_handlerIFSt10unique_ptrINSt13__future_base12_Result_baseENS2_8_DeleterEEvENS1_12_Task_setterIS0_INS1_7_ResultIdEES3_ENSt6thread8_InvokerISt5tupleIJZN4TMVA3DNN3Net10trainCycleIN9__gnu_cxx17__normal_iteratorIP7PatternSt6vectorISJ_SaISJ_EEEENSE_8SteepestEEEdRT0_RSL_IdSaIdEET_SV_RNSE_8SettingsERSL_IcSaIcEEEUlvE_EEEEdEEE9_M_invokeERKSt9_Any_data]+0x453): undefined reference to `std::__exception_ptr::exception_ptr::_M_release()'
/usr/bin/ld: CMakeFiles/TMVA.dir/src/MethodDNN.cxx.o: in function `double TMVA::DNN::Net::trainCycle<__gnu_cxx::__normal_iterator<Pattern*, std::vector<Pattern, std::allocator<Pattern> > >, TMVA::DNN::Steepest>(TMVA::DNN::Steepest&, std::vector<double, std::allocator<double> >&, __gnu_cxx::__normal_iterator<Pattern*, std::vector<Pattern, std::allocator<Pattern> > >, __gnu_cxx::__normal_iterator<Pattern*, std::vector<Pattern, std::allocator<Pattern> > >, TMVA::DNN::Settings&, std::vector<char, std::allocator<char> >&)':
MethodDNN.cxx:(.text._ZN4TMVA3DNN3Net10trainCycleIN9__gnu_cxx17__normal_iteratorIP7PatternSt6vectorIS5_SaIS5_EEEENS0_8SteepestEEEdRT0_RS7_IdSaIdEET_SH_RNS0_8SettingsERS7_IcSaIcEE[_ZN4TMVA3DNN3Net10trainCycleIN9__gnu_cxx17__normal_iteratorIP7PatternSt6vectorIS5_SaIS5_EEEENS0_8SteepestEEEdRT0_RS7_IdSaIdEET_SH_RNS0_8SettingsERS7_IcSaIcEE]+0x6bd): undefined reference to `std::__exception_ptr::exception_ptr::_M_addref()'
/usr/bin/ld: MethodDNN.cxx:(.text._ZN4TMVA3DNN3Net10trainCycleIN9__gnu_cxx17__normal_iteratorIP7PatternSt6vectorIS5_SaIS5_EEEENS0_8SteepestEEEdRT0_RS7_IdSaIdEET_SH_RNS0_8SettingsERS7_IcSaIcEE[_ZN4TMVA3DNN3Net10trainCycleIN9__gnu_cxx17__normal_iteratorIP7PatternSt6vectorIS5_SaIS5_EEEENS0_8SteepestEEEdRT0_RS7_IdSaIdEET_SH_RNS0_8SettingsERS7_IcSaIcEE]+0x76a): undefined reference to `std::__exception_ptr::exception_ptr::_M_release()'
/usr/bin/ld: CMakeFiles/TMVA.dir/src/MethodDNN.cxx.o: in function `std::_Function_handler<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> (), std::__future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<std::tuple<double, std::vector<double, std::allocator<double> > > >, std::__future_base::_Result_base::_Deleter>, std::thread::_Invoker<std::tuple<TMVA::DNN::Net::train<TMVA::DNN::Steepest>(std::vector<double, std::allocator<double> >&, std::vector<Pattern, std::allocator<Pattern> >&, std::vector<Pattern, std::allocator<Pattern> > const&, TMVA::DNN::Steepest&, TMVA::DNN::Settings&)::{lambda()#1}> >, std::tuple<double, std::vector<double, std::allocator<double> > > > >::_M_invoke(std::_Any_data const&)':
MethodDNN.cxx:(.text._ZNSt17_Function_handlerIFSt10unique_ptrINSt13__future_base12_Result_baseENS2_8_DeleterEEvENS1_12_Task_setterIS0_INS1_7_ResultISt5tupleIJdSt6vectorIdSaIdEEEEEES3_ENSt6thread8_InvokerIS8_IJZN4TMVA3DNN3Net5trainINSI_8SteepestEEEdRSB_RS9_I7PatternSaISN_EERKSP_RT_RNSI_8SettingsEEUlvE_EEEESC_EEE9_M_invokeERKSt9_Any_data[_ZNSt17_Function_handlerIFSt10unique_ptrINSt13__future_base12_Result_baseENS2_8_DeleterEEvENS1_12_Task_setterIS0_INS1_7_ResultISt5tupleIJdSt6vectorIdSaIdEEEEEES3_ENSt6thread8_InvokerIS8_IJZN4TMVA3DNN3Net5trainINSI_8SteepestEEEdRSB_RS9_I7PatternSaISN_EERKSP_RT_RNSI_8SettingsEEUlvE_EEEESC_EEE9_M_invokeERKSt9_Any_data]+0x19a): undefined reference to `std::__exception_ptr::exception_ptr::_M_release()'
/usr/bin/ld: MethodDNN.cxx:(.text._ZNSt17_Function_handlerIFSt10unique_ptrINSt13__future_base12_Result_baseENS2_8_DeleterEEvENS1_12_Task_setterIS0_INS1_7_ResultISt5tupleIJdSt6vectorIdSaIdEEEEEES3_ENSt6thread8_InvokerIS8_IJZN4TMVA3DNN3Net5trainINSI_8SteepestEEEdRSB_RS9_I7PatternSaISN_EERKSP_RT_RNSI_8SettingsEEUlvE_EEEESC_EEE9_M_invokeERKSt9_Any_data[_ZNSt17_Function_handlerIFSt10unique_ptrINSt13__future_base12_Result_baseENS2_8_DeleterEEvENS1_12_Task_setterIS0_INS1_7_ResultISt5tupleIJdSt6vectorIdSaIdEEEEEES3_ENSt6thread8_InvokerIS8_IJZN4TMVA3DNN3Net5trainINSI_8SteepestEEEdRSB_RS9_I7PatternSaISN_EERKSP_RT_RNSI_8SettingsEEUlvE_EEEESC_EEE9_M_invokeERKSt9_Any_data]+0x1a9): undefined reference to `std::__exception_ptr::exception_ptr::_M_release()'
/usr/bin/ld: CMakeFiles/TMVA.dir/src/MethodDNN.cxx.o: in function `double TMVA::DNN::Net::train<TMVA::DNN::Steepest>(std::vector<double, std::allocator<double> >&, std::vector<Pattern, std::allocator<Pattern> >&, std::vector<Pattern, std::allocator<Pattern> > const&, TMVA::DNN::Steepest&, TMVA::DNN::Settings&)':
MethodDNN.cxx:(.text._ZN4TMVA3DNN3Net5trainINS0_8SteepestEEEdRSt6vectorIdSaIdEERS4_I7PatternSaIS8_EERKSA_RT_RNS0_8SettingsE[_ZN4TMVA3DNN3Net5trainINS0_8SteepestEEEdRSt6vectorIdSaIdEERS4_I7PatternSaIS8_EERKSA_RT_RNS0_8SettingsE]+0x1746): undefined reference to `std::__throw_bad_array_new_length()'
/usr/bin/ld: MethodDNN.cxx:(.text._ZN4TMVA3DNN3Net5trainINS0_8SteepestEEEdRSt6vectorIdSaIdEERS4_I7PatternSaIS8_EERKSA_RT_RNS0_8SettingsE[_ZN4TMVA3DNN3Net5trainINS0_8SteepestEEEdRSt6vectorIdSaIdEERS4_I7PatternSaIS8_EERKSA_RT_RNS0_8SettingsE]+0x19d6): undefined reference to `std::__exception_ptr::exception_ptr::_M_addref()'
/usr/bin/ld: MethodDNN.cxx:(.text._ZN4TMVA3DNN3Net5trainINS0_8SteepestEEEdRSt6vectorIdSaIdEERS4_I7PatternSaIS8_EERKSA_RT_RNS0_8SettingsE[_ZN4TMVA3DNN3Net5trainINS0_8SteepestEEEdRSt6vectorIdSaIdEERS4_I7PatternSaIS8_EERKSA_RT_RNS0_8SettingsE]+0x1d1d): undefined reference to `std::__exception_ptr::exception_ptr::_M_release()'
/usr/bin/ld: CMakeFiles/TMVA.dir/src/MethodKNN.cxx.o: in function `std::vector<float, std::allocator<float> >::operator=(std::vector<float, std::allocator<float> > const&) [clone .isra.0]':
MethodKNN.cxx:(.text+0x1d6): undefined reference to `std::__throw_bad_array_new_length()'
/usr/bin/ld: CMakeFiles/TMVA.dir/src/MethodKNN.cxx.o: in function `TMVA::MethodKNN::GetRegressionValues()':
MethodKNN.cxx:(.text+0xc5f): undefined reference to `std::__throw_bad_array_new_length()'
/usr/bin/ld: MethodKNN.cxx:(.text+0xdd5): undefined reference to `std::__throw_bad_array_new_length()'
/usr/bin/ld: CMakeFiles/TMVA.dir/src/MethodKNN.cxx.o: in function `TMVA::MethodKNN::Train()':
MethodKNN.cxx:(.text+0x2343): undefined reference to `std::__throw_bad_array_new_length()'
/usr/bin/ld: MethodKNN.cxx:(.text+0x234d): undefined reference to `std::__throw_bad_array_new_length()'
/usr/bin/ld: CMakeFiles/TMVA.dir/src/MethodKNN.cxx.o:MethodKNN.cxx:(.text+0x322b): more undefined references to `std::__throw_bad_array_new_length()' follow
collect2: error: ld returned 1 exit status
make[2]: *** [tmva/tmva/CMakeFiles/TMVA.dir/build.make:2843: lib/libTMVA.so] Error 1
make[1]: *** [CMakeFiles/Makefile2:35426: tmva/tmva/CMakeFiles/TMVA.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 96%] Built target Eve
Scanning dependencies of target G__RooFitMore
Consolidate compiler generated dependencies of target G__RooFitMore
[ 96%] Building CXX object roofit/roofitmore/CMakeFiles/G__RooFitMore.dir/G__RooFitMore.cxx.o
Scanning dependencies of target G__RooStats
Consolidate compiler generated dependencies of target G__RooStats
[ 96%] Building CXX object roofit/roostats/CMakeFiles/G__RooStats.dir/G__RooStats.cxx.o
[ 96%] Built target G__RooFitMore
[ 96%] Built target G__RooStats
make: *** [Makefile:156: all] Error 2
~/root/root-6.24.02/root_bld $
If I ignore these errors and finish building ROOT, I can tab completing after typing TMVA:: and it gives an error followed (after a few seconds) by a list of options
root [0] TMVA::Error in <TInterpreter::TCling::AutoLoad>: failure loading library libTMVA.so for TMVA
Error in <TInterpreter::TCling::AutoLoad>: failure loading library libTMVA.so for TMVA
Error in <TInterpreter::TCling::AutoLoad>: failure loading library libTMVA.so for TMVA
AbsValue
AbsoluteDeviationLossFunction
AbsoluteDeviationLossFunctionBDT
ActionButton
BDT
etc...