Skip to content

Commit

Permalink
Merge branch 'dev-weh' of github.com:sandialabs/coek into dev-weh
Browse files Browse the repository at this point in the history
  • Loading branch information
whart222 committed Jun 11, 2024
2 parents 25ca1b4 + c6a5bec commit 3d24041
Showing 1 changed file with 18 additions and 10 deletions.
28 changes: 18 additions & 10 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
#!/bin/bash -e
#!/bin/bash -ev
#
# This scripts builds Coek in the `_build` directory to support local
# development and debugging.
#
# This uses Spack to install third-party dependencies in the `_spack` directory.
#
with_python="OFF"
python_exe=""
spack_reinstall=0
spack_dev=0
clang=0
debug="OFF"
python_exe=""
spack_dev=0
spack_env="coekenv"
spack_home=`pwd`/_spack
spack_reinstall=0
with_python="OFF"
with_valgrind=""
while [[ $# -gt 0 ]]; do
case $1 in
--help)
echo "build.sh [--help] [--clang] [--debug] [--python] [--python-exe <file>] [--spack-dev] [--spack-home <dir>] [--spack-reinstall] [--valgrind]"
echo "build.sh [--help] [--clang] [--debug] [--python] [--python-exe <file>] [--spack-dev] [--spack-env <env>] [--spack-home <dir>] [--spack-reinstall] [--valgrind]"
exit
;;
--clang)
Expand All @@ -27,6 +28,11 @@ while [[ $# -gt 0 ]]; do
debug="ON"
shift
;;
--spack-env)
spack_env="$2"
shift
shift
;;
--python)
with_python="ON"
shift
Expand Down Expand Up @@ -108,9 +114,9 @@ else
. ${SPACK_HOME}/share/spack/setup-env.sh
spack repo add _spack_tpls/repo
spack repo list
spack env create coekenv
spack env activate coekenv
spack add asl cppad fmt rapidjson catch2 highs $with_valgrind
spack env create $spack_env
spack env activate $spack_env
spack add asl fmt rapidjson catch2 highs $with_valgrind
spack install
spack env deactivate
spack repo remove _spack_tpls/repo
Expand All @@ -126,5 +132,7 @@ echo "Building Coek"
echo ""
mkdir _build
cd _build
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 ..
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=OFF -Dwith_fmtlib=ON -Dwith_rapidjson=ON -Dwith_catch2=ON -Dwith_tests=ON -Dwith_asl=ON -Dwith_openmp=OFF ..
make -j20
make install

0 comments on commit 3d24041

Please sign in to comment.