usp-utils: add NCAR-based library install + MPAS build workflow#8
usp-utils: add NCAR-based library install + MPAS build workflow#8daniloceano wants to merge 8 commits into
Conversation
Add a friendly, end-to-end install path under usp-utils/install/: - download_mpas_lib_sources.sh: fetch & verify the 6 library source tarballs (MPICH, zlib, HDF5, PnetCDF, NetCDF-C/Fortran) in the versions the build script expects; PnetCDF from the official Argonne mirror. - mpas_lib_install.sh: fix the build for gfortran >= 10 by adding -fallow-argument-mismatch to FFLAGS (MPICH's F77 check uses FFLAGS; without it MPICH never builds, cascading into "C compiler cannot create executables" in later libs that use the missing mpicc). - INSTALL_GUIDE.md: full recommended flow (conda -> julia -> source env -> build libs -> compile MPAS -> setup run dir), with the Julia LD_LIBRARY_PATH and Zeros caveats and a troubleshooting section. - .gitignore: keep machine-specific *.local.sh copies out of the repo. README.md: document the install/build flow and the copy-to-.local.sh pattern. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Use mpas_build_env.local.sh (git-ignored) consistently, sourced for both building and running. - Add mpirun launch commands for the cores and note that running atmosphere_model with no inputs aborts via MPI_Abort (expected). - Complete prerequisites: make, bzip2, tar/gzip. - Clarify that steps 4-6 (build/compile) don't require the conda/Julia envs. - Note the template is already patched for gfortran >= 10. - Document that PIO is optional (SMIOL fallback); NETCDF/PNETCDF always needed. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…s optional Revert the -fallow-argument-mismatch change in the versioned template so it stays identical to the upstream NCAR script — users should try the original first. Document the fix instead, in a new "Known build issues (optional fixes)" section of INSTALL_GUIDE, to be applied in the user's .local.sh copy only if the MPICH build fails on gfortran >= 10. The note is explicit that the fix is compiler/OS-dependent and invites others to document alternative solutions. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The install/build docs no longer hard-reference the workaround installer or UPSTREAM_ISSUE_zeros_compat.md (which live on the separate julia/zeros-compat-workaround branch). The Julia Step 2 now keeps the universal LD_LIBRARY_PATH guidance and points to that branch for the temporary Zeros resolve conflict, so this PR is self-contained. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- setup_environment.sh: stop inferring env existence from 'conda activate's exit code (which gives a misleading "Couldn't find the environment" when the env exists but a transient activate returns non-zero). Now: ensure the 'conda' shell function is loaded (source conda.sh if only the binary is on PATH), check the env in 'conda env list', then activate. Clearer not-found message. - install_conda_environment.sh: add '#!/usr/bin/env bash' shebang. It uses bash-only features (BASH_SOURCE, '[ == ]'); running it with sh/dash failed with "Bad substitution" / "unexpected operator" and left SCRIPT_DIR empty. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
When a tool runs with HOME pointing at the repo, conda (cache+envs), shell history, and other per-user files get created here (.conda, .cache, .local, .config, .claude, .viminfo, ...). Ignore them so they don't pollute git status; the real ones live in $HOME and these copies are safe to delete. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
MPAS v8.4 miscompiles with gfortran 13 (builds, crashes at run time); gfortran 12 (the NCAR tutorial's version) produces a working model. Add mpas_lib_install_gcc12.sh — a gfortran-12 variant of the lib-install template (conda-forge gcc12 wrappers, separate libs-gcc12 prefix, generic $HOME paths) — and document the gcc12 toolchain in INSTALL_GUIDE (conda env, build steps, and the gcc12 build-environment block). Personal *.local.sh copies stay git-ignored. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
@daniloceano, I'm not sure it is worth compiling your own MPICH. I also don't think Claude is right by saying that MPAS doesn't run with GCC 13. I've run it with all versions of gcc from v10 to v16 currently. But I might have used OpenMPI instead of MPICH... Were you working in an environment where you had to compile MPI yourself in order to use MPAS? I would also drop PIO, that library brings lots of headaches and dependencies. Besides GCC and MPI, you really only need PNETCDF if you don't use PIO. Otherwise, you need NETCDF, HFD5, ZLIB, and maybe others. PNETCDF is its own implementation of the CDF file format; it doesn't need the NETCDF library to work. In summary, to use MPAS, you really only need GCC, some MPI implementation, and PNETCDF. This is what I think this PR should aim at: Downloading and compiling PNETCDF only and optionally download and compile MPICH. But I wouldn't download MPICH from NCAR's website, don't know how "persistent" that link will be... I'd download it from the official website. Also, MIPCH is at version 5.0 already, why use the 3.3 version? What do you think @pedrospeixoto ? |
|
@daniloceano, one last comment: I've always used |
What
Adds a friendly, end-to-end installation/build path to
usp-utils/, followingthe NCAR MPAS-Atmosphere library workflow, so users can prepare the toolchain
and compile MPAS with clear guidance.
New under
usp-utils/install/download_mpas_lib_sources.sh— downloads & integrity-checks the 6 librarysource tarballs (MPICH, zlib, HDF5, PnetCDF, NetCDF-C/Fortran) in the exact
versions the build script expects; PnetCDF from the official Argonne mirror.
mpas_lib_install.sh— the unmodified NCAR script (build MPICH → … → PIO).Kept pristine: users try it first.
INSTALL_GUIDE.md— full recommended flow (conda → julia → source env →build libs → compile MPAS → setup run dir), with a "Known build issues
(optional fixes)" section (e.g. the gfortran ≥ 10
FFLAGSfix) to apply onlyif the build fails, and a troubleshooting section.
.gitignore— keeps machine-specific*.local.shcopies out of the repo(copy-template → edit
.local.shpattern).README.mdDocuments the install/build flow and the
.local.shpattern.Notes
Zerosworkaround is intentionally not in this PR; itlives on the
julia/zeros-compat-workaroundbranch and will be handledseparately. The docs here only point to it.
swell(gfortran 13.3): libraries built, both corescompiled (
init_atmosphere_model,atmosphere_model), andsetup_run_dir.pyverified.