Hello,
I am trying to compile a small macro with RBDT but it fails at the linking step.
A minimal example is
#include "TMVA/RBDT.hxx"
int main(){
TMVA::Experimental::RBDT bdt("BDT", "BDT.root");
return 0;
}
g++ -g -Wall -O2 -I include/ -L/cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02850/el8_amd64_gcc12/cms/cmssw/CMSSW_14_1_ROOT632_X_2024-08-12-2300/external/el8_amd64_gcc12/bin/../../../../../../../el8_amd64_gcc12/lcg/root/6.32.03-3849c08f5a8ba30a033cbca63b92986a/lib -lCore -lImt -lRIO -lNet -lHist -lGraf -lGraf3d -lGpad -lROOTVecOps -lTree -lTreePlayer -lRint -lPostscript -lMatrix -lPhysics -lMathCore -lThread -lMultiProc -lROOTDataFrame -Wl,-rpath,/cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02850/el8_amd64_gcc12/cms/cmssw/CMSSW_14_1_ROOT632_X_2024-08-12-2300/external/el8_amd64_gcc12/bin/../../../../../../../el8_amd64_gcc12/lcg/root/6.32.03-3849c08f5a8ba30a033cbca63b92986a/lib -pthread -lm -ldl -rdynamic -pthread -std=c++20 -m64 -I/cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02850/el8_amd64_gcc12/cms/cmssw/CMSSW_14_1_ROOT632_X_2024-08-12-2300/external/el8_amd64_gcc12/bin/../../../../../../../el8_amd64_gcc12/lcg/root/6.32.03-3849c08f5a8ba30a033cbca63b92986a/include -lMLP -lMinuit -lTreePlayer -lTMVA -lXMLIO -lMLP -lm -c MVA.cpp -o build/MVA.o
g++ -g -Wall -O2 -I include/ -L/cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02850/el8_amd64_gcc12/cms/cmssw/CMSSW_14_1_ROOT632_X_2024-08-12-2300/external/el8_amd64_gcc12/bin/../../../../../../../el8_amd64_gcc12/lcg/root/6.32.03-3849c08f5a8ba30a033cbca63b92986a/lib -lCore -lImt -lRIO -lNet -lHist -lGraf -lGraf3d -lGpad -lROOTVecOps -lTree -lTreePlayer -lRint -lPostscript -lMatrix -lPhysics -lMathCore -lThread -lMultiProc -lROOTDataFrame -Wl,-rpath,/cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02850/el8_amd64_gcc12/cms/cmssw/CMSSW_14_1_ROOT632_X_2024-08-12-2300/external/el8_amd64_gcc12/bin/../../../../../../../el8_amd64_gcc12/lcg/root/6.32.03-3849c08f5a8ba30a033cbca63b92986a/lib -pthread -lm -ldl -rdynamic -pthread -std=c++20 -m64 -I/cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02850/el8_amd64_gcc12/cms/cmssw/CMSSW_14_1_ROOT632_X_2024-08-12-2300/external/el8_amd64_gcc12/bin/../../../../../../../el8_amd64_gcc12/lcg/root/6.32.03-3849c08f5a8ba30a033cbca63b92986a/include -lMLP -lMinuit -lTreePlayer -lTMVA -lXMLIO -lMLP -lm build/MVA.o -o bin/runMVA
/cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02850/el8_amd64_gcc12/external/gcc/12.3.1-40d504be6370b5a30e3947a6e575ca28/bin/../lib/gcc/x86_64-redhat-linux-gnu/12.3.1/../../../../x86_64-redhat-linux-gnu/bin/ld: build/MVA.o: in function `main':
/home/users/aaarora/mva/MVA.cpp:32: undefined reference to `TMVA::Experimental::RBDT::RBDT(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
collect2: error: ld returned 1 exit status
If I manually compile RBDT.cxx and link it, then everything works fine, so my guess is that a shared object file is missing somewhere or I am missing a flag.
Could you please take a look at this? Thank you!