Fork me on GitHub

Opened 13 years ago

Closed 12 years ago

#42 closed How to (fixed)

compile under MacOSX Lion with self-compiled ROOT

Reported by: Maurizio Pierini Owned by: favereau
Priority: major Milestone:
Component: Delphes code Version:
Keywords: Cc:

Description

Hello

I compiled ROOT on my Mac (running Lion) with the following options

macosx64 --enable-gsl-shared --enable-tmva --enable-roofit --enable-minuit2 --enable-mathmore

and I set the shell environment as

export ROOTSYS=/usr/ROOT/root
export LD_LIBRARY_PATH=${ROOTSYS}/lib
export PYTHONPATH=$ROOTSYS/lib:$PYTHONPATH
export PATH=${PATH}:${ROOTSYS}/bin
export DYLD_LIBRARY_PATH=$ROOTSYS/lib:$DYLD_LIBRARY_PATH

I then tried to compile Delphes 2.0.0

./genMakefile.tcl > Makefile; make

and I get a set of ROOT-related errors, due (apparently) to a mismatch in the architecture

Building lib/libUtilities.so

Undefined symbols for architecture x86_64:

"_gRandom", referenced from:

D_CaloResolution::Smear(float) const in CaloUtil.o
D_CaloTowerList::smearTowers(D_CaloList const&) in CaloUtil.o
VeryForward::time_of_flight(TRootGenParticle*, float, float, float) in VeryForward.o
VeryForward::ZDC(ExRootTreeWriter*, ExRootTreeBranch*, TRootGenParticle*) in VeryForward.o
H_BeamParticle::emitGamma(double, double, double, double) in H_BeamParticle.o

etc etc etc

Do you have any suggestion? Is it possible to compile Delphes without STDHEP support (I use HepMC in any case)?

Thanks

Maurizio

Change History (7)

comment:1 by favereau, 13 years ago

Owner: set to favereau
Status: newassigned

Hi,

It could be that you have to compile Delphes using the same compiler as you used for root (icc i would guess). Could you try that ? It suffices to change gcc to icc in the generated makefile.

Let me know if it helps,

Jerome

comment:2 by Maurizio Pierini, 13 years ago

Hello

Actually I compiled ROOT with gcc 4.2.1 (the Apple version). I just tried also to compile against the
latest default ROOT version compiled with gcc

ftp://root.cern.ch/root/root_v5.32.01.macosx106-x86_64-gcc-4.2.tar.gz

and I see the same feature, both with Delphes 1.9 and 2.0. I tried also to move to a different machine,
also installing Lion, and I have the same problem.
I suspect that the problem is in the architecture. StdHep looks for x86 symbols in the library, while ROOT has
a different architecture (macosx64) and this generates the library mismatch

comment:3 by favereau, 13 years ago

If you don't need stdhep you can remove it from the makefile as a temporary solution. In the meantime i'll try to see what we can do.

comment:5 by favereau, 13 years ago

I don't have a mac with Lion to test, so it's up to you...

comment:6 by pedro.schwaller@…, 12 years ago

I realize this is old, by I ran into the same problem today, and found a rather simple fix. In genMakefile.tcl, make the following change:

ifeq ($(PLATFORM),macosx)
# We need to make both the .dylib and the .so
	@$(LD) $(SOFLAGS) $^ $(OutPutOpt) $@
	@$(LD) -bundle -undefined $(UNDEFOPT) $(LDFLAGS) $^ $(LIBS) $(OutPutOpt) $(subst .$(DllSuf),.so,$@)
else

to

ifeq ($(PLATFORM),macosx64)
# We need to make both the .dylib and the .so
	@$(LD) $(SOFLAGS) $^ $(OutPutOpt) $@
	@$(LD) -bundle -undefined $(UNDEFOPT) $(LDFLAGS) $^ $(LIBS) $(OutPutOpt) $(subst .$(DllSuf),.so,$@)
else

or just add the second piece of code below the first one. The only change is macoxs -> macosx64. Hope this helps.

Pedro

comment:7 by Pavel Demin, 12 years ago

Resolution: fixed
Status: assignedclosed

This problem is now fixed in Delphes 3.

Here is a link to the current version

http://cp3.irmp.ucl.ac.be/downloads/Delphes-3.0.1.tar.gz

Note: See TracTickets for help on using tickets.