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

Add ability to not allow f2py code to build for CI #63

Merged
merged 3 commits into from
Nov 4, 2024
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
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)
Loading