-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathload_oft_env.sh
More file actions
executable file
·81 lines (63 loc) · 2.63 KB
/
load_oft_env.sh
File metadata and controls
executable file
·81 lines (63 loc) · 2.63 KB
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
#!/bin/bash
# Script to load OFT environment.
# This script sets all the paths to the OFT and its submodule executables.
# To use this script, source it in your BASH terminal with:
# . load_oft_env.sh
# You should then have all executables and scripts in your path,
# allowing you to run OFT.
# Note - this assumes you have followed the instructions in each submodule
# to build/compile each submodule.
cR="\033[1;31m"
cG="\033[32m"
cX="\033[0m"
cM="\033[35m"
echo="echo -e"
${echo} "${cG}==> OFT Environment Setup${cX}"
(return 0 2>/dev/null) && sourced=1 || sourced=0
if [ $sourced -eq "0" ]
then
${echo} "${cR}==> ERROR! It seems this script was executed instead of being sourced.${cX}"
${echo} "${cR} Please source this script with: '. load_oft_env.sh'${cX}"
exit 1
fi
oft_dir="$( dirname -- "$( readlink -f -- "${BASH_SOURCE[0]}"; )"; )"
echo "==> Checking that submodule components are installed..."
if [ ! -e ${oft_dir}/magmap/bin ]
then
${echo} "${cR}==> ERROR! MAGMAP submodule seems to be missing!${cX}"
${echo} "${cR} Please ensure the submodule was checked out${cX}"
${echo} "${cR} with: 'git clone --recursive' ${cX}"
${echo} "${cR} or activate submodules with: 'git submodule update --init'.${cX}"
return
fi
if [ ! -e ${oft_dir}/conflow/bin ]
then
${echo} "${cR}==> ERROR! CONFLOW submodule seems to be missing!${cX}"
${echo} "${cR} Please ensure the submodule was checked out${cX}"
${echo} "${cR} with: 'git clone --recursive' ${cX}"
${echo} "${cR} or activate submodules with: 'git submodule update --init'.${cX}"
return
fi
if [ ! -e ${oft_dir}/hipft/bin ]
then
${echo} "${cR}==> ERROR! HIPFT submodule seems to be missing!${cX}"
${echo} "${cR} Please ensure the submodule was checked out${cX}"
${echo} "${cR} with: 'git clone --recursive' ${cX}"
${echo} "${cR} or activate submodules with: 'git submodule update --init'.${cX}"
return
fi
if [ ! -e ${oft_dir}/conflow/bin/conflow ]
then
${echo} "${cM}==> WARNING! CONFLOW does not seem to be built.${cX}"
${echo} "${cM} If you plan to use ConFlow, please ensure the submodule${cX}"
${echo} "${cM} was checked out and build the code.${cX}"
fi
if [ ! -e ${oft_dir}/hipft/bin/hipft ]
then
${echo} "${cM}==> WARNING! HIPFT does not seem to be built!${cX}"
${echo} "${cM} If you plan to use HipFT, please ensure the submodule${cX}"
${echo} "${cM} was checked out and build the code.${cX}"
fi
echo "==> Appending OFT and its submodules located at [${oft_dir}] to PATH..."
export PATH=${oft_dir}:${oft_dir}/bin:${oft_dir}/magmap/bin:${oft_dir}/conflow/bin:${oft_dir}/hipft/bin:$PATH
${echo} "${cG}==> Done!${cX}"