forked from MaRDI4NFDI/open-interfaces
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathenv.sh
36 lines (30 loc) · 1.09 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
# Set project root directory to use absolute paths below.
export PRJ_ROOT_DIR=""
if [ "$GITHUB_ACTIONS" = "true" ]; then
PRJ_ROOT_DIR="$GITHUB_WORKSPACE"
else
if [ -n "${BASH_SOURCE[0]:-}" ]; then
# shellcheck disable=SC3000-SC4000
PRJ_ROOT_DIR="$(dirname "$(realpath "${BASH_SOURCE[0]}")")"
else
PRJ_ROOT_DIR="$(dirname "$(realpath "$0")")"
fi
fi
# Set path to implementations
export OIF_IMPL_ROOT_DIR="${PRJ_ROOT_DIR}"
# Add compiled libraries to the path for the linker.
if [ -n "$LD_LIBRARY_PATH" ]; then
export _OLD_LD_LIBRARY_PATH="$LD_LIBRARY_PATH"
fi
export LD_LIBRARY_PATH="$PRJ_ROOT_DIR/build":"$LD_LIBRARY_PATH"
# Find Python packages inside the `src` directory.
if [ -n "$PYTHONPATH" ]; then
export _OLD_PYTHONPATH="$PYTHONPATH"
fi
oifpath=${PRJ_ROOT_DIR}/oif/interfaces/python
oifpath="$oifpath":${PRJ_ROOT_DIR}/oif/lang_python
oifpath="$oifpath":${PRJ_ROOT_DIR}/oif_impl/lang_python
oifpath="$oifpath":${PRJ_ROOT_DIR}/oif_impl/impl
oifpath="$oifpath":${PRJ_ROOT_DIR}/build
export PYTHONPATH="$oifpath":"$PYTHONPATH"
export JULIA_PROJECT="$PRJ_ROOT_DIR"