# openmupro Dependency Audit

Last updated: 2026-05-24

This audit records the post-migration dependency state after removing `openmupro` from the active build graph. It does not claim that every solver is fully modernized; it identifies what has been migrated, what is clean, and what remains deferred.

## Audit Scope

- Active source/config paths: repository root, `library/`, `license/`, `docs/`, `.github/`, `.vscode/`, `scripts/`, `examples/`, and app submodule working trees where readable.
- Excluded raw/history paths: `inbox/`, `reference/`, `not_used/`, `library/out/`, `license/out/`, and `.git/`.
- Desktop code is explicitly out of scope and was not migrated.

## Evidence Commands

The following checks were used as the active-state baseline:

```bash
rg --hidden -n "find_package\\s*\\(\\s*openmupro|openmupro_DIR|mupro::openmupro|openmupro" \
  --glob '!library/out/**' --glob '!license/out/**' --glob '!reference/**' \
  --glob '!not_used/**' --glob '!inbox/**' --glob '!TASK.md' --glob '!.git/**' .

git submodule status --recursive
```

Result:

- No active `openmupro` references were found by the search command.
- `.gitmodules` no longer contains an `openmupro` submodule.
- Current submodules are app modules only: `apps/muEffProp`, `apps/muFerro`, `apps/muMagn`, and `apps/muPREDICT`.

## CMake Dependency State

| ID | Previous concern | Current state |
| --- | --- | --- |
| DEP-AUD-001 | `find_package(openmupro)` | No active usage found. |
| DEP-AUD-002 | `openmupro_DIR` | No active usage found outside historical notes. |
| DEP-AUD-003 | `mupro::openmupro` link dependency | No active usage found. |
| DEP-AUD-004 | `openmupro` submodule | Removed from `.gitmodules` and repository index. |
| DEP-AUD-005 | App developer-mode references | Cleaned locally in `apps/muFerro` and `apps/muPREDICT`; final app-side treatment is deferred to app refactors. |

The active `library/CMakeLists.txt` now owns the runtime stack directly:

- Always adds `L0_Base`, `L0_Log`, `L0_FFT`, `L1_PostProcess`, `L1_Transform`, `L1_Utilities`, `L1_IO`, `L1_StructureGenerator`, `L1_MaterialGenerator`, and `L1_Film`.
- Adds solver layers only when `MUPRO_BUILD_SOLVERS=ON`.
- Links `mupro::math_backend`, `mupro::license`, MPI, and local library sources instead of an external `openmupro` package.

## Migrated Module Map

| Former package area | Current SDK location | Public modules | Notes |
| --- | --- | --- | --- |
| `openmupro/library/L0_Base` | `library/L0_Base` | `mod_mupro_base`, `mod_lib_base` | Size, precision, MPI, TOML, expression parser, constants. |
| `openmupro/library/L0_Log` | `library/L0_Log` | `mod_mupro_log`, `mod_lib_log` | Message and formatted print helpers. |
| `openmupro/library/L0_FFT` | `library/L0_FFT` | `mod_mupro_fft`, `mod_lib_fft` | FFT context and MPI FFT wrappers; backend selected by CMake. |
| `openmupro/library/L1_IO` | `library/L1_IO` | `mod_mupro_io`, `mod_lib_io` | Free-format, JSON, serial/MPI I/O, VTK, time-dependent parsing. |
| `openmupro/library/L1_Transform` | `library/L1_Transform` | `mod_mupro_transform`, `mod_lib_transform` | Rotation, symmetry, tensor transform utilities. |
| `openmupro/library/L1_Utilities` | `library/L1_Utilities` | `mod_mupro_utilities`, `mod_lib_utilities` | Allocation, conversion, tensor/data/FDM helpers, error handling. |
| Additional common modules | `library/L1_PostProcess` | `mod_mupro_post_process`, `mod_lib_post_process` | Domain processing and BMP visualization. |
| Additional common modules | `library/L1_StructureGenerator` | `mod_mupro_structure`, `mod_lib_structure` | Structure/slab generation helpers. |
| Additional common modules | `library/L1_MaterialGenerator` | `mod_mupro_material`, `mod_lib_material` | Material and tensor generation helpers. |
| Additional common modules | `library/L1_Film` | `mod_mupro_film`, `mod_lib_film` | Film geometry/helpers used by higher-level solvers. |
| `openmupro/examples/demo1` | `examples/demo1` | Downstream `find_package(mupro)` example | Kept and migrated into the SDK examples tree. |
| `openmupro/desktop` | Not migrated | N/A | Deferred by decision; future desktop work belongs to separate software. |

## Current Public Wrapper Definitions

The active SDK defines these migrated L0/L1 wrapper modules:

| Module | Source |
| --- | --- |
| `mod_mupro_base`, `mod_lib_base` | `library/L0_Base/interface.f90` |
| `mod_mupro_log`, `mod_lib_log` | `library/L0_Log/interface.f90` |
| `mod_mupro_fft`, `mod_lib_fft` | `library/L0_FFT/interface.f90` |
| `mod_mupro_io`, `mod_lib_io` | `library/L1_IO/interface.f90` |
| `mod_mupro_transform`, `mod_lib_transform` | `library/L1_Transform/interface.f90` |
| `mod_mupro_utilities`, `mod_lib_utilities` | `library/L1_Utilities/interface.f90` |
| `mod_mupro_structure`, `mod_lib_structure` | `library/L1_StructureGenerator/interface.f90` |
| `mod_mupro_material`, `mod_lib_material` | `library/L1_MaterialGenerator/interface.f90` |
| `mod_mupro_post_process`, `mod_lib_post_process` | `library/L1_PostProcess/interface.f90` |
| `mod_mupro_film`, `mod_lib_film` | `library/L1_Film/interface.f90` |

## Consumer Summary

The main consumer pattern is now local to `library/`:

| Consumer group | Modules used | Notes |
| --- | --- | --- |
| L0/L1 internals | `mod_lib_base`, `mod_lib_log`, `mod_lib_fft`, `mod_lib_utilities` | Local implementation modules depend on each other directly inside `library/`. |
| L2/L3 solvers | `mod_lib_base`, `mod_lib_fft`, `mod_lib_log`, `mod_lib_transform`, `mod_lib_utilities`, `mod_lib_license` | Solver logic still uses internal `mod_lib_*` modules. Algorithm refactors are deferred. |
| SDK examples | `mod_mupro_base`, `mod_mupro_fft`, `mod_mupro_log`, `mod_mupro_io`, `mod_lib_fft` | `examples/demo1` builds as a downstream project. Its direct `mod_lib_fft` usage should be wrapped later if the public/private boundary is tightened. |
| App submodules | `mod_mupro_*` wrappers | `apps/muFerro` and `apps/muPREDICT` consume SDK wrappers but final app repository strategy is deferred. |

Observed usage counts from active source scan:

| Module family | Count |
| --- | ---: |
| `mod_lib_base` | 47 |
| `mod_lib_fft` | 21 |
| `mod_lib_log` | 13 |
| `mod_mupro_base` | 42 |
| `mod_mupro_fft` | 18 |
| Other `mod_lib_*` and `mod_mupro_*` modules | 1-9 each |

## Deferred Issues

| ID | Issue | Location | Disposition |
| --- | --- | --- | --- |
| DEP-AUD-RISK-001 | Legacy names such as `mod_mupro_double_precision`, `mod_mupro_sim_size`, `mod_mupro_sim_size_internal`, `mod_mupro_fft_internal`, and `mod_mupro_rotation` are referenced but not defined as current wrapper modules. | `library/L2_Defect`, `library/L2_Magnetic/tests`, comments in `library/L1_IO/json` | Defer to solver/test modernization; do not patch scientific code in this audit. |
| DEP-AUD-RISK-002 | App submodule cleanup is local and not committed in the app repositories. | `apps/muFerro`, `apps/muPREDICT` | Defer to app refactor and future repository consolidation decision. |
| DEP-AUD-RISK-003 | L2/L3 test CMake files still contain some ad hoc external link assumptions such as direct `fftw3` or `stdc++` in tests. | Solver test directories | Address in solver-focused build/test cleanup. |

## Audit Conclusion

The active SDK build graph no longer depends on a prebuilt `openmupro` package or submodule. The migrated L0/L1 runtime code is now owned by `library/`, and `examples/demo1` is owned by `examples/`. Remaining work belongs to later solver/app modernization and benchmark setup, not to the `openmupro` package removal itself.
