Installation error with FindCoin.cmake

Please fill out the following information to help in answering your question, and also see tips for posting code snippets. If you don’t provide this information it will take more time to help with your problem!

_Geant4 Version:11.1.2
_Operating System:Ubuntu 20.04
_Compiler/Version:g++
_CMake Version:3.27

I’m trying to reinstall Geant4-v11.1.2 on my Ubuntu 20.4 and facing the following error

-- Checking C++ feature CXXSTDLIB_FILESYSTEM_NATIVE - Success
CMake Error at cmake/Modules/G4InterfaceOptions.cmake:117 (find_package):
  By not providing "FindCoin.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "Coin", but
  CMake did not find one.

  Could not find a package configuration file provided by "Coin" (requested
  version 4.0.0) with any of the following names:

    CoinConfig.cmake
    coin-config.cmake

  Add the installation prefix of "Coin" to CMAKE_PREFIX_PATH or set
  "Coin_DIR" to a directory containing one of the above files.  If "Coin"
  provides a separate development package or SDK, be sure it has been
  installed.
Call Stack (most recent call first):
  cmake/Modules/G4CMakeMain.cmake:64 (include)
  CMakeLists.txt:49 (include)


-- Configuring incomplete, errors occurred!

Please, any topic related to this issue? Has anyone faced this issue and solved it?
Thanks in advance.

Hi

It looks like you are trying to build with Open Inventor (GEANT4_USE_INVENTOR=ON). Is this your intention? This needs the Coin library (https://www.coin3d.org).

If it is your intention, and if you have installed Coin, you may need to tell cmake where it is (CMAKE_PREFIX_PATH). Come back to me for further suggestions.

John

1 Like

Hi,
Yes @allison , i am trying to build with Open Inventor (GEANT4_USE_INVENTOR=ON).
Thanks for the suggestion.
The issue was the version of Coin library. I updated the libcoin-dev and it resolved the issue.

In addition, I faced with the following issue when -DGEANT4_USE_INVENTOR=ON:

CMake Error at cmake/Modules/G4InterfaceOptions.cmake:125 (find_package):
  By not providing "FindSoXt.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "SoXt", but
  CMake did not find one.

  Could not find a package configuration file provided by "SoXt" (requested
  version 1.4.0) with any of the following names:

    SoXtConfig.cmake
    soxt-config.cmake

  Add the installation prefix of "SoXt" to CMAKE_PREFIX_PATH or set
  "SoXt_DIR" to a directory containing one of the above files.  If "SoXt"
  provides a separate development package or SDK, be sure it has been
  installed.
Call Stack (most recent call first):
  cmake/Modules/G4CMakeMain.cmake:64 (include)
  CMakeLists.txt:49 (include)

but I just turned -DGEANT4_USE_INVENTOR=OFF now to proceed with the installation first. This is because the installation of SoQt-1.6.0 and SoXt-1.4.0 are needed and I could not seen clear and quick solutions to it.

The installation is successful (at least 100% built target foo → Install the project) and to verify that I can run Geant4, I try the B1\basic\example. The following is the message after make -j command:

nucef@nucef:~/Desktop/geant4Run/examples-build/basic-build/B1-build$ make
[ 12%] Building CXX object CMakeFiles/exampleB1.dir/exampleB1.cc.o
[ 25%] Building CXX object CMakeFiles/exampleB1.dir/src/ActionInitialization.cc.o
[ 37%] Building CXX object CMakeFiles/exampleB1.dir/src/DetectorConstruction.cc.o
[ 50%] Building CXX object CMakeFiles/exampleB1.dir/src/EventAction.cc.o
[ 62%] Building CXX object CMakeFiles/exampleB1.dir/src/PrimaryGeneratorAction.cc.o
[ 75%] Building CXX object CMakeFiles/exampleB1.dir/src/RunAction.cc.o
[ 87%] Building CXX object CMakeFiles/exampleB1.dir/src/SteppingAction.cc.o
[100%] Linking CXX executable exampleB1
/usr/bin/ld: /usr/local/include/geant4-v11.1.2-install/lib/libG4processes.so: undefined reference to `G4MuBremsstrahlung::MinPrimaryEnergy(G4ParticleDefinition const*, G4Material const*, double)'
/usr/bin/ld: /usr/local/include/geant4-v11.1.2-install/lib/libG4processes.so: undefined reference to `G4ITNavigator::ResetNavigatorState()'
/usr/bin/ld: /usr/local/include/geant4-v11.1.2-install/lib/libG4processes.so: undefined reference to `G4MuBremsstrahlungModel::InitialiseLocal(G4ParticleDefinition const*, G4VEmModel*)'
/usr/bin/ld: /usr/local/include/geant4-v11.1.2-install/lib/libG4processes.so: undefined reference to `G4DNAGillespieDirectMethod::G4DNAGillespieDirectMethod()'
/usr/bin/ld: /usr/local/include/geant4-v11.1.2-install/lib/libG4processes.so: undefined reference to `G4VEmProcess::GetMeanFreePath(G4Track const&, double, G4ForceCondition*)'
/usr/bin/ld: /usr/local/include/geant4-v11.1.2-install/lib/libG4processes.so: undefined reference to `G4DNAGillespieDirectMethod::Initialize()'
/usr/bin/ld: /usr/local/include/geant4-v11.1.2-install/lib/libG4physicslists.so: undefined reference to `G4DummyModel::G4DummyModel(G4String const&)'
/usr/bin/ld: /usr/local/include/geant4-v11.1.2-install/lib/libG4processes.so: undefined reference to `G4VHighEnergyGenerator::G4VHighEnergyGenerator(G4String const&)'
/usr/bin/ld: /usr/local/include/geant4-v11.1.2-install/lib/libG4processes.so: undefined reference to `G4VEnergyLossProcess::AlongStepGetPhysicalInteractionLength(G4Track const&, double, double, double&, G4GPILSelection*)'
/usr/bin/ld: /usr/local/include/geant4-v11.1.2-install/lib/libG4physicslists.so: undefined reference to `G4OpticalParameters::SetVerboseLevel(int)'
/usr/bin/ld: /usr/local/include/geant4-v11.1.2-install/lib/libG4processes.so: undefined reference to `G4VITTrackHolder::Instance()'
/usr/bin/ld: /usr/local/include/geant4-v11.1.2-install/lib/libG4physicslists.so: undefined reference to `G4LossTableManager::EmSaturation()'
/usr/bin/ld: /usr/local/include/geant4-v11.1.2-install/lib/libG4processes.so: undefined reference to `G4HadronicProcess::StartTracking(G4Track*)'
/usr/bin/ld: /usr/local/include/geant4-v11.1.2-install/lib/libG4physicslists.so: undefined reference to `G4VEmProcess::~G4VEmProcess()'
/usr/bin/ld: /usr/local/include/geant4-v11.1.2-install/lib/libG4processes.so: undefined reference to `G4OpticalParameters::SetRayleighVerboseLevel(int)'
/usr/bin/ld: /usr/local/include/geant4-v11.1.2-install/lib/libG4physicslists.so: undefined reference to `G4GeneratorPrecompoundInterface::G4GeneratorPrecompoundInterface(G4VPreCompoundModel*)'
/usr/bin/ld: /usr/local/include/geant4-v11.1.2-install/lib/libG4physicslists.so: undefined reference to `G4OpticalParameters::Dump() const'
/usr/bin/ld: /usr/local/include/geant4-v11.1.2-install/lib/libG4processes.so: undefined reference to `G4VITStepModel::GetApplicable(G4ITType&, G4ITType&)'
/usr/bin/ld: /usr/local/include/geant4-v11.1.2-install/lib/libG4processes.so: undefined reference to `G4AugerTransition::AugerTransitionEnergy(int, int) const'
/usr/bin/ld: /usr/local/include/geant4-v11.1.2-install/lib/libG4physicslists.so: undefined reference to `G4Cerenkov::G4Cerenkov(G4String const&, G4ProcessType)'
/usr/bin/ld: /usr/local/include/geant4-v11.1.2-install/lib/libG4processes.so: undefined reference to `G4VMscModel::G4VMscModel(G4String const&)'
/usr/bin/ld: /usr/local/include/geant4-v11.1.2-install/lib/libG4processes.so: undefined reference to `G4hICRU49He::G4hICRU49He()'
/usr/bin/ld: /usr/local/include/geant4-v11.1.2-install/lib/libG4physicslists.so: undefined reference to `typeinfo for G4VEmModel'
/usr/bin/ld: /usr/local/include/geant4-v11.1.2-install/lib/libG4physicslists.so: undefined reference to `G4NeutrinoElectronTotXsc::G4NeutrinoElectronTotXsc()'
/usr/bin/ld: /usr/local/include/geant4-v11.1.2-install/lib/libG4physicslists.so: undefined reference to `G4LossTableManager::Instance()'
/usr/bin/ld: /usr/local/include/geant4-v11.1.2-install/lib/libG4processes.so: undefined reference to `G4ITNavigator::SetNavigatorState(G4ITNavigatorState_Lock*)'
/usr/bin/ld: /usr/local/include/geant4-v11.1.2-install/lib/libG4physicslists.so: undefined reference to `G4eplusTo2GammaOKVIModel::G4eplusTo2GammaOKVIModel(G4ParticleDefinition const*, G4String const&)'
/usr/bin/ld: /usr/local/include/geant4-v11.1.2-install/lib/libG4processes.so: undefined reference to `G4BraggIonModel::MinEnergyCut(G4ParticleDefinition const*, G4MaterialCutsCouple const*)'
/usr/bin/ld: /usr/local/include/geant4-v11.1.2-install/lib/libG4processes.so: undefined reference to `G4HadronicProcess::G4HadronicProcess(G4String const&, G4ProcessType)'
/usr/bin/ld: /usr/local/include/geant4-v11.1.2-install/lib/libG4processes.so: undefined reference to `G4WentzelVIModel::ComputeTrueStepLength(double)'
/usr/bin/ld: /usr/local/include/geant4-v11.1.2-install/lib/libG4processes.so: undefined reference to `G4BraggIonModel::GetParticleCharge(G4ParticleDefinition const*, G4Material const*, double)'
/usr/bin/ld: /usr/local/include/geant4-v11.1.2-install/lib/libG4processes.so: undefined reference to `G4MoleculeShoot::~G4MoleculeShoot()'
/usr/bin/ld: /usr/local/include/geant4-v11.1.2-install/lib/libG4processes.so: undefined reference to `G4ITStepProcessor::SetTrack(G4Track*)'
/usr/bin/ld: /usr/local/include/geant4-v11.1.2-install/lib/libG4processes.so: undefined reference to `G4VCrossSectionDataSet::ComputeIsoCrossSection(double, double, G4ParticleDefinition const*, int, int, G4Isotope const*, G4Element const*, G4Material const*)'
/usr/bin/ld: /usr/local/include/geant4-v11.1.2-install/lib/libG4physicslists.so: undefined reference to `G4BinaryLightIonReaction::G4BinaryLightIonReaction(G4VPreCompoundModel*)'
/usr/bin/ld: /usr/local/include/geant4-v11.1.2-install/lib/libG4processes.so: undefined reference to `G4CascadParticle::G4CascadParticle(G4InuclElementaryParticle const&, CLHEP::Hep3Vector const&, int, double, int)'
/usr/bin/ld: /usr/local/include/geant4-v11.1.2-install/lib/libG4physicslists.so: undefined reference to `G4MuNeutrinoNucleusTotXsc::G4MuNeutrinoNucleusTotXsc()'
/usr/bin/ld: /usr/local/include/geant4-v11.1.2-install/lib/libG4physicslists.so: undefined reference to `G4PenelopeBremsstrahlungModel::G4PenelopeBremsstrahlungModel(G4ParticleDefinition const*, G4String const&)'
/usr/bin/ld: /usr/local/include/geant4-v11.1.2-install/lib/libG4processes.so: undefined reference to `G4VITProcess::~G4VITProcess()'
/usr/bin/ld: /usr/local/include/geant4-v11.1.2-install/lib/libG4processes.so: undefined reference to `G4VMultipleScattering::AlongStepGetPhysicalInteractionLength(G4Track const&, double, double, double&, G4GPILSelection*)'
/usr/bin/ld: /usr/local/include/geant4-v11.1.2-install/lib/libG4processes.so: undefined reference to `vtable for G4BigBanger'
/usr/bin/ld: /usr/local/include/geant4-v11.1.2-install/lib/libG4physicslists.so: undefined reference to `G4UniversalFluctuation::G4UniversalFluctuation(G4String const&)'
/usr/bin/ld: /usr/local/include/geant4-v11.1.2-install/lib/libG4processes.so: undefined reference to `G4HadronicProcess::CheckResult(G4HadProjectile const&, G4Nucleus const&, G4HadFinalState*)'
/usr/bin/ld: /usr/local/include/geant4-v11.1.2-install/lib/libG4physicslists.so: undefined reference to `G4EmDataHandler::~G4EmDataHandler()'
/usr/bin/ld: /usr/local/include/geant4-v11.1.2-install/lib/libG4physicslists.so: undefined reference to `G4CrossSectionInelastic::G4CrossSectionInelastic(G4VComponentCrossSection*, int, int, double, double)'
/usr/bin/ld: /usr/local/include/geant4-v11.1.2-install/lib/libG4physicslists.so: undefined reference to `G4ComponentGGHadronNucleusXsc::G4ComponentGGHadronNucleusXsc()'
/usr/bin/ld: /usr/local/include/geant4-v11.1.2-install/lib/libG4processes.so: undefined reference to `G4VIntraNuclearTransportModel::G4VIntraNuclearTransportModel(G4String const&, G4VPreCompoundModel*)'
/usr/bin/ld: /usr/local/include/geant4-v11.1.2-install/lib/libG4processes.so: undefined reference to `G4Decay::PostStepDoIt(G4Track const&, G4Step const&)'
/usr/bin/ld: /usr/local/include/geant4-v11.1.2-install/lib/libG4processes.so: undefined reference to `G4VEmModel::SelectRandomAtom(G4Material const*, G4ParticleDefinition const*, double, double, double)'
/usr/bin/ld: /usr/local/include/geant4-v11.1.2-install/lib/libG4processes.so: undefined reference to `G4HadronicProcess::ProcessDescription(std::ostream&) const'
/usr/bin/ld: /usr/local/include/geant4-v11.1.2-install/lib/libG4physicslists.so: undefined reference to `G4EnergyLossTables::GetRange(G4ParticleDefinition const*, double, G4MaterialCutsCouple const*, bool)'
/usr/bin/ld: /usr/local/include/geant4-v11.1.2-install/lib/libG4processes.so: undefined reference to `G4OpticalParameters::SetWLS2VerboseLevel(int)'
/usr/bin/ld: /usr/local/include/geant4-v11.1.2-install/lib/libG4processes.so: undefined reference to `G4eBremsstrahlungRelModel::gBremFactor'
/usr/bin/ld: /usr/local/include/geant4-v11.1.2-install/lib/libG4processes.so: undefined reference to `typeinfo for G4VAtomDeexcitation'
/usr/bin/ld: /usr/local/include/geant4-v11.1.2-install/lib/libG4physicslists.so: undefined reference to `G4DNARuddIonisationExtendedModel::G4DNARuddIonisationExtendedModel(G4ParticleDefinition const*, G4String const&)'
/usr/bin/ld: /usr/local/include/geant4-v11.1.2-install/lib/libG4processes.so: undefined reference to `G4OpticalParameters::GetWLS2TimeProfile() const'
/usr/bin/ld: /usr/local/include/geant4-v11.1.2-install/lib/libG4processes.so: undefined reference to `G4VHighEnergyGenerator::~G4VHighEnergyGenerator()'
/usr/bin/ld: /usr/local/include/geant4-v11.1.2-install/lib/libG4physicslists.so: undefined reference to `G4WentzelVIModel::G4WentzelVIModel(bool, G4String const&)'
/usr/bin/ld: /usr/local/include/geant4-v11.1.2-install/lib/libG4physicslists.so: undefined reference to `G4MuIonisation::G4MuIonisation(G4String const&)'
/usr/bin/ld: /usr/local/include/geant4-v11.1.2-install/lib/libG4physicslists.so: undefined reference to `G4EmDataHandler::SetMasterProcess(G4VEmProcess const*)'
...
...
...
/usr/bin/ld: /usr/local/include/geant4-v11.1.2-install/lib/libG4processes.so: undefined reference to `G4eBremsstrahlungRelModel::~G4eBremsstrahlungRelModel()'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/exampleB1.dir/build.make:240: exampleB1] Error 1
make[1]: *** [CMakeFiles/Makefile2:84: CMakeFiles/exampleB1.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

I have also configure the environment as

source /usr/local/include/geant4-v11.1.2-install/bin/geant4.sh
source /usr/local/include/geant4-v11.1.2-install/share/Geant4/geant4make/geant4make.sh

I’m checking the forum

Yes, you will need SoXt (or SoQt if you are building with GEANT4_USE_QT=ON).

With GEANT4_USE_INVENTOR=OFF, it appears to build but you get undefined reference errors. All I can suggest is that you make clean and rebuild from scratch.

If you want to get back to trying to install Open Inventor, please get back to us.

1 Like

Hi,
I have resolved the issue by sourcing the geant4.sh script from the terminal than modifying the .bashnc. This is the best solution for me, and it is working very well.
This is done everytime I compile something.
I think Geant4 CMake scripts may have a small issue whith Ubuntu system and may be the next version might not have the same issue. So I’m looking forward to it.

Please, I would like to install with GEANT4_USE_INVENTOR=ON .
I will appreciate your support in this regard. Thanks

Ubuntu will also require either the SoXt or SoQt implementations as that’s what the Geant4 driver uses. SoQt’s probably the best one to use as there is an Ubuntu 20.04 package for it:

If you install that, it should be possible to build Geant4 with Inventor support via:

$ cmake -DGEANT4_USE_INVENTOR_QT=ON <otherargs>

You might need to add -DGEANT4_USE_INVENTOR=OFF if you’ve built with that option before, but see if you get an error with the above first.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.