#!/usr/bin/env bash # shellcheck disable=SC1090,SC1091 BUILD_FLAGS="-O3 -std=c++17" QUDA_FLAGS="-DQUDA_MPI=ON -DQUDA_PRECISION=14 -DQUDA_RECONSTRUCT=4 -DQUDA_GPU_ARCH=sm_80" set -euo pipefail if (( $# != 1 )); then echo "usage: $(basename "$0") " 1>&2 exit 1 fi env_dir=$1 call_dir=$(pwd -P) mkdir -p ${env_dir} cd "${env_dir}" env_dir=$(pwd -P) cd "${call_dir}" build_dir="${env_dir}/build/quda" if [ -d "${build_dir}" ]; then echo "error: directory '${build_dir}' exists" exit 1 fi mkdir -p "${build_dir}" git clone https://github.com/lattice/quda.git "${build_dir}" cd "${build_dir}" mkdir build; cd build cmake .. $QUDA_FLAGS -DCMAKE_INSTALL_PREFIX=${env_dir}/prefix/quda make -j128 make install cd "${call_dir}"