File tree 1 file changed +22
-8
lines changed
1 file changed +22
-8
lines changed Original file line number Diff line number Diff line change @@ -9,26 +9,36 @@ with_python="OFF"
9
9
spack_reinstall=0
10
10
spack_dev=0
11
11
clang=0
12
- for arg ; do
13
- case " $arg " in
12
+ spack_home=` pwd` /_spack
13
+ while [[ $# -gt 0 ]]; do
14
+ case $1 in
14
15
--help)
15
- echo " build.sh [--python] [--clang] [--spack-reinstall] [--spack-dev] [--help]"
16
+ echo " build.sh [--python] [--clang] [--spack-reinstall] [--spack-dev] [--spack-home <dir>] [-- help]"
16
17
exit
17
18
;;
18
19
--python)
19
20
with_python=" ON"
21
+ shift
20
22
;;
21
23
--clang)
22
24
clang=1
25
+ shift
23
26
;;
24
27
--spack-reinstall)
25
28
spack_reinstall=1
29
+ shift
26
30
;;
27
31
--spack-dev)
28
32
spack_dev=1
33
+ shift
34
+ ;;
35
+ --spack-home)
36
+ spack_home=" $2 "
37
+ shift
38
+ shift
29
39
;;
30
40
* )
31
- echo " unknown option: ${arg} "
41
+ echo " unknown option: $1 "
32
42
exit
33
43
;;
34
44
esac
37
47
#
38
48
# Setup directories
39
49
#
40
- export SPACK_HOME=` pwd ` /_spack
50
+ export SPACK_HOME=${spack_home}
41
51
echo " SPACK_HOME=${SPACK_HOME} "
42
52
if [[ " ${spack_reinstall} " -eq 1 ]]; then
43
- rm -Rf ${SPACK_HOME}
53
+ \ r m -Rf ${SPACK_HOME}
44
54
fi
45
55
\r m -Rf _build
46
56
#
70
80
echo " Installing Coek dependencies using Spack"
71
81
echo " "
72
82
if [[ " $spack_dev " -eq 0 ]]; then
73
- git clone https://github.com/or-fusion/spack.git _spack
83
+ git clone https://github.com/or-fusion/spack.git ${SPACK_HOME}
74
84
else
75
- git clone
[email protected] :or-fusion/spack.git
_spack
85
+ git clone
[email protected] :or-fusion/spack.git
${SPACK_HOME}
76
86
fi
77
87
. ${SPACK_HOME} /share/spack/setup-env.sh
78
88
spack env create coekenv
81
91
spack install
82
92
spack env deactivate
83
93
fi
94
+ if test -d ${SPACK_HOME} ; then
95
+ export SPACK_HOME=$( cd ${SPACK_HOME} ; pwd)
96
+ echo " SPACK_HOME=${SPACK_HOME} "
97
+ fi
84
98
#
85
99
# Install coek
86
100
#
You can’t perform that action at this time.
0 commit comments