GEOS-ESM / ESMA_cmake

Custom CMake macros for the GEOS Earth System Model
Apache License 2.0
4 stars 9 forks source link

Changes to support using ESMA_cmake without needing MPI and Baselibs #262

Closed mathomp4 closed 2 years ago

mathomp4 commented 2 years ago

This PR will track changes needed for using ESMA_cmake with codes that don't need MPI, netCDF, ESMF, etc.

This was spurred by the work of @amdasilva with AeroML which is (for the moment) pure Python/C/Fortran. No need for external libraries.

Note that I'll definitely be pinging @rmontuoro of UFS and @lizziel and @LiamBindle of Harvard as I work on this. I think they are actually good to go as they have shown @tclune and myself the right path forward.

Indeed, part of this PR is undoing some things I did for Spack work because, well, I was trying to be cute and clean. But sometimes CMake is ugly for good reasons!

ETA: Issues to consider:

  1. What if you build an ESMF_COMM=mpiuni version of Baselibs. This is obviously not going to work with GEOS/MAPL, but it is a valid Baselibs that could be useful for other projects. So MPI should be QUIET
  2. You could build a Baselibs without ESMF and just netCDF and this will currently fail as it assumes all Baselibs will have ESMF. This might not be true. → We need to put each lib in Baselibs in its own little detection area.
mathomp4 commented 2 years ago

Note that what is here is very alpha. I need to test with GEOSgcm, MAPL, etc. to make sure it's all good and that I don't royally hork up things for external users.

mathomp4 commented 2 years ago

Tested and seems to work.