Back to home page

EIC code displayed by LXR

 
 

    


Warning, /acts/cmake/setup_withdeps.sh.in is written in an unsupported language. File is not indexed.

0001 # This file is part of the ACTS project.
0002 #
0003 # Copyright (C) 2016 CERN for the benefit of the ACTS project
0004 #
0005 # This Source Code Form is subject to the terms of the Mozilla Public
0006 # License, v. 2.0. If a copy of the MPL was not distributed with this
0007 # file, You can obtain one at https://mozilla.org/MPL/2.0/.
0008 
0009 # This script sets up the ACTS Examples environment in a somewhat robust way.
0010 
0011 if [ -n "$ZSH_VERSION" ]; then
0012     script_dir=${0:a:h}
0013 elif [ -n "$BASH_VERSION" ]; then
0014     script_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
0015 else
0016     # If the current shell is not ZSH or Bash, we can't guarantee that the
0017     # script will work, so we throw an error.
0018     echo "ERROR:   neither ZSH nor Bash was detected, other shells are not supported. The environment has not been modified."
0019     exit 1
0020 fi
0021 
0022 # source the python and ODD environment
0023 # first check if python bindings are enabled
0024 # then check if the setup.sh file exists
0025 if [ "@ACTS_BUILD_EXAMPLES_PYTHON_BINDINGS@" = "ON" ]; then
0026     if [[ -f "$script_dir/python/setup.sh" ]]; then
0027       . "$script_dir/python/setup.sh"
0028     else
0029       echo "ERROR:   setup.sh for python and ODD is missing."
0030       exit 1
0031     fi
0032 else
0033   echo "INFO:    Python bindings are disabled."
0034 fi
0035 
0036 # set ACTS and ODD environment variables
0037 export ACTS_SOURCE_DIR=@CMAKE_CURRENT_SOURCE_DIR@
0038 export ODD_SOURCE_DIR=@CMAKE_CURRENT_SOURCE_DIR@/thirdparty/OpenDataDetector
0039 
0040 # make ACTS binaries available
0041 export PATH="$script_dir/bin:${PATH}"
0042 export LD_LIBRARY_PATH="$script_dir/lib:${LD_LIBRARY_PATH}"
0043 export DYLD_LIBRARY_PATH="$script_dir/lib:${DYLD_LIBRARY_PATH}"
0044 
0045 # activate dependencies if present
0046 if [[ -d "@ROOT_DIR@" ]]; then
0047   . @ROOT_BINDIR@/thisroot.sh
0048 fi
0049 if [[ -d "@Geant4_DIR@" ]]; then
0050   . @Geant4_INCLUDE_DIR@/../../bin/geant4.sh
0051 fi
0052 if [[ -d "@DD4hep_DIR@" ]]; then
0053   . @DD4hep_INCLUDE_DIRS@/../bin/thisdd4hep.sh
0054   # Without this, DD4hep's Xerces-C XML parsing fails with:
0055   # > Could not load a transcoding service
0056   export LC_ALL=C
0057 fi
0058 if [[ -d "@podio_DIR@" ]]; then
0059   export LD_LIBRARY_PATH="@podio_LIBRARY_DIR@:${LD_LIBRARY_PATH}"
0060   export DYLD_LIBRARY_PATH="@podio_LIBRARY_DIR@:${DYLD_LIBRARY_PATH}"
0061   export ROOT_INCLUDE_PATH="@podio_INCLUDE_DIR@:${ROOT_INCLUDE_PATH}"
0062   export PYTHONPATH="@podio_PYTHON_DIR@:${PYTHONPATH}"
0063 fi
0064 if [[ -d "@EDM4HEP_DIR@" ]]; then
0065   export LD_LIBRARY_PATH="@EDM4HEP_LIBRARY_DIR@/lib:${LD_LIBRARY_PATH}"
0066   export DYLD_LIBRARY_PATH="@EDM4HEP_LIBRARY_DIR@/lib:${DYLD_LIBRARY_PATH}"
0067   export ROOT_INCLUDE_PATH="@EDM4HEP_INCLUDE_DIR@:${ROOT_INCLUDE_PATH}"
0068 fi