Skip to content

Commit

Permalink
Merge pull request #98 from COSIMA/main
Browse files Browse the repository at this point in the history
Recent changes to build.sh script
  • Loading branch information
ezhilsabareesh8 authored Feb 11, 2024
2 parents e7ebf6c + 6f9085f commit 0a3eaa9
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 0a3eaa9

Please sign in to comment.