-
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
Frontend for TSMP2 #24
Conversation
- add shell script build_tsmp2.sh - CMakeLists.txt adaptations - Revise README and add quickstart with front-end - update gitignore
Thanks @s-poll , this PR looks great! I had a slight confusion with the ouptut in the log file:
In particular the |
Regarding PDAF, I was up to now using
I guess, I should replace The existing code now breaks for eCLM-PDAF (at least of With this change implemented, I get a NetCDF-error in the very last step:
With that, I have to leave it for now. Maybe you know, what could be changed to the CMake-commands that could lead to NetCDF-issue like that. |
-clean up confusing messages in CMakeLists.txt -add message to indicate cmake call -change ICON build according to model component not comp_srcs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work @s-poll! I have left a number of comments on build_tsmp2.sh
. When writing a front-end script, we have to be more careful on designing the interface, since interfaces (or APIs in general) are expected to not change over time. Here are the general principles I observe when doing so:
- Follow established syntax conventions for writing command-line options. See 1, 2)
- Avoid feature bloat. it's better to have fewer options than more. A shellscript with few options is easier to maintain and easier to use. Ideally, the front-end should have a small set of options that covers most simple use cases. If more build options are necessary, either use
cmake
directly or pass those extra options tocmake
via the--
syntax. Here's an example of how--
can be used:
$ cmake --build
Usage: cmake --build <dir> [options] [-- [native-options]]
cmake --build --preset <preset> [options] [-- [native-options]]
Options:
<dir> = Project binary directory to be built.
--preset <preset>, --preset=<preset>
= Specify a build preset.
--list-presets
= List available build presets.
--parallel [<jobs>], -j [<jobs>]
= Build in parallel using the given number of jobs.
If <jobs> is omitted the native build tool's
default number is used.
The CMAKE_BUILD_PARALLEL_LEVEL environment variable
specifies a default parallel level when this option
is not given.
--target <tgt>..., -t <tgt>...
= Build <tgt> instead of default targets.
--config <cfg> = For multi-configuration tools, choose <cfg>.
--clean-first = Build target 'clean' first, then build.
(To clean only, use --target 'clean'.)
--verbose, -v = Enable verbose output - if supported - including
the build commands to be executed.
-- = Pass remaining options to the native tool.
-add version in build_tsmp2.sh -fix spelling quiet in build_tsmp2.sh -change bash shebang for more portability in build_tsmp2.sh -add pipefail in build_tsmp2.sh -rephrase tip in README -change header to Building TSMP2 with CMake in README
-use function for OASIS3 build check -shift MODELCOUNT to function -add TSMP2_ENV output in build_tsmp2.sh log
Both @jjokella it'd be nice if you could also test again, at least for eCLM-PDAF.. also if you've observed more issues kindly raise them here I think we can merge Stefan's PR once |
- take cmake_tsmp2_dir as cmake source directory
d8ff201
to
f2c82f5
Compare
I would like to merge the PR. Are there any objections? In my test all combinations worked (have not checked COSMO,CLM3.5). In the testing, however, I found two weaknesses, which might be tackled in future.
|
Looks good @s-poll ! I've also re-tested the latest changes and the build script works. |
eCLM-PDAF also builds now for me using the simple Regarding PDAF and in-repo changes. This is true. For a start I have integrated PDAF into TSMP2 by adding the Lines 156 to 165 in 7ea08d8
From TSMP2-side, a better CMake-integration would be nice. From PDAF side this includes some more work. See also https://github.com/HPSCTerrSys/pdaf/blob/tsmp-pdaf-patched/make.arch/cmake.h for the Makefile header file that reads the variables set in TSMP2's CMake files. |
This PR introduces a top-level script that makes building TSMP2 models simple and easy to understand and enhances the cmake script with additional options.
The main changes include:
Smaller changes:
The defaults for building are defined in CmakeLists.txt with the exception of the source and build directory.
Why was the top-level shell script chosen?
@jjokella : Even though, if the changes should not affect you, would be great if you could have a check, if this effects pdaf.