Skip to content

Commit

Permalink
Merge branch 'main' into refactor/vtx-templates-part12-density-finders
Browse files Browse the repository at this point in the history
  • Loading branch information
kodiakhq[bot] authored Feb 28, 2024
2 parents ebce1e2 + 6a25545 commit ffac673
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 30 deletions.
14 changes: 2 additions & 12 deletions .github/workflows/builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,7 @@ jobs:
PYTEST_MD_REPORT_OUTPUT: pytest.md
run: >
/usr/local/bin/geant4-config --install-datasets
&& source /usr/local/bin/thisroot.sh
&& source /usr/local/bin/thisdd4hep_only.sh
&& source /usr/local/bin/geant4.sh
&& source build/python/setup.sh
&& export PYTHONPATH=/usr/local/python:$PYTHONPATH
&& export LD_LIBRARY_PATH=$PWD/build/thirdparty/OpenDataDetector/factory:$LD_LIBRARY_PATH
&& source build/this_acts_withdeps.sh
&& pip3 install -r Examples/Python/tests/requirements.txt
&& pip3 install pytest-md-report
&& pytest -rFsv -k "not exatrkx" -v
Expand Down Expand Up @@ -195,13 +190,8 @@ jobs:
&& pip3 install histcmp==0.6.5 spyral-cli==1.1.1 matplotlib
&& pip3 install -r Examples/Scripts/requirements.txt
&& /usr/local/bin/geant4-config --install-datasets
&& source /usr/local/bin/thisroot.sh
&& source /usr/local/bin/thisdd4hep_only.sh
&& source /usr/local/bin/geant4.sh
&& source build/python/setup.sh
&& export LD_LIBRARY_PATH=$PWD/build/thirdparty/OpenDataDetector/factory:$LD_LIBRARY_PATH
&& source build/this_acts_withdeps.sh
&& echo "::endgroup::"
&& export PYTHONPATH="${PYTHONPATH}":"${GITHUB_WORKSPACE}/Examples/Scripts/Python"
&& CI/physmon/phys_perf_mon.sh all physmon
&& cat physmon/summary.md >> $GITHUB_STEP_SUMMARY
Expand Down
17 changes: 3 additions & 14 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,7 @@ test_exatrkx_python:
script:
- apt-get update -y
- apt-get install -y python3 libxxhash0
- source /usr/local/bin/thisroot.sh
- source build/python/setup.sh
- source build/this_acts_withdeps.sh
- git clone $CLONE_URL src
- cd src
- git checkout $HEAD_SHA
Expand Down Expand Up @@ -205,12 +204,7 @@ linux_test_examples:
- cd ..

- /usr/local/bin/geant4-config --install-datasets
- "source /usr/local/bin/thisroot.sh || true"
- "source /usr/local/bin/thisdd4hep_only.sh || true"
- "source /usr/local/bin/geant4.sh || true"
- source build/python/setup.sh
- export PYTHONPATH=/usr/local/python:$PYTHONPATH
- export LD_LIBRARY_PATH=$PWD/build/thirdparty/OpenDataDetector/factory:$LD_LIBRARY_PATH
- source build/this_acts_withdeps.sh
- cd src
- pip3 install -r Examples/Python/tests/requirements.txt
- pytest -rFsv -k "not exatrkx" -v
Expand Down Expand Up @@ -240,13 +234,8 @@ linux_physmon:
- pip3 install histcmp==0.6.5 spyral-cli==1.1.0 matplotlib
- pip3 install -r src/Examples/Scripts/requirements.txt
- /usr/local/bin/geant4-config --install-datasets
- "source /usr/local/bin/thisroot.sh || true"
- "source /usr/local/bin/thisdd4hep_only.sh || true"
- "source /usr/local/bin/geant4.sh || true"
- source build/python/setup.sh
- export LD_LIBRARY_PATH=$PWD/build/thirdparty/OpenDataDetector/factory:$LD_LIBRARY_PATH
- source build/this_acts_withdeps.sh
- cd src
- export PYTHONPATH="${PYTHONPATH}":"${PWD}/Examples/Scripts/Python"
- CI/physmon/phys_perf_mon.sh all physmon

###############################
Expand Down
5 changes: 1 addition & 4 deletions Examples/Python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,8 @@ else()
target_sources(ActsPythonBindings PRIVATE src/OnnxNeuralCalibratorStub.cpp)
endif()

add_custom_target(ActsPythonGlueCode)
configure_file(setup.sh.in ${_python_dir}/setup.sh @ONLY)
install(FILES setup.sh.in DESTINATION "python" RENAME setup.sh)
install(FILES ${_python_dir}/setup.sh DESTINATION "python")

foreach(f ${py_files})
set(_target ${_python_dir}/acts/${f})
Expand All @@ -193,5 +192,3 @@ file(CREATE_LINK ${CMAKE_CURRENT_SOURCE_DIR}/python/acts/${f} ${_target} SYMBOLI
endforeach()

install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/python/acts/ DESTINATION ${_python_install_dir})

add_dependencies(ActsPythonBindings ActsPythonGlueCode)
8 changes: 8 additions & 0 deletions cmake/ActsCreateSetup.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,11 @@ configure_file(
install(
FILES ${PROJECT_BINARY_DIR}/this_acts.sh
DESTINATION ${CMAKE_INSTALL_BINDIR})

configure_file(
${CMAKE_CURRENT_LIST_DIR}/setup_withdeps.sh.in
${PROJECT_BINARY_DIR}/this_acts_withdeps.sh
@ONLY)
install(
FILES ${PROJECT_BINARY_DIR}/this_acts_withdeps.sh
DESTINATION ${CMAKE_INSTALL_BINDIR})
57 changes: 57 additions & 0 deletions cmake/setup_withdeps.sh.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# This file is part of the Acts project.
#
# Copyright (C) 2024 CERN for the benefit of the Acts project
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

# This script sets up the ACTS Examples environment in a somewhat robust way.

if [ -n "$ZSH_VERSION" ]; then
script_dir=${0:a:h}
elif [ -n "$BASH_VERSION" ]; then
script_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
else
# If the current shell is not ZSH or Bash, we can't guarantee that the
# script will work, so we throw an error.
echo "ERROR: neither ZSH nor Bash was detected, other shells are not supported. The environment has not been modified."
exit 1
fi

# source the python and ODD environment
. $script_dir/python/setup.sh

# set ACTS and ODD environment variables
ACTS_SOURCE_DIR=@CMAKE_CURRENT_SOURCE_DIR@
ODD_SOURCE_DIR=@CMAKE_CURRENT_SOURCE_DIR@/thirdparty/OpenDataDetector

# modify python environment to include some ACTS helpers
export PYTHONPATH="$ACTS_SOURCE_DIR/Examples/Scripts/Python:${PYTHONPATH}"

# make ACTS binaries available
export PATH="$script_dir/bin:${PATH}"
export LD_LIBRARY_PATH="$script_dir/lib:${LD_LIBRARY_PATH}"
export DYLD_LIBRARY_PATH="$script_dir/lib:${DYLD_LIBRARY_PATH}"

# activate dependencies if present
if [[ -d "@ROOT_DIR@" ]]; then
. @ROOT_BINDIR@/thisroot.sh
fi
if [[ -d "@Geant4_DIR@" ]]; then
. @Geant4_INCLUDE_DIR@/../../bin/geant4.sh
fi
if [[ -d "@DD4hep_DIR@" ]]; then
. @DD4hep_INCLUDE_DIRS@/../bin/thisdd4hep.sh
fi
if [[ -d "@podio_DIR@" ]]; then
export LD_LIBRARY_PATH="@podio_LIBRARY_DIR@:${LD_LIBRARY_PATH}"
export DYLD_LIBRARY_PATH="@podio_LIBRARY_DIR@:${DYLD_LIBRARY_PATH}"
export ROOT_INCLUDE_PATH="@podio_INCLUDE_DIR@:${ROOT_INCLUDE_PATH}"
export PYTHONPATH="@podio_PYTHON_DIR@:${PYTHONPATH}"
fi
if [[ -d "@EDM4HEP_DIR@" ]]; then
export LD_LIBRARY_PATH="@EDM4HEP_LIBRARY_DIR@/lib:${LD_LIBRARY_PATH}"
export DYLD_LIBRARY_PATH="@EDM4HEP_LIBRARY_DIR@/lib:${DYLD_LIBRARY_PATH}"
export ROOT_INCLUDE_PATH="@EDM4HEP_INCLUDE_DIR@:${ROOT_INCLUDE_PATH}"
fi

0 comments on commit ffac673

Please sign in to comment.