# Building MOOSE from source

Verified end-to-end on Ubuntu 26.04 (resolute), 16 cores, 30 GB RAM,
gcc/gxx/gfortran 15 + mpich 5.0.2 from a mamba env. MOOSE master as of 2026-10,
PETSc v3.26.0, libMesh `342ad76` (1.9.0-pre), WASP 4.4.1-30.

**Observed wall clock, 16 cores:**

| Stage | Time |
|---|---|
| PETSc configure (downloads + builds 14 external packages) | 28 min |
| libMesh (`METHODS=opt` only) | 8.5 min |
| WASP | 17 s |
| MOOSE `modules/combined`, all modules, `-j8` | 25 min |
| **Total** | **~62 min** |

Peak RSS stayed under 20 GB at `-j8`. MOOSE uses **unity builds**
(`modules/*/build/unity_src/*_Unity.C`), which is why the compile-line count
looks absurdly low and why per-TU memory is high.

Working script: `the-compound/reactor/scripts/build_moose_from_source.sh`.
This file is the *why* behind it.

---

## 1. First check whether you even need this

INL ships the whole tree as conda packages on `conda.software.inl.gov/public`:
`petsc`, `libmesh`, `libmesh-vtk`, `wasp`, `seacas`, `pprof`, `pyhit`,
`moose-libmesh`, `moose-tools`, `moose-dev`, `moose`.

```bash
mamba create -n moose -c https://conda.software.inl.gov/public -c conda-forge moose
```

**The channel has recurring multi-hour 502 outages.** Cloudflare returns
`502 Bad Gateway` (can't reach origin); `/idaholab` returns a 403 JS challenge.
One session saw 84 consecutive 502s over an hour. This is a known, recurring
condition:

- GitHub discussion **idaholab/moose#31919** — "Cloudflare Bot Protection
  Blocking Conda Access", answered by maintainer `loganharbour`.
- A Feb 2026 reply on it: *"our servers were down overnight for updates."*
- Issue **#31737** — channel-address confusion. `idaholab/conda-moose` is
  **archived and dead**; the live address is `conda.software.inl.gov/public`.
- `anaconda.org/idaholab` is **empty**. There is no mirror.

Poll it in the background while you build from source:

```bash
while :; do
  printf '%s attempt=%s status=%s\n' "$(date -Is)" "$i" \
    "$(curl -s -o /dev/null -w '%{http_code}' https://conda.software.inl.gov/public/linux-64/repodata.json)"
  sleep 60
done >> /tmp/inl_channel_status.log
```

A `200` means the conda path is open and you can abandon the source build.

---

## 2. Host packages (apt)

MOOSE's own CI list is `docker_ci/apt_installs.sh` — authoritative, because that
Dockerfile builds MPICH + PETSc + libMesh + MOOSE from source on plain Ubuntu.

The **one that actually breaks the build**:

```
libtirpc-dev
```

`scripts/configure_libmesh.sh` passes `--enable-xdr-required`, and libMesh's
`m4/xdr.m4` falls back to `/usr/include/tirpc` + `-ltirpc`. It is not in the
mamba env and not installed by default.

Full required list (Ubuntu 26.04, verified with `apt-get install -s`: 57
packages, no conflicts):

```bash
sudo apt install -y \
  libtirpc-dev \
  gfortran m4 bison flex \
  autoconf automake libtool libtool-bin \
  texinfo patchelf \
  libnuma-dev libhwloc-dev libcurl4-gnutls-dev \
  python3-dev python3-pip
```

Optional: `libeigen3-dev`, `libomp-dev`, `libtbb-dev`, `hwloc-nox`.

**Deliberately skipped, and why:**

| Skipped | Reason |
|---|---|
| `freeglut3` `libgl1-mesa-dev` `libglu1-mesa-dev` `libx11-dev` | Only for VTK/OpenGL. `configure_libmesh.sh` builds **no VTK**, and PETSc gets `--with-x=0`. |
| `libblas-dev` `liblapack-dev` `libopenblas-dev` | PETSc does `--download-openblas=1 --download-openblas-commit=v0.3.33`. |
| `libhdf5-dev` | PETSc does `--download-hdf5=1`. Do **not** set `HDF5_DIR` — see §5. |
| `libboost-all-dev` | ~300 MB, in MOOSE's CI list but nothing in the build needs it. |
| `doxygen` `libgtest-dev` `emacs` `update-motd` | Docs/tests/editor. `framework/contrib/gtest` is bundled. |

Packages that **do not exist** on Ubuntu 26.04 (don't copy old guides):
`libparmetis-dev`, `libstrumpack-dev`, `libcurl4t64-gnutls-dev`.
`libcurl4-gnutls-dev` is still correct.

---

## 3. The mamba env

Toolchain pins come from `conda/conda_build_config.yaml`: gcc/gxx/gfortran **15**,
mpich **5.0.2**, sysroot **2.17**, python 3.10–3.14, hdf5 1.14.6.

```bash
mamba create -n moose-build -c conda-forge \
  gcc_linux-64=15 gxx_linux-64=15 gfortran_linux-64=15 sysroot_linux-64=2.17 \
  mpich=5.0.2 make cmake m4 patchelf patch diffutils bison flex perl pkg-config \
  python=3.12 git git-lfs rsync texinfo zlib libpng \
  'libfabric<2.5.1'
```

**`libfabric<2.5.1` is mandatory.** See §4.

Sanity-check MPI before burning 15 minutes on a PETSc configure:

```bash
mpicc -show     # -> x86_64-conda-linux-gnu-cc -I$PREFIX/include -L$PREFIX/lib -lmpi
mpicc -o hello hello.c $LDFLAGS && mpiexec -n 2 ./hello
readelf -d ./hello | grep -i rpath   # must show $CONDA_PREFIX/lib
```

Note `mpicc -show` has **no `-Wl,-rpath`**. The rpath comes from conda's
`LDFLAGS`, which is why every configure step below passes `LDFLAGS` explicitly.

---

## 4. TRAP: libfabric >= 2.5.1 vs the 2.17 sysroot

**Symptom** — PETSc configure dies ~14 minutes in, while building OpenBLAS:

```
x86_64-conda-linux-gnu-ld: $PREFIX/lib//libfabric.so.1: undefined reference to `getrandom@GLIBC_2.25'
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:215: ../libopenblasp-r0.3.33.so] Error 1
RuntimeError: Error running make on .../externalpackages/git.openblas
```

**Cause.** conda-forge libfabric 2.5.1+ references `getrandom@GLIBC_2.25`
(upstream `libfabric-feedstock#42` bumped the sysroot), but the MOOSE toolchain
pins `sysroot_linux-64=2.17`. The chain is: OpenBLAS links with `CC=mpicc` →
`-lmpi` → `libmpi.so` needs `libfabric.so.1` → ld resolves libfabric's versioned
symbols against the 2.17 sysroot → `getrandom@GLIBC_2.25` is not there.

**Why a plain MPI smoke test passes but OpenBLAS fails:** conda's `LDFLAGS`
contains `-Wl,--allow-shlib-undefined`, which suppresses exactly this. PETSc
does **not** pass `LDFLAGS` down to the OpenBLAS build.

**This is a known INL issue.** `conda/conda_build_config.yaml`:

```yaml
# libfabric 2.5.1 on linux has an undefined reference to
# getrandom@GLIBC_2.25 during builds due to the 2.25 sysroot
# bump in conda-forge/libfabric-feedstock#42
libfabric:
  - <2.5.1
```

and `conda/{petsc,libmesh,moose,build,template}/meta.yaml` all carry
`- libfabric {{ libfabric }} # [linux]` as a host dep.

**Fix.**
```bash
mamba install -n moose-build -c conda-forge 'libfabric<2.5.1'
readelf -V $CONDA_PREFIX/lib/libfabric.so.1 | grep -c GLIBC_2.25   # must be 0
```
Clean downgrade 2.7.0 → 2.5.0, touches nothing else, mpich 5.0.2 stays.

---

## 5. TRAP: conda exports the *plain* compiler, not the MPI wrapper

**Symptom.**
```
PETSc:  Unable to find mpi in default locations!
libMesh: x86_64-conda-linux-gnu-c++ Compiler Does NOT Support MPI
libMesh: PETSc was not found, but --enable-petsc-required was specified
make:    No targets specified and no makefile found
```

**Cause.** `conda activate` exports `CC=x86_64-conda-linux-gnu-cc`,
`CXX=x86_64-conda-linux-gnu-c++`. Those are the plain wrappers.

**Fix — copy INL's own recipes.** `conda/petsc/build.sh`:

```bash
HDF5_DIR=${PREFIX} configure_petsc \
    AR="${AR:-ar}" CPP="$CPP" RANLIB="$RANLIB" \
    CC="mpicc" CXX="mpicxx" FC="mpifort" \
    CPPFLAGS="$CPPFLAGS" LDFLAGS="$LDFLAGS" \
    --COPTFLAGS="$CFLAGS -O3" --CXXOPTFLAGS="$CXXFLAGS -O3" --FOPTFLAGS="$FFLAGS -O3" \
    --with-clib-autodetect=0 --with-cxxlib-autodetect=0 \
    --with-x=0 --with-ssl=0 \
    --download-openblas-make-options="DYNAMIC_ARCH=1 HOSTCC=$CC" \
    --prefix="$PREFIX"
```

Autoconf **command-line** precious variables beat the environment, so passing
`CC=mpicc` as an argument overrides the exported `CC`.

`conda/libmesh/build.sh`:

```bash
CC=mpicc CXX=mpicxx FC=mpifort F77=mpifort F90=mpifort
--disable-dependency-tracking
# with -DNDEBUG, -O2, -D_FORTIFY_SOURCE=2 STRIPPED out of
# CPPFLAGS / CXXFLAGS / FFLAGS
```

`docker_ci/Dockerfile` additionally does `ENV CC=mpicc CXX=mpicxx` globally.

### The `HOSTCC` subtlety

`HOSTCC=$CC` must expand to the **plain conda compiler**, captured *before* you
override `CC`. INL's comment, verbatim:

> The conda-forge mpich 5.0.2 mpicc no longer adds an rpath to $PREFIX/lib: the
> feedstock builds with `--with-wrapper-dl-type=none` and relied on mpich copying
> its configure LDFLAGS into the wrappers, which mpich 5.0.2 stopped doing. PETSc
> does not pass LDFLAGS to the OpenBLAS build, so getarch built with mpicc cannot
> find libmpi when OpenBLAS runs it. getarch needs no MPI, so build it with the
> plain compiler. This replaces the `--download-openblas-make-options` from
> configure_petsc.sh, so `DYNAMIC_ARCH=1` is repeated here.

So:
```bash
PLAIN_CC="$CC"                 # capture first
export CC=mpicc CXX=mpicxx FC=mpifort
... --download-openblas-make-options="DYNAMIC_ARCH=1 HOSTCC=$PLAIN_CC"
```

### `export -n`

`conda/petsc/build.sh` does:
```bash
export -n AR FC F90 F77 CC CXX CPP RANLIB
export -n CFLAGS CXXFLAGS CPPFLAGS FFLAGS LDFLAGS
```
Keeps the values in the shell (so `"$CXXFLAGS"` still expands into the configure
args) but stops them leaking into PETSc's downloaded sub-builds. Do this in a
subshell so libMesh still sees them.

---

## 6. HDF5: let PETSc download it

`scripts/configure_petsc.sh` probes, in order: `HDF5_DIR`, `HDF5DIR`,
`HDF5_ROOT`, then `/usr/lib/hdf5`, `/usr/local/hdf5`, `/usr/share/hdf5`,
`/usr/local/hdf5/share`, `/opt/hdf5`, `$HOME/.local`. If none yields an
`hdf5.h`, it adds:

```
--download-hdf5=1 --with-hdf5-fortran-bindings=0 --with-zlib
```

The conda recipe sets `HDF5_DIR=${PREFIX}` because INL pins **hdf5 1.14.6** in
the build env. A generic env will have something else entirely. **Do not set
`HDF5_DIR`** — unset all three variables and take the download path. That is the
documented manual-install behaviour.

Worth knowing: PETSc 3.26's own default download is
`hdf5-2.2.0.tar.gz` from the HDFGroup GitHub releases, so the download path
lands you on HDF5 2.x anyway and everything (PETSc, libMesh `--enable-hdf5`,
Exodus) builds fine against it. The 1.14.6 pin in `conda_build_config.yaml` is
about matching conda-forge's package, not about a hard API requirement.

### TRAP: a serial hdf5 in the env shadows PETSc's parallel one

**Symptom.** The whole build succeeds, `ldd` reports no missing libraries, and
then the binary will not even print its version:

```
$ ./modules/combined/combined-opt --version
./modules/combined/combined-opt: symbol lookup error:
  .../petsc/arch-moose/lib/libpetsc.so.3.26: undefined symbol: H5Pset_dxpl_mpio
```

**Cause.** `H5Pset_dxpl_mpio` is HDF5's *parallel* (MPI-IO) dataset-transfer
property. You now have **two** HDF5 libraries of the **same upstream version**
with the **same SONAME** `libhdf5.so.320`:

| | parallel? | `H5Pset_dxpl_mpio` |
|---|---|---|
| `$PETSC_DIR/arch-moose/lib/libhdf5.so.320.2.0` (PETSc's download) | yes | 5 symbols |
| `$CONDA_PREFIX/lib/libhdf5.so.320.2.0` (conda-forge `hdf5`, `nompi_*` build) | **no** | 0 symbols |

conda-forge's plain `hdf5` package is a **serial** build — the parallel one is a
different build string, `mpi_mpich_*`. And in every RPATH that matters
(`libpetsc.so`, `libmesh_opt.so`, `combined-opt`), **`$CONDA_PREFIX/lib` comes
BEFORE `$PETSC_DIR/arch-moose/lib`**:

```
$ readelf -d petsc/arch-moose/lib/libpetsc.so.3.26 | grep -i rpath
 (RPATH)  Library rpath: [$CONDA_PREFIX/lib:$PETSC_DIR/arch-moose/lib:...]
```

So the serial copy satisfies the SONAME first and the parallel symbols are never
there. conda's `LDFLAGS` puts its own `-Wl,-rpath,$CONDA_PREFIX/lib` ahead of
whatever PETSc and libMesh append.

**Fix — no rebuild required.** Swap the env's hdf5 for the parallel build of the
*same version*:

```bash
mamba install -n moose-build -c conda-forge 'hdf5=2.2.0=mpi_mpich_*'
nm -D --defined-only $CONDA_PREFIX/lib/libhdf5.so | grep -c H5Pset_dxpl_mpio   # -> 5
./modules/combined/combined-opt --version                                     # works
```

One package changes, nothing else is touched, same SONAME so every already-linked
binary just starts working. Verified live.

**Or** remove `hdf5` from the build env entirely and let PETSc's download be the
only copy — but then a future libMesh rebuild loses `$CONDA_PREFIX/include/hdf5.h`.
The swap is cleaner.

**Preflight it:**
```bash
[[ -e $CONDA_PREFIX/lib/libhdf5.so ]] && \
  ! nm -D --defined-only $CONDA_PREFIX/lib/libhdf5.so | grep -q H5Pset_dxpl_mpio \
  && echo "SERIAL hdf5 in env -- will shadow PETSc's parallel copy"
```

---

## 7. Submodules — three separate gotchas

```bash
git submodule update --init petsc
git submodule update --init libmesh
( cd libmesh && git submodule sync --recursive && git submodule update --init )
git submodule update --init --recursive framework/contrib/wasp
```

**(a) WASP needs `--recursive`.** WASP's own `.gitmodules` pulls `TriBITS`,
`googletest` and `testframework`. Its top-level `CMakeLists.txt` does
`INCLUDE(.../TriBITS/tribits/TriBITS.cmake)`. Without the nested checkout:

```
CMake Error at CMakeLists.txt:66 (INCLUDE):
  INCLUDE could not find requested file:
    .../wasp/TriBITS/tribits/TriBITS.cmake
CMake Error at CMakeLists.txt:83 (TRIBITS_PROJECT_ENABLE_ALL):
  Unknown CMake command "TRIBITS_PROJECT_ENABLE_ALL".
```

`docker_ci/Dockerfile` does `git submodule update --init --recursive` inside the
wasp clone for this reason.

**(b) Some submodules are `update = none` on purpose.** In MOOSE's
`.gitmodules`: `modules/fluid_properties/contrib/{air,carbon_dioxide,helium,
nitrogen,potassium,saline,sodium}` and
`modules/chemical_reactions/contrib/thermochimica`. `git submodule update --init`
prints `Skipping submodule '<path>'` for these. **That is not an error.** Every
consumer `.mk` guards them:

```make
HELIUM_FP_DIR     ?= ${MOOSE_DIR}/modules/fluid_properties/contrib/helium
HELIUM_FP_CONTENT := $(shell ls $(HELIUM_DIR) 2> /dev/null)
ifneq ($(HELIUM_FP_CONTENT),)
  libmesh_CXXFLAGS += -DHELIUM_FP_ENABLED ...
endif
```

They are optional SBTL table libraries. `HeliumFluidProperties`,
`IdealGasFluidProperties`, `NitrogenFluidProperties` and
`CaloricallyImperfectGas` live in `modules/fluid_properties/src/fluidproperties/`
and are **always built**. To force one anyway:
`git config submodule.<path>.update checkout` then re-run the update.

**(c) Also `update = none` and genuinely optional:** `large_media` (docs images,
big), `framework/contrib/{neml2,conduit,mfem,pytorch}`. Guarded by
`ENABLE_NEML2=true`, `ENABLE_LIBTORCH`, `MFEM_DIR` etc. in
`framework/moose.mk` / `framework/contrib/neml2.mk`. Leave them.

`framework/contrib/hit` is a **regular directory**, not a submodule, and
`moose.mk` `$(error ...)`s if it's empty — so a botched sparse checkout shows up
there.

---

## 8. Build order and the flags that matter

`docker_ci/Dockerfile` order: **PETSc → libMesh → WASP → MOOSE**. Follow it.

### PETSc
`scripts/update_and_rebuild_petsc.sh` forwards `"$@"` to `configure_petsc`,
which already passes:
```
--with-64-bit-indices --with-cxx-dialect=C++17 --with-debugging=no
--with-fortran-bindings=0 --with-mpi=1 --with-openmp=1
--with-shared-libraries=1 --with-sowing=0
--download-{openblas(v0.3.33),hpddm,hypre,metis,mumps,ptscotch,parmetis,
            scalapack,slepc,strumpack,superlu_dist,libceed,umpire}
--download-kokkos=1 --download-kokkos-commit=4.7.04
--download-kokkos-kernels=1 --download-kokkos-kernels-commit=4.7.04
```
`MOOSE_JOBS` becomes `--with-make-np` automatically. Default
`PETSC_ARCH=arch-moose`. Duplicate options: **last one wins**, which is how the
`--download-openblas-make-options` override works.

The Dockerfile also passes `--download-cmake` — that's because Ubuntu 20.04's
system cmake is 3.16, too *old*. A modern env cmake (4.4.4 tested) handles
Kokkos 4.7.04, Umpire, PTScotch and WASP/TriBITS fine. WASP never calls
`cmake_minimum_required` at all, so CMake 4 emits a dev warning and proceeds.

### libMesh
`scripts/update_and_rebuild_libmesh.sh` forwards `"$@"` to `configure_libmesh`,
which passes:
```
--enable-silent-rules --enable-unique-id --disable-warnings
--with-thread-model=openmp --disable-maintainer-mode --enable-hdf5
--enable-petsc-hypre-required --enable-metaphysicl-required
--enable-xdr-required --without-gdb-command --with-methods="$METHODS"
```
- **`METHODS` defaults to `"opt oprof devel dbg"`** — four builds. Export
  `METHODS=opt` or lose 3× the time.
- Leave **`LIBMESH_DIR` unset** → installs in-tree at `libmesh/installed`. The
  script `exit 1`s if you point it inside the conda base.
- `PETSC_DIR`/`PETSC_ARCH`: set them, or the script defaults to
  `$MOOSE_DIR/petsc` + `arch-moose`.
- **No VTK.** `configure_libmesh.sh` has no `--with-vtk-*`; Exodus is what you
  get. libMesh **bundles** `contrib/exodusii` and `contrib/netcdf`, and
  `m4/exodus.m4` defaults `enableexodus=$enablenetcdf`, so **Exodus output works
  out of the box with no SEACAS package.**
- `docker_ci/Dockerfile` sets env `libmesh_CPPFLAGS="-D LIBMESH_HAVE_XDR"`.
  `framework/build.mk` line 48 does `libmesh_CPPFLAGS := $(shell ... --cppflags)`
  — a `:=` assignment **overrides the environment** — so that env var is a no-op
  for the MOOSE build. Nothing in `framework/`, `modules/` or `test/` references
  `LIBMESH_HAVE_XDR`. Skip it.

### WASP
```bash
scripts/update_and_rebuild_wasp.sh --skip-submodule-update
```
Installs to `framework/contrib/wasp/install`, which is exactly
`framework/moose.mk`'s default `WASP_DIR ?= $(MOOSE_DIR)/framework/contrib/wasp/install`.
Uses Ninja if it's on `PATH`, else Make.

### MOOSE
```bash
cd modules/combined && METHOD=opt make -j8
```
There is **no top-level Makefile** — `make` at the repo root gives
`No targets specified and no makefile found`.

`framework/build.mk:43` is `libmesh_CXX ?= $(shell ... libmesh-config --cxx)`.
The `?=` means MOOSE inherits the MPI wrapper from libMesh automatically once
libMesh was configured with `CXX=mpicxx`. **You do not need to export CC/CXX for
the MOOSE step.**

`build.mk` does **not** assign `CXXFLAGS`, so conda's exported `CXXFLAGS`
(`-march=nocona -mtune=haswell -fvisibility-inlines-hidden ... -isystem
$PREFIX/include`) flows into every compile line. That is consistent with how
PETSc and libMesh were built, so leave it.

---

## 9. Job counts — memory, not cores, is the limit

MOOSE translation units under gcc with automatic differentiation peak around
**2 GB each**. The rule of thumb is 1 job per 2–4 GB.

| Stage | Jobs |
|---|---|
| PETSc, libMesh, WASP | 12 (light per TU) |
| MOOSE framework + modules | **8** on a 30 GB box with ~16 GB available |

`-j16` on MOOSE will OOM-kill g++ and you will lose an hour.

---

## 10. The binary is `combined-opt`, not `moose-opt`

`modules/combined/Makefile` sets `APPLICATION_NAME := combined`, so a source
build produces **`modules/combined/combined-opt`**. `moose-opt` is the name
INL's conda `moose` package installs it under. Asserting on `moose-opt` in a
build script will report failure on a build that actually succeeded.

## 11. Verify

```bash
ldd modules/combined/combined-opt | grep 'not found'   # must be empty
./modules/combined/combined-opt --version              # canary for the HDF5 trap
mpiexec -n 2 ./modules/combined/combined-opt \
    -i test/tests/kernels/simple_diffusion/simple_diffusion.i
```

Expected: `Solve Converged!` after 2 nonlinear iterations.

If the binary can't find `libmpi.so.12` at runtime, the rpath didn't propagate;
`export LD_LIBRARY_PATH=$CONDA_PREFIX/lib` is the cheap fix, but check that
`LDFLAGS` (which carries `-Wl,-rpath,$CONDA_PREFIX/lib`) was actually passed to
both configures first.

### Benign noise you will see

```
ModuleNotFoundError: No module named 'yaml'
  File ".../scripts/versioner.py", line 31, in <module>
UnboundLocalError: cannot access local variable 'Versioner' ...
make: [.../framework/moose.mk:552: prebuild] Error 1 (ignored)
```

`moose.mk:552` is `@-python3 scripts/premake.py` — the leading `-` means make is
told to ignore the exit status, and it prints `(ignored)`. `premake.py` only
cross-checks submodule versions. `mamba install pyyaml` (or `uv`-installing the
`python/requirements.txt` layer) silences it. **It does not affect the build.**

Also expect a wall of
`Adding objects from system 'FunctorMaterial' through task 'add_material' is
deprecated` when you run `--dump-search` / `--json`. That's MOOSE deprecating
its own in-tree inputs, not your problem.

---

## 12. Preflight checklist

Run these before starting; each one otherwise costs a 15-minute PETSc configure
to discover.

```bash
# MPI works and gets an rpath
mpicc -show && mpiexec -n 2 ./hello

# libfabric will not break the OpenBLAS link
readelf -V $CONDA_PREFIX/lib/libfabric.so.1 | grep -c GLIBC_2.25   # -> 0

# XDR headers for libMesh
test -f /usr/include/tirpc/rpc/xdr.h

# WASP's TriBITS is actually checked out
test -f framework/contrib/wasp/TriBITS/tribits/TriBITS.cmake

# libMesh's nested submodules are populated
( cd libmesh && git submodule status --recursive | grep -c '^-' )   # -> 0

# env hdf5 is the PARALLEL build, else it shadows PETSc's (see section 6)
nm -D --defined-only $CONDA_PREFIX/lib/libhdf5.so | grep -c H5Pset_dxpl_mpio  # -> 5, or no libhdf5

# No stray HDF5 that configure_petsc.sh would latch onto
for p in /usr/lib/hdf5 /usr/local/hdf5 /usr/share/hdf5 /opt/hdf5 $HOME/.local; do
  find $p -name hdf5.h -print -quit 2>/dev/null; done               # -> empty
env | grep -i hdf5                                                  # -> empty
```
