libRooFit.so Fails to Compile

I am attempting to compile from the ROOT Git repository commit ID :

I have used the following command to configure and make the code:

./configure --enable-roofit --enable-minuit2  --enable-soversion --enable-cxx11
make -j3

I am compiling the code with gcc 4.9.2 20150204 under ArchLinux. The compilation fails when trying to compile the shared object for RooFit. The error message follows.

roofit/roofit/src/RooTFnBinding.o: In function `RooTFnBinding::evaluate() const':
RooTFnBinding.cxx:(.text+0x123): undefined reference to `TFormula::SetParameter(int, double)'
roofit/roofit/src/RooTFnBinding.o: In function `TF1::SetParameter(int, double)':
RooTFnBinding.cxx:(.text._ZN3TF112SetParameterEid[_ZN3TF112SetParameterEid]+0x10): undefined reference to `TFormula::SetParameter(int, double)'
collect2: error: ld returned 1 exit status
root/roofit/roofit/Module.mk:45: recipe for target 'lib/libRooFit.so' failed
make: *** [lib/libRooFit.so] Error 1
make: *** Waiting for unfinished jobs....

I notice that a few commits back there’s a note about a fix to “test/stress.cxx” for the new TFormula. I suspect this error possibly related to the new TFormula.

Hi,

This error is strange. Are you trying a clean build of ROOT, or did you just update from git ?
If that is the case, maybe try to start from a clean build

Best Regards
Lorenzo

For the attempt in the previous post I just did a pull from the git repository.

Following your thoughts, I deleted the local repository and downloaded a fresh one with

git clone http://root.cern.ch/git/root.git root

I then used the following command to configure and compile:

./configure --enable-roofit --enable-minuit2  --enable-soversion  --prefix=/home/install/path && make -j3 && make install

The code again fails in the same location:

roofit/roofit/src/RooTFnBinding.o: In function `RooTFnBinding::evaluate() const':
RooTFnBinding.cxx:(.text+0x123): undefined reference to `TFormula::SetParameter(int, double)'
roofit/roofit/src/RooTFnBinding.o: In function `TF1::SetParameter(int, double)':
RooTFnBinding.cxx:(.text._ZN3TF112SetParameterEid[_ZN3TF112SetParameterEid]+0x10): undefined reference to `TFormula::SetParameter(int, double)'
collect2: error: ld returned 1 exit status
root/roofit/roofit/Module.mk:45: recipe for target 'lib/libRooFit.so' failed
make: *** [lib/libRooFit.so] Error 1
make: *** Waiting for unfinished jobs....

I have also tried to build the program with the following command:

./configure --enable-roofit --enable-minuit2  --prefix=/home/install/path && make -j3 && make install

The compilation fails with the same error.

Hi,

It is maybe a problem with library dependency and we must add explicitly libHist in the list of linking library used by libRooFit.
Can you maybe try to build with CMake

cmake …/root_source_dir -Droofit=ON -Dminuit2=ON

Best Regards

Lorenzo

Hi,

It’s now fixed in the master. If you are on the master, git pull; make should help!

I could not find commit da93753fbf11e640e0dbe81b5a58f0f4c13053e6 - is that on the master?

Cheers, Axel.

Axel,

I just realized that you are correct in questioning that commit ID. It probably isn’t in the master build. I recall that I made a tweak in one of my files related to this post : [url]Compilation error in TTimeStamp This change was committed in my local repository, which offset me slightly from the main one.

I have pulled the latest commit and made with cmake as suggested.

 cmake /path/to/sources/root -Droofit=ON -Dminuit2=ON -Dsoversion=ON -DCMAKE_INSTALL_PREFIX=/install/path/

The program has successfully installed and currently running. Thanks for the assistance!