-
Notifications
You must be signed in to change notification settings - Fork 60
/
env.sh
49 lines (44 loc) · 1.65 KB
/
env.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# Adjust environment setting to enable PODIO at runtime
#
# The PODIO environment variable must be set to use this
# script
if [ -z "$PODIO" ]; then
echo "Please set the PODIO environment variable to the install location before sourcing this script."
return
fi
unamestr=`uname`
if [[ "$unamestr" = 'Linux' ]]; then
if ! echo $LD_LIBRARY_PATH | grep $PODIO/lib > /dev/null 2>&1; then
# RedHat based put the libraries into lib64
if [ -d $PODIO/lib64 ]; then
export LD_LIBRARY_PATH=$PODIO/lib64:$LD_LIBRARY_PATH
else
export LD_LIBRARY_PATH=$PODIO/lib:$LD_LIBRARY_PATH
fi
fi
elif [[ "$unamestr" = 'Darwin' ]]; then
# This currently does not work on OS X as DYLD_LIBRARY_PATH is ignored
# in recent OS X versions
if ! echo $DYLD_LIBRARY_PATH | grep -o $PODIO/lib > /dev/null 2>&1; then
export DYLD_LIBRARY_PATH=$PODIO/lib:$DYLD_LIBRARY_PATH
fi
fi
python_stem=python3.$(python -c 'import sys; print(sys.version_info[1])')/site-packages
if [ -d $PODIO/lib64/${python_stem} ]; then
if ! echo $PYTHONPATH | grep -o $PODIO/lib64/${python_stem} > /dev/null 2>&1; then
export PYTHONPATH=$PODIO/lib64/${python_stem}:$PYTHONPATH
fi
else
if ! echo $PYTHONPATH | grep -o $PODIO/lib/${python_stem} > /dev/null 2>&1; then
export PYTHONPATH=$PODIO/lib/${python_stem}:$PYTHONPATH
fi
fi
if ! echo $ROOT_INCLUDE_PATH | grep -o $PODIO/include > /dev/null 2>&1; then
export ROOT_INCLUDE_PATH=$PODIO/include:$ROOT_INCLUDE_PATH
fi
if ! echo $PATH | grep $PODIO/bin > /dev/null 2>&1; then
export PATH=$PODIO/bin:$PATH
fi
if ! echo $CMAKE_PREFIX_PATH | grep $PODIO > /dev/null 2>&1; then
export CMAKE_PREFIX_PATH=$PODIO:$CMAKE_PREFIX_PATH
fi