-
Notifications
You must be signed in to change notification settings - Fork 6
/
snd_env.sh
executable file
·46 lines (38 loc) · 1.62 KB
/
snd_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
#!/bin/bash
# This script sets up the evironment for the HXRSnD
# Setup the conda path
unset LD_LIBRARY_PATH
unset PYTHONPATH
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/reg/common/package/epicsca/3.14.12/lib/rhel6-x86_64
export PATH=/reg/g/pcds/pyps/conda/py36/bin:$PATH
conda_env=pcds-0.3.0
# Source the EPICS env first before the conda env
source /reg/g/pcds/setup/epicsenv-cur.sh
# This must happen here before the source activate conda-env otherwise some
# shared libraries do not load properly.
# These have to be included otherwise there you get the following error then a
# seg fault:
# QXcbConnection: Could not connect to display
# This needs to point to the conda env being used
export QT_XKB_CONFIG_ROOT='/reg/g/pcds/pyps/conda/py36/envs/$conda_env/lib'
# This ensures the terminal doesn't totally screw up
export QT_QPA_PLATFORM='offscreen'
# Activate the snd_opr conda environment
source activate $conda_env
# resolve $FILE until the file is no longer a symlink
FILE="${BASH_SOURCE[0]}"
while [ -h "$FILE" ]; do
SCRIPTPATH="$( cd -P "$( dirname "$FILE" )" && pwd )"
FILE="$(readlink "$FILE")"
# if $FILE was a relative symlink, we need to resolve it relative to the path
# where the symlink file was located
[[ $FILE != /* ]] && FILE="$SCRIPTPATH/$FILE"
done
SCRIPTPATH="$( cd -P "$( dirname "$FILE" )" && pwd )"
# Get the directory of snd project
SNDPATH=$(readlink --canonicalize $SCRIPTPATH/..)
# Add required modules to the python path
PYTHONPATH=$SNDPATH/pcds-devices:$PYTHONPATH # pcds-devices
PYTHONPATH=$SNDPATH/pswalker:$PYTHONPATH # pswalker
PYTHONPATH=$SNDPATH/HXRSnD:$PYTHONPATH # HXRSnD
export PYTHONPATH