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

Improve build3.sh CLI by creating switches for serial Vs mpi and debug Vs non-debug #191

Closed
Tracked by #188
SeanBryan51 opened this issue Dec 11, 2023 · 0 comments · Fixed by #200
Closed
Tracked by #188

Comments

@SeanBryan51
Copy link
Collaborator

SeanBryan51 commented Dec 11, 2023

For example, it is currently not possible to enable debug mode and mpi mode simultaneously.

@SeanBryan51 SeanBryan51 changed the title Improve CLI by creating switches for serial Vs mpi and debug Vs non-debug. Improve build3.sh CLI by creating switches for serial Vs mpi and debug Vs non-debug Dec 11, 2023
@SeanBryan51 SeanBryan51 linked a pull request Feb 28, 2024 that will close this issue
2 tasks
SeanBryan51 added a commit that referenced this issue Mar 1, 2024
In preparation for building CABLE with [spack](https://spack.io/),
@harshula, @ccarouge and I have found areas where the current build
system for CABLE offline can be improved (see #188 for more details).
This change adds a [CMake](https://cmake.org/) based build system to
address these issues:

- #190
Although this problem can be solved in the Makefile by specifying the
relative paths to each source file, it requires updating all the
Makefile Fortran module dependency rules which is a pain. CMake
automatically handles Fortran module dependencies out of the box so
doing this with CMake is much easier.
- #191 
When invoking `cmake`, custom options, compilers and compiler flags can
be configurable by setting the appropriate variables via the [`-D`
flag](https://cmake.org/cmake/help/latest/manual/cmake.1.html#cmdoption-cmake-D),
for example: `cmake -DCMAKE_Fortran_COMPILER="mpif90"
-DCMAKE_Fortran_FLAGS="-O2 -fp-model precise" -S . -B build`. These can
be used for doing MPI only builds and enabling specific debug flags.
- #192 
As mentioned above, CMake automatically handles Fortran module
dependencies out of the box. Parallelised builds can be done by
specifying the `-j` flag to `cmake`.

The following pull requests should be merged before this pull request so
that we can demonstrate binary equivalence between the executables
compiled by both Makefile and CMake builds. This ensures no unwanted
changes are introduced by the transition.

- [x] #197
- [x] #199

Edit: the above PR's have been merged - the serial and MPI binaries
built by CMake (in release mode) are equivalent to the binaries built by
the Makefile based build system in the main branch.

Fixes #188, #190, #191, #192

<!-- readthedocs-preview cable start -->
----
📚 Documentation preview 📚:
https://cable--200.org.readthedocs.build/en/200/

<!-- readthedocs-preview cable end -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant