This repository has been archived by the owner on May 21, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_base.sh
executable file
·70 lines (63 loc) · 1.82 KB
/
build_base.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
#!/bin/sh
set -e
export STACKROOT=$(pwd)
# Source configuration options
config=${1:-"config/config.sh"}
source $config
set -x
# First determine if COMPILER needs to be built or loaded
case ${BUILD_COMPILER} in
"native-module")
echo "USING NATIVE COMPILER MODULE"
module load $COMPILER
;;
"setup-module")
echo "SETTING UP A MODULEFILE FOR $COMPILER"
pkgName=$(echo $COMPILER | cut -d- -f1)
pkgVersion=$(echo $COMPILER | cut -d- -f2)
ush/deploy_module.sh "core" "$pkgName" "$pkgVersion"
;;
"from-source")
echo "BUILD COMPILER FROM SOURCE"
if [[ ${FAMILY_COMPILER} =~ "gnu" ]]; then
ush/build_gnu.sh "$COMPILER" 2>&1 | tee "$LOGDIR/log.gnu"
else
echo "ERROR: COMPILER $COMPILER NOT FOUND: ABORT!"
exit 1
fi
;;
"skip")
echo "SKIPPING COMPILER BUILDING!"
;;
*)
echo "ERROR: UNKNOWN OPTION FOR BUILD_COMPILER = ${BUILD_COMPILER}: ABORT!"
exit 1
;;
esac
# Next determine if MPI needs to be built or loaded
case ${BUILD_MPI} in
"native-module")
echo "USING NATIVE MPI MODULE"
module load $COMPILER
module load $MPI
;;
"setup-module")
echo "SETTING UP A MODULEFILE FOR $MPI"
pkgName=$(echo $MPI | cut -d- -f1)
pkgVersion=$(echo $MPI | cut -d- -f2)
ush/deploy_module.sh "compiler" "$pkgName" "$pkgVersion"
;;
"from-source")
echo "BUILD MPI FROM SOURCE"
ush/build_szip.sh "$VER_szip" 2>&1 | tee "$LOGDIR/log.szip"
ush/build_mpi.sh "$MPI" 2>&1 | tee "$LOGDIR/log.$MPI"
;;
"skip")
echo "SKIPPING MPI BUILDING!"
;;
*)
echo "ERROR: UNKNOWN OPTION FOR BUILD_MPI = ${BUILD_MPI}: ABORT!"
exit 1
;;
esac
exit 0