Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recent changes to build.sh script #98

Merged
merged 2 commits into from
Feb 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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