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

Functional CMake build scripts #1

Merged
merged 11 commits into from
Mar 11, 2021
Merged
Show file tree
Hide file tree
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
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
outputs/*
src/externals/mct/*/*.o
src/externals/mct/*/*.mod
src/externals/mct/*/*.a
src/externals/mct/Makefile.conf
src/externals/mct/config.h
src/externals/mct/config.log
src/externals/mct/config.status
40 changes: 40 additions & 0 deletions build_tools/build.juwels-centos8
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/usr/bin/env bash

# ------- User-specified variables ------------
ARCH="juwels-centos8"
CLM5_TSMP_ROOT=$(git rev-parse --show-toplevel)
BUILD_FOLDER="$CLM5_TSMP_ROOT/outputs/$ARCH/build"
INSTALL_PATH="$CLM5_TSMP_ROOT/outputs/$ARCH/run"
# ---------------------------------------------

module purge
module use $OTHERSTAGES
module load Stages/2020
module load Intel
module load ParaStationMPI
module load ESMF
module load NCO
module load Perl
module load CMake
module load parallel-netcdf
module load imkl
module load NCL
module load Python
module li

echo "NetCDF_C_PATH=$EBROOTNETCDF"
echo "NetCDF_Fortran_PATH=$EBROOTNETCDFMINFORTRAN"
echo "PnetCDF_C_PATH=$EBROOTPARALLELMINNETCDF"
GENF90_PATH=$(pwd)
rm -rf $BUILD_FOLDER
cmake -S "$CLM5_TSMP_ROOT/src" \
-B "$BUILD_FOLDER" \
-DCMAKE_MODULE_PATH="$(pwd)/cmake" \
-DCMAKE_C_COMPILER=mpicc \
-DCMAKE_Fortran_COMPILER=mpifort \
-DGENF90_PATH=$GENF90_PATH \
-DNetCDF_C_PATH=$EBROOTNETCDF \
-DNetCDF_Fortran_PATH=$EBROOTNETCDFMINFORTRAN \
-DPnetCDF_PATH=$EBROOTPARALLELMINNETCDF
cmake --build "$BUILD_FOLDER" --clean-first
cmake --install "$BUILD_FOLDER"
23 changes: 23 additions & 0 deletions build_tools/build.ubuntu-20.04LTS
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env bash

# ------- User-specified variables ------------
ARCH="ubuntu-20.04LTS"
CLM5_TSMP_ROOT=$(git rev-parse --show-toplevel)
BUILD_FOLDER="$CLM5_TSMP_ROOT/outputs/$ARCH/build"
INSTALL_PATH="$CLM5_TSMP_ROOT/outputs/$ARCH/run"
# ---------------------------------------------

NetCDF_ROOT=/opt/custom
GENF90_PATH=$(pwd)
rm -rf $BUILD_FOLDER
cmake -S "$CLM5_TSMP_ROOT/src" \
-B "$BUILD_FOLDER" \
-DCMAKE_INSTALL_PREFIX="$INSTALL_PATH" \
-DCMAKE_MODULE_PATH="$(pwd)/cmake" \
-DCMAKE_C_COMPILER=mpicc \
-DCMAKE_Fortran_COMPILER=mpifort \
-DGENF90_PATH=$GENF90_PATH \
-DNetCDF_PATH=$NetCDF_ROOT \
-DPnetCDF_PATH=$NetCDF_ROOT
cmake --build "$BUILD_FOLDER" --clean-first
cmake --install "$BUILD_FOLDER"
Loading