Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: some dependencies in setup script wrong #3014

Open
AJPfleger opened this issue Mar 7, 2024 · 6 comments
Open

bug: some dependencies in setup script wrong #3014

AJPfleger opened this issue Mar 7, 2024 · 6 comments
Assignees
Labels
Bug Something isn't working Impact - Minor Nuissance bug and/or affects only a single module Stale

Comments

@AJPfleger
Copy link
Contributor

AJPfleger commented Mar 7, 2024

Trying out the great idea from #2926, I noticed, that some of the dependencies have the wrong path.

Issue

In <build>/this_acts_withdeps.sh I get the following code:

if [[ -d "/opt/hep/root/6.30.02/cmake" ]]; then
  . /opt/hep/root/6.30.02/bin/thisroot.sh
fi
if [[ -d "/opt/hep/geant4/11.2.0/lib/cmake/Geant4" ]]; then
  . /../../bin/geant4.sh
fi
if [[ -d "/opt/hep/dd4hep/01-27-02/cmake" ]]; then
  . /../bin/thisdd4hep.sh
fi

The setup for root points to the correct file, Geant4 and DD4hep have a broken path.

Possible solution

The solution here would work for my local setup:
https://github.com/AJPfleger/acts/tree/fix-deps

it basically changes in https://github.com/acts-project/acts/blob/main/cmake/setup_withdeps.sh.in

if [[ -d "@Geant4_DIR@" ]]; then
  . @Geant4_INCLUDE_DIR@/../../bin/geant4.sh
fi
if [[ -d "@DD4hep_DIR@" ]]; then
  . @DD4hep_INCLUDE_DIRS@/../bin/thisdd4hep.sh
fi

to

if [[ -d "@Geant4_DIR@" ]]; then
  . @Geant4_DIR@/../../../bin/geant4.sh
fi
if [[ -d "@DD4hep_DIR@" ]]; then
  . @DD4hep_DIR@/../bin/thisdd4hep.sh
fi

Let's check with different setups.

@andiwand
Copy link
Contributor

andiwand commented Mar 7, 2024

I was facing other issues with Geant4_DIR and so on. I think these paths can also be used to instruct cmake to look for the dependency starting from there

after a successful find package *_INCLUDE_DIRS should be available as far as I understood

@AJPfleger
Copy link
Contributor Author

AJPfleger commented Mar 7, 2024

Testing geant4 on lxplus

After building with

cmake -B build -S . \
    -DACTS_BUILD_FATRAS=on \
    -DACTS_BUILD_PLUGIN_GEANT4=on

the original script seems to give a correct path:

if [[ -d "/cvmfs/sft.cern.ch/lcg/views/LCG_101/x86_64-centos7-gcc11-opt/lib64/Geant4-10.7.2" ]]; then
  . /cvmfs/sft.cern.ch/lcg/views/LCG_101/x86_64-centos7-gcc11-opt/include/Geant4/../../bin/geant4.sh
fi

while my suggestion above doesn't work:

if [[ -d "/cvmfs/sft.cern.ch/lcg/views/LCG_101/x86_64-centos7-gcc11-opt/lib64/Geant4-10.7.2" ]]; then
  . /cvmfs/sft.cern.ch/lcg/views/LCG_101/x86_64-centos7-gcc11-opt/lib64/Geant4-10.7.2/../../../bin/geant4.sh
fi

@AJPfleger
Copy link
Contributor Author

Testing locally

These builds generate a valid Geant4 path:

cmake -B build -S .  \
    -DACTS_BUILD_FATRAS=on \
    -DACTS_BUILD_PLUGIN_GEANT4=on \
    -DCMAKE_PREFIX_PATH="/opt/hep/geant4/11.2.0"
cmake -B build -S . -GNinja \
    -DACTS_BUILD_FATRAS=on \
    -DACTS_BUILD_PLUGIN_GEANT4=on \
    -DCMAKE_PREFIX_PATH="/opt/hep/geant4/11.2.0"

whereas this one (explicitly setting a Geant4-path) results in the erroneous setup-file:

cmake -B build -S . -GNinja \
    -DEigen3_DIR:PATH=/opt/hep/eigen/3.4.0/share/eigen3/cmake/ \
    -DACTS_BUILD_UNITTESTS:BOOL=ON \
    -DACTS_BUILD_FATRAS:BOOL=ON \
    -DACTS_BUILD_EXAMPLES_PYTHON_BINDINGS:BOOL=ON \
    -DACTS_BUILD_EXAMPLES_PYTHIA8:BOOL=ON \
    -DCMAKE_PREFIX_PATH:PATH="/opt/hep/root/6.30.02/;/opt/hep/json/3.11.3;/opt/hep/pythia8/8310" \
    -DACTS_BUILD_ODD=ON \
    -DDD4hep_DIR=/opt/hep/dd4hep/01-27-02/cmake \
    -DGeant4_DIR=/opt/hep/geant4/11.2.0/lib/cmake/Geant4

So it doesn't seem to be a Ninja-issue but rather a problem, when setting the path with Geant4_DIR.

@andiwand
Copy link
Contributor

andiwand commented Mar 7, 2024

I think setting Geant4_DIR manually will shortcut find_package

Copy link

github-actions bot commented Apr 6, 2024

This issue/PR has been automatically marked as stale because it has not had recent activity. The stale label will be removed if any interaction occurs.

@github-actions github-actions bot added the Stale label Apr 6, 2024
@AJPfleger AJPfleger added Bug Something isn't working Impact - Minor Nuissance bug and/or affects only a single module labels Apr 17, 2024
@github-actions github-actions bot removed the Stale label Apr 17, 2024
Copy link

This issue/PR has been automatically marked as stale because it has not had recent activity. The stale label will be removed if any interaction occurs.

@github-actions github-actions bot added the Stale label May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Impact - Minor Nuissance bug and/or affects only a single module Stale
Projects
None yet
Development

No branches or pull requests

2 participants