Add simplified build system with meta-modules and wrapper scripts#4512
Add simplified build system with meta-modules and wrapper scripts#4512
Conversation
- Add build.sh wrapper script for simplified building - Add test.sh wrapper script for simplified testing - Add BUILD.md documentation - Created meta-modules (nag-stack, gfortran-stack) in ~/modulefiles/core/ - Simplifies workflow for AI agents and developers - Automatically handles module loading and DYLD_LIBRARY_PATH Resolves #4511 (partially - meta-modules and scripts, documentation update tracked separately)
|
@tclune This might only work for you...or only on bucy? For example, I don't have things like But if it helps you, that is good. I might suggest more modern CMake though a la: and then replace: with: You also don't ever do install with this: (and you should point to ${BUILD_DIR}). If you want that then you'd need to add a: Similarly for ctest you can do: For real safety, maybe BUILD_DIR and INSTALL_DIR should be full paths and even where the source is? Then you can do: |
|
Yes - this was just the initial response (recommendation) from claude after a lengthy set of questions. Not at all sure I like it and very much think of this as just the start of a discussion. |
|
Please make inline suggestions. I also now see that claude failed to bring the updated "skill" over from the other branch. (It did not follow my instructions and initially committed in on the wrong branch.) |
Address code review feedback from @mathomp4: - Use modern CMake syntax: -B, -S, --install-prefix, --test-dir - Use compiler-specific build and install directories - Use full paths (SOURCE_DIR, BUILD_DIR, INSTALL_DIR) for safety - Point cmake --build to BUILD_DIR explicitly - Add optional install prefix parameter to build.sh - Remove need to cd into build directory Changes: - build.sh: Use cmake -B/-S syntax, add full paths, show install command - test.sh: Use ctest --test-dir syntax, add full paths - CHANGELOG.md: Document new build system features
Co-authored-by: Matt Thompson <matthew.thompson@nasa.gov>
|
I wonder where Claude found that CMake version. The environment it was running in has v3.31.1. |
|
|
||
| # Use full paths for safety | ||
| SOURCE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| BUILD_DIR="${SOURCE_DIR}/build-${COMPILER}" |
There was a problem hiding this comment.
I use something like
BUILD_DIR="${SOURCE_DIR}/build/${COMPILER}/${BUILD_TYPE}”
Might be cleaner - you will need to gitignore only the build directory.
There was a problem hiding this comment.
Well, at the moment we ignore:
/build*
/install*so if it's a directory called that, we ignore it. Plus our CMake adds a .gitignore file to all build and install directories regardless of names.
| SOURCE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| BUILD_DIR="${SOURCE_DIR}/build-${COMPILER}" | ||
| if [[ -z "$INSTALL_PREFIX" ]]; then | ||
| INSTALL_DIR="${SOURCE_DIR}/install-${COMPILER}" |
| ### Running Tests | ||
|
|
||
| ```bash | ||
| ./test.sh [compiler] [test_pattern] |
There was a problem hiding this comment.
We’ll need build type, unless we assume that we are testing only the Debug build for that compiler
Summary
This PR introduces a simplified build system for MAPL that reduces cognitive load for both developers and AI agents by providing meta-modules and wrapper scripts.
Changes
Wrapper Scripts
build.sh- Simple build wrapper:./build.sh [compiler] [build_type]test.sh- Simple test wrapper:./test.sh [compiler] [test_pattern]BUILD.md- Comprehensive documentationMeta-Modules (Created in
~/modulefiles/core/)nag-stack- Loads NAG + OpenMPI + baselibsgfortran-stack- Loads GFortran + OpenMPI + baselibsBenefits
Before:
After:
Key Features
Related Issues
Testing
Meta-modules tested and confirmed working:
Scripts tested for proper module loading and error handling.