Skip to content

Epic: native Fortran run engine + cross-platform binary distribution #165

Closed
4 of 4 issues completed
Closed

Description

@neuromechanist

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

  1. 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.
  2. Cross-platform release CI: GitHub Actions matrix building the five targets and attaching them as release assets (checksummed).
  3. Native run engine + binary resolver/installer: a Python AMICANative backend that resolves the host binary (bundled or downloaded from the release), runs it, and parses output via loadmodout.
  4. Package rename to pAMICA/pamica (PyPI pyamica is 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.

Sub-issues

Sub-issues

4 of 4 Issues completed
Loading 4 sub-issues

Activity

  1. added
    feature
    on Jul 17, 2026
  2. added a commit that references this issue on Jul 17, 2026
  3. neuromechanist commented on Jul 18, 2026

    @neuromechanist
    MemberAuthor

    All 4 phases complete and merged to main: dependency-free build (#166), release matrix (#167), AMICANative engine (#168), rename to pamica (#169).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions