Message: Re: HepMC examples and 4.10.03 Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Idea Re: HepMC examples and 4.10.03 

Forum: Installation and Configuration
Re: Question HepMC examples and 4.10.03 (Bryan Wright)
Date: 07 Feb, 2017
From: Ben Morgan <Ben Morgan>

On Tue, 07 Feb 2017 16:00:58 GMT, Bryan Wright wrote:
> Compile command and output:
> ...
> CMakeFiles/HepMCEx01.dir/src/HepMCG4AsciiReader.cc.o: In function `HepMCG4AsciiReader::HepMCG4AsciiReader()':
> HepMCG4AsciiReader.cc:(.text+0x146): undefined reference to `HepMC::IO_GenEvent::IO_GenEvent(std::__cxx11::basic_string, std::allocator > const&, std::_Ios_Openmode)'
> CMakeFiles/HepMCEx01.dir/src/HepMCG4AsciiReader.cc.o: In function `HepMCG4AsciiReader::Initialize()':
> HepMCG4AsciiReader.cc:(.text+0x2c4): undefined reference to `HepMC::IO_GenEvent::IO_GenEvent(std::__cxx11::basic_string, std::allocator > const&, std::_Ios_Openmode)'
> collect2: error: ld returned 1 exit status
> make[2]: *** [BuildProducts/bin/HepMCEx01] Error 1
> make[2]: Leaving directory `/sfs/lustre/scratch/bkw1a/geant4.10.03-build'
> make[1]: *** [examples/extended/eventgenerator/HepMC/HepMCEx01/CMakeFiles/HepMCEx01.dir/all] Error 2
> make[1]: Leaving directory `/sfs/lustre/scratch/bkw1a/geant4.10.03-build'
> make: *** [all] Error 2
> 

Though the order of the linkage to the HepMC libs looks a bit odd (-lHepMC -L... -lHepMCfio), my initial suspicion is that the installation of HepMC wasn't compiled against the C++11 Standard (note the requirement for the __cxx11 inline namespace). The first thing is to to check that the HepMC install was compiled against C++11, and reinstall if neccessary.

Just in case the odd link order is causing the issue, also try changing the order of the target_link_libraries in the CMake scripts, e.g. change:

target_link_libraries(HepMCEx02 ${Geant4_LIBRARIES}
                      ${HEPMC_LIBRARIES} ${HEPMC_FIO_LIBRARIES}
                      ${PYTHIA6_LIBRARIES} gfortran)

to:

target_link_libraries(HepMCEx02 ${Geant4_LIBRARIES}
                      ${HEPMC_FIO_LIBRARIES} ${HEPMC_LIBRARIES}
                      ${PYTHIA6_LIBRARIES} gfortran)

Cheers,

Ben.

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 Feedback: Re: HepMC examples and 4.10.03   (Bryan Wright - 07 Feb, 2017)
(_ None: Re: HepMC examples and 4.10.03   (Witek Pokorski - 10 Apr, 2017)
 Add Message Add Message
to: "Re: HepMC examples and 4.10.03"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]