Home | News | Documentation | Download

(SOLVED)Undefiend GSLMinimizer.h

Hi all,
I am trying to build a secondary program (NUISANCE) based off of ROOT and I keep getting the error(s):

Error(s)
/home/tejpal/programs/GENIE/Generator/lib/libGPhDcy.so: undefined reference to `ROOT::Math::GSLMinimizer::NCalls() const'
/home/tejpal/programs/GENIE/Generator/lib/libGPhDcy.so: undefined reference to `ROOT::Math::GSLMinimizer::~GSLMinimizer()'
/home/tejpal/programs/GENIE/Generator/lib/libGPhDcy.so: undefined reference to `ROOT::Math::GSLMinimizer::Minimize()'
/home/tejpal/programs/GENIE/Generator/lib/libGPhDcy.so: undefined reference to `ROOT::Math::GSLMinimizer::GSLMinimizer(ROOT::Math::EGSLMinimizerType)'
/home/tejpal/programs/GENIE/Generator/lib/libGPhDcy.so: undefined reference to `ROOT::Math::GSLMinimizer::SetFunction(ROOT::Math::IBaseFunctionMultiDimTempl<double> const&)'
collect2: error: ld returned 1 exit status
app/CMakeFiles/nuisbac.dir/build.make:119: recipe for target 'app/nuisbac' failed
make[2]: *** [app/nuisbac] Error 1
CMakeFiles/Makefile2:1625: recipe for target 'app/CMakeFiles/nuisbac.dir/all' failed
make[1]: *** [app/CMakeFiles/nuisbac.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
/home/tejpal/programs/GENIE/Generator/lib/libGPhDcy.so: undefined reference to `ROOT::Math::GSLMinimizer::NCalls() const'
/home/tejpal/programs/GENIE/Generator/lib/libGPhDcy.so: undefined reference to `ROOT::Math::GSLMinimizer::~GSLMinimizer()'
/home/tejpal/programs/GENIE/Generator/lib/libGPhDcy.so: undefined reference to `ROOT::Math::GSLMinimizer::Minimize()'
/home/tejpal/programs/GENIE/Generator/lib/libGPhDcy.so: undefined reference to `ROOT::Math::GSLMinimizer::GSLMinimizer(ROOT::Math::EGSLMinimizerType)'
/home/tejpal/programs/GENIE/Generator/lib/libGPhDcy.so: undefined reference to `ROOT::Math::GSLMinimizer::SetFunction(ROOT::Math::IBaseFunctionMultiDimTempl<double> const&)'
collect2: error: ld returned 1 exit status
app/CMakeFiles/DumpGiBUUEvents.dir/build.make:119: recipe for target 'app/DumpGiBUUEvents' failed
make[2]: *** [app/DumpGiBUUEvents] Error 1
CMakeFiles/Makefile2:1564: recipe for target 'app/CMakeFiles/DumpGiBUUEvents.dir/all' failed
make[1]: *** [app/CMakeFiles/DumpGiBUUEvents.dir/all] Error 2
/home/tejpal/programs/GENIE/Generator/lib/libGPhDcy.so: undefined reference to `ROOT::Math::GSLMinimizer::NCalls() const'
/home/tejpal/programs/GENIE/Generator/lib/libGPhDcy.so: undefined reference to `ROOT::Math::GSLMinimizer::~GSLMinimizer()'
/home/tejpal/programs/GENIE/Generator/lib/libGPhDcy.so: undefined reference to `ROOT::Math::GSLMinimizer::Minimize()'
/home/tejpal/programs/GENIE/Generator/lib/libGPhDcy.so: undefined reference to `ROOT::Math::GSLMinimizer::GSLMinimizer(ROOT::Math::EGSLMinimizerType)'
/home/tejpal/programs/GENIE/Generator/lib/libGPhDcy.so: undefined reference to `ROOT::Math::GSLMinimizer::SetFunction(ROOT::Math::IBaseFunctionMultiDimTempl<double> const&)'
collect2: error: ld returned 1 exit status
app/CMakeFiles/PrepareGENIE.dir/build.make:119: recipe for target 'app/PrepareGENIE' failed
make[2]: *** [app/PrepareGENIE] Error 1
CMakeFiles/Makefile2:1503: recipe for target 'app/CMakeFiles/PrepareGENIE.dir/all' failed
make[1]: *** [app/CMakeFiles/PrepareGENIE.dir/all] Error 2
/home/tejpal/programs/GENIE/Generator/lib/libGPhDcy.so: undefined reference to `ROOT::Math::GSLMinimizer::NCalls() const'
/home/tejpal/programs/GENIE/Generator/lib/libGPhDcy.so: undefined reference to `ROOT::Math::GSLMinimizer::~GSLMinimizer()'
/home/tejpal/programs/GENIE/Generator/lib/libGPhDcy.so: undefined reference to `ROOT::Math::GSLMinimizer::Minimize()'
/home/tejpal/programs/GENIE/Generator/lib/libGPhDcy.so: undefined reference to `ROOT::Math::GSLMinimizer::GSLMinimizer(ROOT::Math::EGSLMinimizerType)'
/home/tejpal/programs/GENIE/Generator/lib/libGPhDcy.so: undefined reference to `ROOT::Math::GSLMinimizer::SetFunction(ROOT::Math::IBaseFunctionMultiDimTempl<double> const&)'
collect2: error: ld returned 1 exit status
app/CMakeFiles/nuissmear.dir/build.make:119: recipe for target 'app/nuissmear' failed
make[2]: *** [app/nuissmear] Error 1
CMakeFiles/Makefile2:1686: recipe for target 'app/CMakeFiles/nuissmear.dir/all' failed
make[1]: *** [app/CMakeFiles/nuissmear.dir/all] Error 2
Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2

It seems that GSLMinimizer has not been defined(?) How would I go about fixing this error? I have almost no prior knowledge of ROOT or Linux so the more thorough the explanation the more I’d appreciate it.
If it matters my cmake command was

cmake -Dmathmore=ON -Dpythia6=ON ~/tejpal/programs/pythia6/v6_428/lib/libPythia6.so -Dgsl_shared=ON ../root

If there is any more information that is needed please let me know

Thanks!

ROOT Version: 6.18/04
Platform: Ubuntu 18.04.3 LTS
Compiler: GNU Make 4.1


Try: root-config --features

That returns this,

cxx11 asimage astiff builtin_afterimage builtin_clang builtin_ftgl builtin_gl2ps builtin_glew builtin_llvm builtin_lz4 builtin_lzma builtin_tbb builtin_vdt builtin_xxhash clad cling exceptions explicitlink fftw3 fitsio gdml gsl_shared http imt mathmore minuit2 mysql opengl pch pythia6 python roofit shared ssl thread tmva tmva-cpu vdt x11 xml

I made sure to enable mathmore and minuit2 before attempting to build nuisance and after coming across this error I added gsl_shared thinking that might be the error but to no avail.

When linking your executable, try to add “-lMathMore”.

Sorry, I’ve been using ROOT and Linux for less then a week. Could you explain what you mean by when linking my executable.

Try to edit the “nuisance/cmake/ROOTSetup.cmake” file and add “MathMore” e.g. after “MathCore” (then you will need to reconfigure and rebuild “nuisance” from scratch).

1 Like

It worked! We’ve been trying to figure this out for a while and nothing we’ve found worked. Thank you!!!