HPSCTerrSys / TSMP2

CMake-based TerrSysMP
https://github.com/HPSCTerrSys/TSMP
MIT License
1 stars 2 forks source link

Minimal build script for building CLM3.5-ParFlow-PDAF #7

Closed jjokella closed 1 year ago

jjokella commented 1 year ago

I have included a minimal build script for compiling TSMP-PDAF (CLM3.5-ParFlow-PDAF) on top of the CMake-build of the component models.

Additionally I have slightly adapted the manual and I had to disable SLURM in BuildParFlow.cmake.

The minimal build script is a drastically reduced version of the build script from version 1 of TSMP-PDAF. Changes include the usage of a pre-patched PDAF: https://github.com/HPSCTerrSys/pdaf

The goal is that TSMP-PDAF will also be built by a CMake framework and this minimal build script should be a first step to make this possible.

kvrigor commented 1 year ago

Hey @jjokella! As eTSMP/TSMP2 is a build paradigm based purely on CMake, I'm a bit hesitant that we build PDAF through build_tsmp_pdaf.bsh. Can you convert it to a CMake script? First cmake/BuildPDAF.cmake needs to be created, and then you can refer to the build recipes under cmake/ for your implementation. The component models based on Makefile (e.g. CLM3.5, ICON, COSMO) are triggered through CMake, so it should also be possible for PDAF.

If everything works, users can build CLM3.5-ParFlow-PDAF by simply adding -DPDAF_SRC=${PDAF_DIR} in the cmake configure step:

# Build CLM3.5-ParFlow-PDAF
cmake -S . -B ${BUILD_DIR}                    \
      -DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \
      -DOASIS_SRC=${OASIS_SRC}                \
      -DPDAF_SRC=${PDAF_SRC}                  \
      -DCLM35_SRC=${CLM35_SRC}                \
      -DPARFLOW_SRC=${PARFLOW_SRC}
jjokella commented 1 year ago

Hi @kvrigor and thanks for the quick reply. The CMake script you describe is my goal and the minimized bash script is supposed to be a step towards this CMake script.

I may need a meetings / some kind of correspondence, because my CMake-knowledge is not sufficient to immediately write down a script, but I hope this is not too hard, as many of the complexities concerning paths of libraries etc. may be solved by CMake.

kvrigor commented 1 year ago

No problem Johannes! For the meantime is it OK if we park your branch under HPSCTerrSys/pdaf? I believe you have push access to this repo. I can help with the PDAF CMake script if we have a shared branch to work on.