Skip to content

Commit

Permalink
Merge pull request #63 from GEOS-ESM/feature/mathomp4/allow-no-f2py
Browse files Browse the repository at this point in the history
Add ability to not allow f2py code to build for CI
  • Loading branch information
patricia-nasa authored Nov 4, 2024
2 parents c835392 + 428e374 commit 950c7fc
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 8 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
26 changes: 18 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,37 +76,47 @@ 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
```
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=<path>
```
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
Expand Down
5 changes: 5 additions & 0 deletions src/f2py/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ 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)


Expand Down Expand Up @@ -58,3 +62,4 @@ esma_set_this ( OVERRIDE GMAOpyobs )
)
add_dependencies(sgp4_ ${this})

endif (USE_F2PY)

0 comments on commit 950c7fc

Please sign in to comment.