From 95b98b87a165bbc1b2c85ecbb710573247038c19 Mon Sep 17 00:00:00 2001 From: Micael Oliveira Date: Mon, 4 Dec 2023 11:37:38 +1100 Subject: [PATCH] Some changes to the build.sh script: - do not append the git hash to the executable anymore - installation is done purely with the "cmake --install" - installation directory is now a subdirectory of the directory where the script is to be found, named after the build type (e.g., access-om3/Release) --- build.sh | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/build.sh b/build.sh index 8f5fbb4..801f499 100755 --- a/build.sh +++ b/build.sh @@ -25,24 +25,14 @@ module load esmf/8.4.2 fms/git.2021.03.01=2021.03.01 parallelio/2.5.10 fortranxm module load intel-compiler/${COMPILER_VERSION} openmpi/${OPENMPI_VERSION} cd ${SCRIPT_DIR} -INSTALL_DIR=${SCRIPT_DIR} - -hash=`git rev-parse --short=7 HEAD` -test -z "$(git status --porcelain)" || hash=${hash}-modified # uncommitted changes or untracked files - for BUILD_TYPE in "${BUILD_TYPES[@]}"; do echo "BUILD_TYPE = "${BUILD_TYPE} rm -r build || true + INSTALL_DIR=${SCRIPT_DIR}/${BUILD_TYPE} cmake -S . -B build --preset=gadi -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DCMAKE_VERBOSE_MAKEFILE=ON cmake --build build -j 4 cmake --install build --prefix=${INSTALL_DIR} - for exec in ${INSTALL_DIR}/bin/*; do - dest=${INSTALL_DIR}/bin/$(basename ${exec}) - if [[ ${BUILD_TYPE} != "Release" ]] ; then dest=${dest}-${BUILD_TYPE}; fi - dest=${dest}-${hash} - mv ${exec} ${dest} - echo "Successfully built ${dest}" - done + echo "Successfully built ${INSTALL_DIR}" done