-
Notifications
You must be signed in to change notification settings - Fork 6
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
Solve dependency problems between targets/dependencies and ensure parallel builds succeed #192
Closed
Tracked by
#188
Comments
4 tasks
2 tasks
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
Many of the rules in the current Makefile are missing dependencies. This causes the compilation to fail when we compile in parallel via
make -j
.The text was updated successfully, but these errors were encountered: