From 1d78362ef51649664ba6e4dac0b77d2691b0a9d0 Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Wed, 30 Oct 2024 11:01:59 -0400 Subject: [PATCH 1/3] Add ability to not allow f2py code to build for CI --- CHANGELOG.md | 1 + src/f2py/CMakeLists.txt | 2 ++ 2 files changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ac4aead..3ca69e3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Mainly for newer ESMA_env that allows building on RHEL8 GMAO machines (e.g., calculon) - Use postfix-@ for subrepos to match AeroApps +- Allow ability to not build f2py code for CI purposes ### Fixed - missing conversion from the sulfate ion to ammonium sulfate diff --git a/src/f2py/CMakeLists.txt b/src/f2py/CMakeLists.txt index 8b15401..e884f1f 100644 --- a/src/f2py/CMakeLists.txt +++ b/src/f2py/CMakeLists.txt @@ -8,6 +8,7 @@ esma_set_this ( OVERRIDE GMAOpyobs ) # cmake requirements # ------------------ +if (USE_F2PY) find_package(F2PY3 REQUIRED) @@ -58,3 +59,4 @@ esma_set_this ( OVERRIDE GMAOpyobs ) ) add_dependencies(sgp4_ ${this}) +endif (USE_F2PY) From 0a420c979af6db48e0a5db6362ad79a534c1e1b3 Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Wed, 30 Oct 2024 11:03:01 -0400 Subject: [PATCH 2/3] Add comment --- src/f2py/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/f2py/CMakeLists.txt b/src/f2py/CMakeLists.txt index e884f1f..6d6fb18 100644 --- a/src/f2py/CMakeLists.txt +++ b/src/f2py/CMakeLists.txt @@ -8,6 +8,9 @@ esma_set_this ( OVERRIDE GMAOpyobs ) # cmake requirements # ------------------ +# NOTE: For CI purposes, f2py is hard to support. Until +# a solution can be found, we add a flag to allow +# the user to disable f2py in these circumstances if (USE_F2PY) find_package(F2PY3 REQUIRED) From 428e374f5b37d661028d4b0a9bc86719f05889b2 Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Fri, 1 Nov 2024 08:49:27 -0400 Subject: [PATCH 3/3] Update readme --- README.md | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index f80583e..be23fc8 100644 --- a/README.md +++ b/README.md @@ -76,9 +76,11 @@ Run the cmake_it script ``` #### Multi-step build + Follow these instructions for managing multi-version builds, or custom builds. ##### Create build directory + We currently do not allow in-source builds of GEOSgcm. So we must make a directory: ``` mkdir build @@ -86,27 +88,35 @@ mkdir build The advantages of this is that you can build both a Debug and Release version with the same clone if desired. ##### Run cmake + CMake generates the Makefiles needed to build the model. ``` -cd build -cmake .. -DBASEDIR=$BASEDIR/Linux -DCMAKE_Fortran_COMPILER=ifort -DCMAKE_INSTALL_PREFIX=../install +cmake -B build -DBASEDIR=$BASEDIR/Linux -DCMAKE_Fortran_COMPILER=ifort --install-prefix=$(pwd)/install ``` -This will install to a directory parallel to your `build` directory. If you prefer to install elsewhere change the path in: -``` --DCMAKE_INSTALL_PREFIX= -``` -and CMake will install there. +This will install to a directory `install` parallel to your `build` directory. If you prefer to install elsewhere change +the `--install-prefix` option and CMake will install there. ##### Building with debugging flags + To build with debugging flags add: ``` -DCMAKE_BUILD_TYPE=Debug ``` to the cmake line. +##### Disabling f2py + +To disable building of f2py modules add: +``` +-DUSE_F2PY=OFF +``` +NOTE: This is really only used for systems that do not (yet) support f2py like those used in CI. As the f2py +code in GMAOpyobs is essential for the code to work, this should not be used in general. + ### Compile and install with make + ``` -make -j6 install +cmake --build build --target install -j 6 ``` ## How to build GMAOpyobs on other systems