-
Notifications
You must be signed in to change notification settings - Fork 3
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
A better way of supporting legacy CABLE build systems #244
Comments
`ld` flags are currently specified incorrectly. For example: 1. `-lnetcdf` is not required since it is a dependency of the netCDF Fortran library - only `-lnetcdff` is needed. 2. `ld` flags are being split across two variables: `LDFLAGS` and `LD` when there should only be one (`LD` typically refers to the path to the `ld` executable). Having the flags split across two variables allows for the flags to be passed to the compiler in an inconsistent way. See #198 for more details. This change removes the `LD` variable and any hard-coded linker flags or include flags in the Makefile or build script. Linker flags and include flags are replaced with a query to `pkg-config` so that the correct flags are used. Using `pkg-config` also insulates the build system from changes to library versions and dependencies. ~~This PR should ideally be done after #197 is merged so that we can verify compiled object files have not been altered as a result of this change.~~ Compiled object files are identical between this branch and the main branch. However, the executables differ between the two branches due to changes in the compiler arguments at the linking step. Regression tests using [benchcab](https://github.com/CABLE-LSM/benchcab)* (bitwise comparison of model output via nccmp) show that model output is bitwise identical between the current branch and the main branch for serial and MPI model runs. *executables were built manually for the spatial case (see this related issue: CABLE-LSM/benchcab#244). Fixes #198 <!-- readthedocs-preview cable start --> ---- 📚 Documentation preview 📚: https://cable--199.org.readthedocs.build/en/199/ <!-- readthedocs-preview cable end -->
We can add a new parameter that takes in a shell command (or a series of shell commands by specifying a multiline string) run from the root directory of the CABLE repository. For example: build_run: |
cd offline
./build.sh --some-flag |
After discussing with @ccarouge, we have decided to add support for spack and to deprecate support for legacy CABLE build systems in benchcab. This adds the requirement that users will only be able to test benchcab on branches that can be built by spack. ACCESS-NRI will help with transitioning legacy build systems to use the latest build system compatible with spack. Moving to spack will solve existing issues around supporting bespoke build scripts (e.g. #244, #249). This is the best way forward considering support for legacy build systems is a temporary that will be deprecated sooner or later. Closing this issue. |
We currently support building legacy CABLE versions via the
build_script
key, where a path to a build script can be provided for benchcab to execute at the build step. Some issues with this approach are:This functionality will be needed as most development versions of CABLE will have different build systems, especially when there are significant developments to the CABLE build system for the main branch (e.g. CABLE-LSM/CABLE#200) .
Note, see here for a relevant discussion around this issue.
The text was updated successfully, but these errors were encountered: