Skip to content

Commit 0904b7c

Browse files
committed
Expanding build options
1 parent 37ab577 commit 0904b7c

File tree

1 file changed

+17
-9
lines changed

1 file changed

+17
-9
lines changed

Diff for: build.sh

+17-9
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
1-
#!/bin/bash -e
1+
#!/bin/bash -ev
22
#
33
# This scripts builds Coek in the `_build` directory to support local
44
# development and debugging.
55
#
66
# This uses Spack to install third-party dependencies in the `_spack` directory.
77
#
8-
with_python="OFF"
9-
python_exe=""
10-
spack_reinstall=0
11-
spack_dev=0
128
clang=0
139
debug="OFF"
10+
python_exe=""
11+
spack_dev=0
12+
spack_env="coekenv"
1413
spack_home=`pwd`/_spack
14+
spack_reinstall=0
15+
with_python="OFF"
1516
with_valgrind=""
1617
while [[ $# -gt 0 ]]; do
1718
case $1 in
1819
--help)
19-
echo "build.sh [--help] [--clang] [--debug] [--python] [--python-exe <file>] [--spack-dev] [--spack-home <dir>] [--spack-reinstall] [--valgrind]"
20+
echo "build.sh [--help] [--clang] [--debug] [--python] [--python-exe <file>] [--spack-dev] [--spack-env <env>] [--spack-home <dir>] [--spack-reinstall] [--valgrind]"
2021
exit
2122
;;
2223
--clang)
@@ -27,6 +28,11 @@ while [[ $# -gt 0 ]]; do
2728
debug="ON"
2829
shift
2930
;;
31+
--spack-env)
32+
spack_env="$2"
33+
shift
34+
shift
35+
;;
3036
--python)
3137
with_python="ON"
3238
shift
@@ -108,8 +114,8 @@ else
108114
. ${SPACK_HOME}/share/spack/setup-env.sh
109115
spack repo add _spack_tpls/repo
110116
spack repo list
111-
spack env create coekenv
112-
spack env activate coekenv
117+
spack env create $spack_env
118+
spack env activate $spack_env
113119
spack add asl cppad fmt rapidjson catch2 highs $with_valgrind
114120
spack install
115121
spack env deactivate
@@ -126,5 +132,7 @@ echo "Building Coek"
126132
echo ""
127133
mkdir _build
128134
cd _build
129-
cmake -DCMAKE_PREFIX_PATH=${SPACK_HOME}/var/spack/environments/coekenv/.spack-env/view -Dwith_debug=${debug} -Dwith_python=${with_python} $python_exe -Dwith_gurobi=$with_gurobi -Dwith_highs=ON -Dwith_cppad=ON -Dwith_fmtlib=ON -Dwith_rapidjson=ON -Dwith_catch2=ON -Dwith_tests=ON -Dwith_asl=ON -Dwith_openmp=OFF ..
135+
cmake -DCMAKE_PREFIX_PATH=${SPACK_HOME}/var/spack/environments/${spack_env}/.spack-env/view -Dwith_debug=${debug} -Dwith_python=${with_python} $python_exe -Dwith_gurobi=$with_gurobi -Dwith_highs=ON -Dwith_cppad=ON -Dwith_fmtlib=ON -Dwith_rapidjson=ON -Dwith_catch2=ON -Dwith_tests=ON -Dwith_asl=ON -Dwith_openmp=OFF ..
130136
make -j20
137+
make install
138+

0 commit comments

Comments
 (0)