Trouble with Root 5.30.06 on Ubuntu 10.04.3

Hi,

I had trouble compiling Root v5.30.06 on Ubuntu 10.04.3. At first, the “make” step would crash, however after disabling xrootd, it finally worked. But when trying to compile one of my macros, I now get the error

/home/thomas/root/lib/libRooFitCore.so: undefined reference to `vtable for TFoamIntegrand'
/home/thomas/root/lib/libRooFitCore.so: undefined reference to `TFoamIntegrand::ShowMembers(TMemberInspector&)'
/home/thomas/root/lib/libRooFitCore.so: undefined reference to `TFitter::TFitter(int)'
/home/thomas/root/lib/libRooFitCore.so: undefined reference to `TFoam::TFoam(char const*)'
/home/thomas/root/lib/libRooFitCore.so: undefined reference to `typeinfo for TFoamIntegrand'
/home/thomas/root/lib/libRooFitCore.so: undefined reference to `gMinuit'
/home/thomas/root/lib/libRooFit.so: undefined reference to `ROOT::Math::assoc_legendre(unsigned int, unsigned int, double)'
/home/thomas/root/lib/libRooFit.so: undefined reference to `ROOT::Math::noncentral_chisquared_pdf(double, double, double)'
collect2: ld returned 1 exit status
make: *** [WAnalysisTrigCorrv5] Error 1

This doesn’t happen on lxplus (with the same root version) nor on my local machine with v5.32.00-patches. I need Root v5.30.xx, however, due to memory leak issues in Roofit for other versions (only RooFit 3.17 works with my code). Any help on this is appreciated.

[url]Installing ROOT from Source
[url]Linking problem to libTree.so
[url]ROOT 5.32/00 support

Hi,

I have tried what was suggested on the links you provided (thank you), but I am still getting the same problem when compiling.

/home/thomas/root/lib/libRooFitCore.so: undefined reference to `vtable for TFoamIntegrand'
/home/thomas/root/lib/libRooFitCore.so: undefined reference to `TFoamIntegrand::ShowMembers(TMemberInspector&)'
/home/thomas/root/lib/libRooFitCore.so: undefined reference to `TFitter::TFitter(int)'
/home/thomas/root/lib/libRooFitCore.so: undefined reference to `TFoam::TFoam(char const*)'
/home/thomas/root/lib/libRooFitCore.so: undefined reference to `typeinfo for TFoamIntegrand'
/home/thomas/root/lib/libRooFitCore.so: undefined reference to `gMinuit'
/home/thomas/root/lib/libRooFit.so: undefined reference to `ROOT::Math::assoc_legendre(unsigned int, unsigned int, double)'
/home/thomas/root/lib/libRooFit.so: undefined reference to `ROOT::Math::noncentral_chisquared_pdf(double, double, double)'
collect2: ld returned 1 exit status
make: *** [WAnalysisTrigCorrv5] Error 1

however,

$ ls /etc/ | grep root
gives me

root
su-to-rootrc

but I used the package manager to uninstall anything affiliated with the Ubuntu root version (i.e. it seems like any v5.18.00 software has been removed). Would you suggest deleting this root subdirectory as well?

Well, in general you should have “completely removed” (i.e. “remove with any associated configuration files”) all standard Ubuntu’s ROOT packages (this would also remove the “/etc/root” subdirectory).
For now, you could simply “sudo rm -rf /etc/root” (but do not touch the “/etc/su-to-rootrc” file).

How do you configure your ROOT?
Do you use “–prefix”? If yes, remember to add “–etcdir” (otherwise it defaults to “/etc/root”, no matter what your “prefix” is).
If you configure your ROOT without “–prefix” then the “/etc/root” subdirectory should not make you any problems (even if it exists and contains “outdated” contents - it’s not used in this case at all).

If you post any simple source code which demonstrates your problem, I could try to compile/link it on my system (Ubuntu 10.04.4 LTS i686).

No, I do not use “–prefix”, so this has no effect on the issue. However, I did notice that the CINT interpreter is version 5.18.00

 *******************************************
  *                                         *
  *        W E L C O M E  to  R O O T       *
  *                                         *
  *   Version   5.30/06   10 January 2012   *
  *                                         *
  *  You are welcome to visit our Web site  *
  *          http://root.cern.ch            *
  *                                         *
  *******************************************

ROOT 5.30/06 (tags/v5-30-06@42590, Mar 12 2012, 15:49:20 on linux)

CINT/ROOT C/C++ Interpreter version 5.18.00, July 2, 2010
Type ? for help. Commands must be C++ statements.
Enclose multiple statements between { }.

would this have anything to do with it?

The CINT version is expected to be 5.18.00 (even in the newest ROOT 5.32/01).

By checking other posts, it sounds like I have to link a few libraries.
[url]Failed compilation from RooFit since ROOTv5.28
In the /root/Makefile, I tried

ROOTLIBS     := $(BOOTLIBS) -lRIO -lNet -lHist -lGraf -lGraf3d -lGpad \
                -lTree -lMatrix -lThread -lMinuit -lFoam -lRooFit -lRooFitCore -lMathMore

However, this didn’t work as it did for others. Am I linking these libraries correctly?

Try:
root-config --libs
root-config --glibs
root-config --evelibs
Take the “most complete” that suits your needs and simply add the “missing” ones.

I’m telling you … give me a “workinig example” of your problem and I will try to get it working, too. :mrgreen:
Or at least one should precisely check the “linking step” … :-k

I’ve got an idea … there exists the “${ROOTSYS}/test/stressRooFit.cxx”.
See the “{ROOTSYS}/test/Makefile” for appropriate flags.
Try to compile and link the ROOT “test” applications … simply “cd test” and type “make”.
It seems to me that what you need is:
ROOTLIBS := $(shell root-config --libs) -lRooFit -lRooFitCore -lHtml -lThread -lMinuit -lFoam -lMathMore

Here is the content of the Makefile I am using.

#CC        = /afs/cern.ch/sw/lcg/external/gcc/4.3.2/x86_64/bin/g++
CC        = /usr/bin/g++
CCFLAGS   = -Wall -g
INCS      = `root-config --cflags` -I.
LIBS      = `root-config --libs` -lRooFit -lRooFitCore -lRooStats

WAnalysisTrigCorrv5 : WAnalysisTrigCorrv5.C flavourFitterHIDepTrigCorrv2.o RooShiftedKeysPdf.o Dict.o
	$(CC) $(CCFLAGS) $< RooShiftedKeysPdf.o Dict.o -o $@ $(INCS) $(LIBS)

flavourFitterHI : flavourFitterHI.C flavourFitterHIDepTrigCorrv2.o RooShiftedKeysPdf.o Dict.o
	$(CC) $(CCFLAGS) $< RooShiftedKeysPdf.o Dict.o -o $@ $(INCS) $(LIBS)

flavourFitterHIDepTrigCorrv2 : flavourFitterHIDepTrigCorrv2.C RooShiftedKeysPdf.o Dict.o
	$(CC) $(CCFLAGS) $< RooShiftedKeysPdf.o Dict.o -o $@ $(INCS) $(LIBS)

flavourFitterHIDepTrigCorrv2.o : flavourFitterHIDepTrigCorrv2.C
	$(CC) $(CCFLAGS) -c $< $(INCS) $(LIBS)

RooShiftedKeysPdf.o : RooShiftedKeysPdf.cxx RooShiftedKeysPdf.h
	$(CC) $(CCFLAGS) -c $< $(INCS) $(LIBS)

#AtlasUtils.o : ${HOME}/atlasstyle-00-03-04/AtlasUtils.C 
AtlasUtils.o : ${TestArea}/HeavyIonSingleMuons2011/code/AtlasUtils.C 
	$(CC) $(CCFLAGS) -c $< $(INCS) $(LIBS)

Dict.o : Dict.cxx
	$(CC) $(CCFLAGS) -c $< $(INCS) $(LIBS)

Dict.cxx : RooShiftedKeysPdf.h
	rootcint -f $@ -c $<+

clean : 
	rm -f flavourFitterHIDepTrigCorrv2 WAnalysisTrigCorrv5 RooShiftedKeysPdf.o Dict.o Dict.cxx Dict.h
	rm -f flavourFitterHIDepTrigCorrv2 RooShiftedKeysPdf.o Dict.o Dict.cxx Dict.h
# 	rm -f flavourFitterHIDepTrigCorrv2 RooShiftedKeysPdf.o Dict.o Dict.cxx Dict.h

Actually, by linking the libraries using this Makefile, everything seems to be working. Thank you for all your help!

That means you have it working now? Or should I still try to compile and link it myself?

I have it working. Thanks again.