Fork me on GitHub

Opened 10 years ago

Last modified 10 years ago

#375 new Enhancement

CMake for Delphes for root version 5.34.20

Reported by: michele de gruttola Owned by:
Priority: minor Milestone:
Component: Delphes miscellaneous Version: Delphes 3
Keywords: Cc:

Description (last modified by Pavel Demin)

Hi,

I was trying to build delphes (3.2.0) with cmake following the tickets
https://cp3.irmp.ucl.ac.be/projects/delphes/ticket/313

what I did is

mkdir build
cd build
export PATH=/afs/cern.ch/sw/lcg/contrib/CMake/2.8.9/Linux-i386/bin:${PATH}
source /afs/cern.ch/sw/lcg/external/gcc/4.8.1/x86_64-slc6/setup.sh
source /afs/cern.ch/exp/fcc/sw/0.2/ROOT/5.34.19/x86_64-slc6-gcc48-dbg/bin/thisroot.sh 
cmake -DCMAKE_INSTALL_PREFIX:PATH=../install ../sources

where in source there is the plain Delphes3.2.0 which as hfar as I understand conttains already the opatches provided by Benedikt.

but at make level I get the error

make
[  6%] Built target classes
[ 10%] Built target display
[ 10%] Generating ModulesDict.cxx, ModulesDict.h
Error: /afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.20/x86_64-slc6-gcc48-opt/root/bin/rootcint: /afs/cern.ch/work/d/degrutto/private/FCC-EDM/fcc-edm/delphes/modules/FastJetLinkDef.h must be last file on command line
make[2]: *** [modules/ModulesDict.cxx] Error 1
make[1]: *** [modules/CMakeFiles/modules.dir/all] Error 2
make: *** [all] Error 2

I see maybe the last version is intended to work in root 6,
but how can I get the build with root version 5.34.20

thanks,

Michele

Change History (5)

comment:1 by Pavel Demin, 10 years ago

Description: modified (diff)

Dear Michele,

Thank you for spotting this problem.

Recently, I added modules/FastJetLinkDef.h and forgot to update modules/CMakeLists.txt.

I've just committed a fixed version of this file to the Delphes code repository. You can find this new version at

https://cp3.irmp.ucl.ac.be/projects/delphes/browser/git/modules/CMakeLists.txt

Regards,

Pavel

comment:2 by michele de gruttola, 10 years ago

Hi Pavel,

thanks for the reply,

I confirm I can go on in the compilation with this fix, but going on I get the error below,
any idea?

thanks

Michele

build]$ make
-- The C compiler identification is GNU 4.8.1
-- The CXX compiler identification is GNU 4.8.1
-- Check for working C compiler: /afs/cern.ch/sw/lcg/contrib/gcc/4.8.1/x86_64-slc6-gcc48-opt/bin/gcc
-- Check for working C compiler: /afs/cern.ch/sw/lcg/contrib/gcc/4.8.1/x86_64-slc6-gcc48-opt/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /afs/cern.ch/sw/lcg/contrib/gcc/4.8.1/x86_64-slc6-gcc48-opt/bin/c++
-- Check for working CXX compiler: /afs/cern.ch/sw/lcg/contrib/gcc/4.8.1/x86_64-slc6-gcc48-opt/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Found GCC. Major version 4, minor version 8
-- CMAKE_BUILD_TYPE: RelWithDebInfo
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found.
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Found a 64bit system
-- Found GNU compiler collection
-- ROOT Platform: linux
-- ROOT Architecture: linuxx8664gcc
-- Build Type: RelWithDebInfo
-- Compiler Flags: -fPIC -DDROP_CGAL -pipe -m64 -Wall -W -Woverloaded-virtual -fPIC -pthread
-- Configuring done
-- Generating done
-- Build files have been written to: /afs/cern.ch/work/d/degrutto/private/FCC-EDM/fcc-edm/build
[ 6%] Built target classes
[ 19%] Built target Hector
[ 32%] Built target tcl
[ 47%] Built target modules
[ 87%] Built target fastjet
[ 92%] Built target ExRootAnalysis
[ 96%] Built target display
Scanning dependencies of target Delphes
Linking CXX shared library libDelphes.so
modules/CMakeFiles/modules.dir/FastJetFinder.cc.o: In function `FastJetFinder::IsA() const':
/afs/cern.ch/work/d/degrutto/private/FCC-EDM/fcc-edm/delphes/modules/FastJetFinder.h:119: undefined reference to `FastJetFinder::Class()'
modules/CMakeFiles/modules.dir/FastJetFinder.cc.o:(.data.rel.ro._ZTV13FastJetFinder[_ZTV13FastJetFinder]+0x1d0): undefined reference to `FastJetFinder::ShowMembers(TMemberInspector&)'
modules/CMakeFiles/modules.dir/FastJetFinder.cc.o:(.data.rel.ro._ZTV13FastJetFinder[_ZTV13FastJetFinder]+0x1d8): undefined reference to `FastJetFinder::Streamer(TBuffer&)'
display/CMakeFiles/display.dir/DisplayDict.cxx.o: In function `GDisplayDict_590_0_4(Gvalue*, char const*, Gparam*, int)':
/afs/cern.ch/work/d/degrutto/private/FCC-EDM/fcc-edm/build/display/DisplayDict.cxx:973: undefined reference to `Delphes3DGeometry::save(char const*, char const*)'
display/CMakeFiles/display.dir/DisplayDict.cxx.o: In function `G
DisplayDict_590_0_3(Gvalue*, char const*, Gparam*, int)':
/afs/cern.ch/work/d/degrutto/private/FCC-EDM/fcc-edm/build/display/DisplayDict.cxx:958: undefined reference to `Delphes3DGeometry::loadFromFile(char const*, char const*)'
modules/CMakeFiles/modules.dir/FastJetGridMedianEstimator.cc.o: In function `FastJetGridMedianEstimator::IsA() const':
/afs/cern.ch/work/d/degrutto/private/FCC-EDM/fcc-edm/delphes/modules/FastJetGridMedianEstimator.h:62: undefined reference to `FastJetGridMedianEstimator::Class()'
modules/CMakeFiles/modules.dir/FastJetGridMedianEstimator.cc.o:(.data.rel.ro._ZTV26FastJetGridMedianEstimator[_ZTV26FastJetGridMedianEstimator]+0x1d0): undefined reference to `FastJetGridMedianEstimator::ShowMembers(TMemberInspector&)'
modules/CMakeFiles/modules.dir/FastJetGridMedianEstimator.cc.o:(.data.rel.ro._ZTV26FastJetGridMedianEstimator[_ZTV26FastJetGridMedianEstimator]+0x1d8): undefined reference to `FastJetGridMedianEstimator::Streamer(TBuffer&)'
collect2: error: ld returned 1 exit status
make[2]: * [libDelphes.so] Error 1
make[1]:
* [CMakeFiles/Delphes.dir/all] Error 2
make: * [all] Error 2

Version 0, edited 10 years ago by michele de gruttola (next)

comment:3 by Pavel Demin, 10 years ago

Hi Michele,

I've just tried to build Delphes on lxplus using cmake and I've got a very similar error message.

Looks like there are two unimplemented methods in display/Delphes3DGeometry.h:

void loadFromFile(const char* filename, const char* name="DelphesGeometry");

void save(const char* filename, const char* name="DelphesGeometry");

After removing them, I could build Delphes without any other errors.

Here are the commands that I used:

export PATH=/afs/cern.ch/sw/lcg/contrib/CMake/2.8.9/Linux-i386/bin:${PATH}
source /afs/cern.ch/sw/lcg/external/gcc/4.8.1/x86_64-slc6/setup.sh
source /afs/cern.ch/exp/fcc/sw/0.2/ROOT/5.34.19/x86_64-slc6-gcc48-dbg/bin/thisroot.sh

wget https://github.com/delphes/delphes/archive/master.tar.gz
tar zxf master.tar.gz

sed -i '/save/d; /loadFromFile/d' delphes-master/display/Delphes3DGeometry.h

mkdir build
cd build

cmake ../delphes-master
make -j 4

I'll try to put together a new minor release with all these fixes by the end of this week.

Cheers,

Pavel

comment:4 by michele de gruttola, 10 years ago

Hi Pavel,

sorry I should have write you yesterday.. I arrived at the same conclusion of having to comment the two methods in /Delphes3DGeometry.h and got the compilation successful,

thanks so much for the help!

Now, if I may ask further... I hoped the cmake + make would have created a "findDelphes.cmake" so that I could include/combine delphes with another binary doing other things, but apparently it is not,
was this functionality not intended?

thanks for any help and sorry I am going beyond what is done currently,

cheers,

Michele


comment:5 by Pavel Demin, 10 years ago

Hi Michele,

I don't think that findDelphes.cmake could be generated automatically by cmake.

As far as I know this kind of files should be written manually.

I could imagine something like

set(searchpath ${DELPHES_DIR} $ENV{DELPHES} /usr /usr/local /opt/delphes)

find_path(DELPHES_INCLUDE_DIR
          NAMES DelphesClasses.h
          HINTS ${searchpath}
          PATH_SUFFIXES include)

find_library(DELPHES_LIBRARY
             NAMES Delphes
             HINTS ${searchpath}
             PATH_SUFFIXES lib)

unset(searchpath)

set(DELPHES_INCLUDE_DIRS ${DELPHES_INCLUDE_DIR})
set(DELPHES_LIBRARIES ${DELPHES_LIBRARY})

include(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set DELPHES_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args(Delphes DEFAULT_MSG DELPHES_INCLUDE_DIR DELPHES_LIBRARY)

mark_as_advanced(DELPHES_INCLUDE_DIR DELPHES_LIBRARY)

Cheers,

Pavel

Note: See TracTickets for help on using tickets.