Repository navigation
Description
Ship the native AMICA Fortran reference as a first-class run engine (the 4th, alongside NumPy, PyTorch and MLX), with prebuilt binaries for macOS, Linux x64, Linux ARM64, Windows x64 and Windows ARM64 attached to each GitHub release, and a package installer that resolves and copies the right binary for the host system.
Context
The AMICA Fortran reference (amica15.f90 + funmod2.f90) is currently only used in validate_implementations.py and bundled as a single x86 macOS binary (sample_data/amica15mac), which is not shipped in the wheel. sccn/amica PR #53 established the vendor-neutral build recipe we abide by: gfortran + Open MPI + LAPACK, no MKL, with a portable random_seed patch and vmath_shim.c (vrda_exp/vrda_log as libm loops). That recipe still dynamically links Open MPI + LAPACK at runtime and does not cover Windows.
Key technical decision: single-rank MPI shim
amica15.f90 uses ~15 MPI calls (BCAST, REDUCE, ALLREDUCE, BARRIER, COMM_SIZE/RANK, GATHER, COMM_SPLIT, INIT/FINALIZE), all trivial for a single rank (pyAMICA runs it as one process). Providing a tiny single-rank MPI shim (the same philosophy as vmath_shim.c, extended from no-MKL/no-AMD-LibM to no-MPI-runtime), plus static LAPACK/BLAS, yields dependency-free static binaries that run with no brew/apt install, on every target including Windows.
Phases
- Dependency-free single-rank build: MPI shim + static LAPACK; a portable build script producing a binary that runs with zero runtime deps, validated against the Fortran reference LL on real sample EEG.
- Cross-platform release CI: GitHub Actions matrix building the five targets and attaching them as release assets (checksummed).
- Native run engine + binary resolver/installer: a Python
AMICANativebackend that resolves the host binary (bundled or downloaded from the release), runs it, and parses output vialoadmodout. - Package rename to
pAMICA/pamica(PyPIpyamicais taken); consistent distribution + import naming.
Acceptance
pip install-ing the package on each of the five platforms yields a working native engine with no manual toolchain setup.- The native engine reproduces the Fortran reference decomposition (parity via
loadmodout+ LL). - Binaries are attached to the release, checksummed, and resolved automatically per host.
Activity
Merge pull request #172 from sccn/feature/issue-165-epic-native-binaries
neuromechanist commentedon Jul 18, 2026
All 4 phases complete and merged to main: dependency-free build (#166), release matrix (#167), AMICANative engine (#168), rename to pamica (#169).