forked from hlrs-vis/covise
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.covise.sh
110 lines (93 loc) · 2.84 KB
/
.covise.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
##############################################
#
# COVISE Basic Settings: DO NOT CHANGE
#
################################################
#
# COVISE Installation Directory
#
# If the default (~/covise) is not used, and your cwd is not the covise
# home (i. e. a directory which contains a .covise.sh file), you must set it
# to your covise directory
#
if [ -z "$COVISEDIR" ]; then
if [ -f .covise.sh ]; then
export COVISEDIR="`/bin/pwd`"
elif [ -f "${HOME}"/covise/.covise.sh ]; then
export COVISEDIR="`sh -f -c 'cd ~/covise ; unset PWD; /bin/pwd'`"
elif [ -f "${HOME}"/covise_snap/.covise.sh ]; then
export COVISEDIR="`sh -f -c 'cd ~/covise_snap ; unset PWD; /bin/pwd'`"
else
echo "Cannot determine COVISEDIR, set manually to directory where bin and config directories reside"
return 1
fi
fi
export COVISEDIR="`sh -f -c 'cd "$COVISEDIR" ; unset PWD; /bin/pwd'`"
if [ ! -z "$COVISEDIR" ]; then
if [ -z "$COVISEDESTDIR" ]; then
export COVISEDESTDIR=$COVISEDIR
fi
fi
if [ -r "$COVISEDIR"/scripts/covise-functions.sh ]; then
. "$COVISEDIR"/scripts/covise-functions.sh
else
echo "$COVISEDIR/scripts/covise-functions.sh not readable"
return 1
fi
#
# System Architecture
#
guess_archsuffix
# PATH
#
if [ "$COVISE_GLOBALINSTDIR" = "" ]; then
export PATH="$COVISEDIR"/bin:"$PATH"
if [ "$COVISE_PATH" = "" ]; then
export COVISE_PATH="${COVISEDIR}"
if [ "$COVISEDESTDIR" != "$COVISEDIR" ]; then
export COVISE_PATH="${COVISEDESTDIR}:${COVISE_PATH}"
fi
fi
else
export PATH="$COVISE_GLOBALINSTDIR"/covise/bin:"$PATH"
if [ "$COVISE_PATH" = "" ]; then
export COVISE_PATH="$COVISEDIR":"$COVISE_GLOBALINSTDIR/covise"
fi
fi
#
# COVISE environment path (colon separated list)
#
BASEARCH=`echo $ARCHSUFFIX | sed -e 's/opt$//' -e 's/xenomai$//' `
if [ -z "$EXTERNLIBS" ]; then
extlibs="${COVISEDIR}/extern_libs/${ARCHSUFFIX}"
if [ ! -d "$extlibs" ]; then
extlibs="${COVISEDIR}/extern_libs/${BASEARCH}"
fi
if [ ! -d "$extlibs" ]; then
extlibs="/data/extern_libs/$ARCHSUFFIX"
if [ ! -d "$extlibs" ]; then
extlibs="/data/extern_libs/$BASEARCH"
fi
fi
if [ -d "$extlibs" ]; then
export EXTERNLIBS="$extlibs"
fi
fi
if [ -d "${COVISEDIR}/.git" ]; then
GITDATE=$(GIT_DIR=${COVISEDIR}/.git git log -n1 '--format=%ci')
if [ $? ]; then
export COVISE_VERSION=$(echo $GITDATE | sed -e 's/-/./' -e 's/-.*//' -e 's/\.0/./')
fi
fi
if [ -z "${PYTHON_HOME}" ]; then
if [ -d "${EXTERNLIBS}/python" ]; then
export PYTHON_HOME="${EXTERNLIBS}/python"
elif [ -n "$(which python3)" 2> /dev/null ]; then
python_bin="$(which python3)"
export PYTHON_HOME="${python_bin%/*bin/python3}"
fi
fi
export COVISE_CMAKE=cmake
if [ -r "${HOME}"/.covise.local.sh ]; then
. "${HOME}"/.covise.local.sh
fi