Warning, /acts/Examples/Python/setup.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 Python bindings in the environment in a somewhat
0010 # robust way.
0011
0012 if [ -n "$ZSH_VERSION" ]; then
0013 python_dir=${0:a:h}
0014 elif [ -n "$BASH_VERSION" ]; then
0015 python_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
0016 else
0017 # If the current shell is not ZSH or Bash, we can't guarantee that the
0018 # script will work, so we throw an error.
0019 echo "ERROR: neither ZSH nor Bash was detected, other shells are not supported. The environment has not been modified."
0020 exit 1
0021 fi
0022
0023 # Make python package available
0024 export PYTHONPATH=$python_dir:$PYTHONPATH
0025
0026 # Make ODD available if possible
0027 # This seems to be only reliable on Linux for now, not on MacOS
0028 odd_src_dir=@CMAKE_CURRENT_SOURCE_DIR@/../../thirdparty/OpenDataDetector
0029 export ODD_PATH=$odd_src_dir
0030 odd_bin_dir=$python_dir/../thirdparty/OpenDataDetector/factory
0031 if [ -d "$odd_bin_dir" ]; then
0032 if [[ "$(uname -s)" == "Linux" ]]; then
0033 echo "INFO: Found OpenDataDetector and set it up"
0034 export LD_LIBRARY_PATH=$odd_bin_dir:$LD_LIBRARY_PATH
0035 fi
0036 if [[ "$(uname -s)" == "Darwin" ]]; then
0037 echo "INFO: Found OpenDataDetector and set it up"
0038 export DYLD_LIBRARY_PATH=$odd_bin_dir:$DYLD_LIBRARY_PATH
0039 fi
0040 fi
0041
0042 # This message might seem excessive, but the Acts bindings are only installed
0043 # for one Python version, and it is not trivial for the user to find out which.
0044 # Thus, we let them know explicitly so they can more easily debug any potential
0045 # import errors.
0046 echo "INFO: Acts Python @Python_VERSION_MAJOR@.@Python_VERSION_MINOR@ bindings setup complete."