Skip to content

Commit

Permalink
Merge pull request #518 from awvwgk/cmake-args
Browse files Browse the repository at this point in the history
Allow pass-through CMake arguments in build script
  • Loading branch information
nicolasbock authored Jul 11, 2021
2 parents 97e8915 + a941e0d commit 7810b92
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ EOF
echo "BML_ELLBLOCK_MEMPOOL Use ellblock memory pool (default is ${BML_ELLBLOCK_MEMPOOL}"
echo "CUDA_TOOLKIT_ROOT_DIR Path to CUDA dir (default is ${CUDA_TOOLKIT_ROOT_DIR})"
echo "INTEL_OPT {yes, no} (default is ${INTEL_OPT})"
echo "CMAKE_ARGS pass-through CMake flags (default is ${CMAKE_ARGS})"
}

set_defaults() {
Expand Down Expand Up @@ -125,6 +126,7 @@ set_defaults() {
: ${BML_ELLBLOCK_MEMPOOL:=no}
: ${CUDA_TOOLKIT_ROOT_DIR:=}
: ${INTEL_OPT:=no}
: ${CMAKE_ARGS:=}
}

die() {
Expand Down Expand Up @@ -209,18 +211,19 @@ configure() {
-DBML_ELLBLOCK_MEMPOOL="${BML_ELLBLOCK_MEMPOOL}" \
-DCUDA_TOOLKIT_ROOT_DIR="${CUDA_TOOLKIT_ROOT_DIR}" \
-DINTEL_OPT="${INTEL_OPT:=no}" \
${CMAKE_ARGS} \
| tee --append "${LOG_FILE}"
check_pipe_error
cd "${TOP_DIR}"
}

compile() {
make -C "${BUILD_DIR}" | tee --append "${LOG_FILE}"
cmake --build "${BUILD_DIR}" | tee --append "${LOG_FILE}"
check_pipe_error
}

docs() {
make -C "${BUILD_DIR}" docs 2>&1 | tee --append "${LOG_FILE}"
cmake --build "${BUILD_DIR}" --target docs 2>&1 | tee --append "${LOG_FILE}"
check_pipe_error
#make -C "${BUILD_DIR}/doc/latex" 2>&1 | tee -a "${LOG_FILE}"
#check_pipe_error
Expand All @@ -230,7 +233,7 @@ docs() {
}

install() {
make -C "${BUILD_DIR}" install 2>&1 | tee --append "${LOG_FILE}"
cmake --install "${BUILD_DIR}" 2>&1 | tee --append "${LOG_FILE}"
check_pipe_error
}

Expand Down Expand Up @@ -284,7 +287,7 @@ tags() {
}

dist() {
make -C "${BUILD_DIR}" dist 2>&1 | tee --append "${LOG_FILE}"
cmake --build "${BUILD_DIR}" --target dist 2>&1 | tee --append "${LOG_FILE}"
check_pipe_error
}

Expand Down

0 comments on commit 7810b92

Please sign in to comment.