Skip to content
This repository was archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
Simplified RCAC build scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
daminton committed Feb 18, 2024
1 parent 51810a5 commit c34be47
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 41 deletions.
34 changes: 14 additions & 20 deletions buildscripts/build_rcac_gnu.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
#!/bin/zsh -l
# Builds Swiftest on the Purdue RCAC cluster system using the GNU compiler
# This is a convenience script for Kaustub
# The default build type is Release, in which case the Python package is installed in editable mode. Otherwise, only the Fortran
# library and executables are built, but not installed, so that the user can run them from the build directory.
# The default build type is Release. Pass other build types as a string argument.
#
# Example:
# $ buildscripts/build_rcac_gnu.sh "Debug"

set -a
SCRIPT_DIR=$(realpath $(dirname $0))
Expand Down Expand Up @@ -69,21 +71,13 @@ elif [[ $MACHINE_NAME == "negishi" ]]; then
fi

cmake -P distclean.cmake
if [[ BUILD_TYPE == "Release" ]]; then
pip install --config-settings=build-dir="build" \
--config-settings=cmake.build-type="${BUILD_TYPE}" \
--config-settings=cmake.args="-DUSE_SIMD=ON" \
--config-settings=cmake.args="-DUSE_OPENMP=ON" \
--config-settings=cmake.args="-DCMAKE_Fortran_COMPILER=gfortran" \
--config-settings=cmake.args="-DMACHINE_CODE_VALUE=\"Host\" " \
--config-settings=install.strip=false \
--no-build-isolation \
-ve .
else
cmake -P distclean.cmake
cmake -B ${ROOT_DIR}/build -S . -G Ninja \
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-DCMAKE_Fortran_COMPILER=gfortran

cmake --build ${ROOT_DIR}/build -j${OMP_NUM_THREADS} -v
fi
pip uninstall swiftest
pip install --config-settings=build-dir="build" \
--config-settings=cmake.build-type="${BUILD_TYPE}" \
--config-settings=cmake.args="-DUSE_SIMD=ON" \
--config-settings=cmake.args="-DUSE_OPENMP=ON" \
--config-settings=cmake.args="-DCMAKE_Fortran_COMPILER=gfortran" \
--config-settings=cmake.args="-DMACHINE_CODE_VALUE=\"Host\" " \
--config-settings=install.strip=false \
--no-build-isolation \
-ve .
37 changes: 16 additions & 21 deletions buildscripts/build_rcac_intel.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
#!/bin/zsh -l
# installs an editable (local) package on Bell
# This is a convenience script for Kaustub
# To use in Release mode, be sure to create the mintongroup module first. Using the RCAC tools it's the following commands:
# $ conda env create -f environment.yml
# $ conda-env-mod module -n mintongroup --jupyter
# To use in Release mode
# The default build type is Release. Pass other build types as a string argument.
#
# Example:
# $ buildscripts/build_rcac_intel.sh "Debug"


set -a
SCRIPT_DIR=$(realpath $(dirname $0))
Expand Down Expand Up @@ -77,21 +80,13 @@ fi


cmake -P distclean.cmake
if [[ $BUILD_TYPE == "Release" ]]; then
pip install --config-settings=build-dir="build" \
--config-settings=cmake.build-type="${BUILD_TYPE}" \
--config-settings=cmake.args="-DUSE_SIMD=ON" \
--config-settings=cmake.args="-DUSE_OPENMP=ON" \
--config-settings=cmake.args="-DCMAKE_Fortran_COMPILER=${FC}" \
--config-settings=cmake.args="-DMACHINE_CODE_VALUE=$MACHINE_CODE_VALUE" \
--config-settings=install.strip=false \
--no-build-isolation \
-ve .
else
cmake -B ${ROOT_DIR}/build -S . -G Ninja \
-DMACHINE_CODE_VALUE=${MACHINE_CODE_VALUE} \
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-DCMAKE_Fortran_COMPILER=${FC} \

cmake --build ${ROOT_DIR}/build -j${OMP_NUM_THREADS} -v
fi
pip uninstall swiftest
pip install --config-settings=build-dir="build" \
--config-settings=cmake.build-type="${BUILD_TYPE}" \
--config-settings=cmake.args="-DUSE_SIMD=ON" \
--config-settings=cmake.args="-DUSE_OPENMP=ON" \
--config-settings=cmake.args="-DCMAKE_Fortran_COMPILER=${FC}" \
--config-settings=cmake.args="-DMACHINE_CODE_VALUE=$MACHINE_CODE_VALUE" \
--config-settings=install.strip=false \
--no-build-isolation \
-ve .

0 comments on commit c34be47

Please sign in to comment.