-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsource_me_bcm.sh
51 lines (44 loc) · 1.28 KB
/
source_me_bcm.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
#!/bin/bash
# alias
alias lt='ls -lhrt'
# utils
infoMsg() {
echo -e "\033[32;1m${1}\033[0m"
}
warnMsg() {
echo -e "\033[31;1m${1}\033[0m"
}
checkMsg() {
echo -e "\033[33;4m${1}\033[0m"
}
checkMsg "Before ..."
echo $CPATH
echo $LIBRARY_PATH
echo $LD_LIBRARY_PATH
# boost
if ! [[ "${LD_LIBRARY_PATH}" =~ "boost" ]]; then
CM_SHARED_BOOST_PATH="/cm/shared/apps/boost/current"
CM_LOCAL_BOOST_PATH="/cm/local/apps/boost/current"
if [ -d $CM_SHARED_BOOST_PATH ]; then
CM_BOOST_PATH=$CM_SHARED_BOOST_PATH
elif [ -d $CM_LOCAL_BOOST_PATH ]; then
CM_BOOST_PATH=$CM_LOCAL_BOOST_PATH
else
warnMsg "boost not found in shared place; try 'module load boost'?"
fi
if [ -n "${CM_BOOST_PATH}" ]; then
infoMsg "Found boost at ${CM_BOOST_PATH}/"
# for cmake to use boost
export BOOST_ROOT="${CM_BOOST_PATH}"
export BOOST_INCLUDEDIR="${CM_BOOST_PATH}/include"
export BOOST_LIBRARYDIR="${CM_BOOST_PATH}/lib64"
# system paths
export CPATH="${CM_BOOST_PATH}/include:${CPATH}"
export LIBRARY_PATH="${CM_BOOST_PATH}/lib64:${LIBRARY_PATH}"
export LD_LIBRARY_PATH="${CM_BOOST_PATH}/lib64:${LD_LIBRARY_PATH}"
fi
fi
checkMsg "After ..."
echo $CPATH
echo $LIBRARY_PATH
echo $LD_LIBRARY_PATH