Skip to content

Migrate build system away from distutils (deprecated in NumPy) #114

@mesonepigreco

Description

@mesonepigreco

Migrate build system away from distutils (deprecated in NumPy)

NumPy has deprecated distutils, which our project currently relies on to compile a significant amount of Fortran code. This code links against LAPACK/BLAS libraries, but in some environments we also need to compile against Intel MKL instead.

To ensure long-term compatibility, automated builds, and portability, the build system should be migrated to a modern alternative such as CMake or Meson.

This task is self-contained: it does not require any knowledge of the scientific functionality, algorithms, or physics implemented in the code. The scope is strictly the build infrastructure.


✅ Requirements

  • Replace the current distutils-based build system with CMake or Meson.
  • Ensure compilation works with:
    • LAPACK/BLAS backends (Linux, standard HPC clusters).
    • Intel MKL (Intel compilers).
    • Apple ARM (M1/M2) architecture (linking against Accelerate framework or equivalent BLAS/LAPACK libraries).
  • Preserve automatic detection of available math libraries where possible.
  • Update documentation with build instructions for the supported platforms.

🚀 Getting Started Checklist

  1. Set up the environment

    • Clone the repository and check out the build system files (setup.py, distutils configs, etc.).
    • Install dependencies (Fortran compiler, BLAS/LAPACK, MKL if available).
  2. Choose a build system

    • Decide whether to use CMake or Meson (both are acceptable).
    • Initialize the new build system files (e.g. CMakeLists.txt or meson.build).
  3. Add Fortran sources

    • Configure the build system to compile all existing Fortran files.
    • Ensure that object files are correctly linked into the Python extension module(s).
  4. Handle linear algebra libraries

    • Add detection logic for:
      • OpenBLAS/LAPACK (default).
      • Intel MKL (on Intel compilers).
      • Accelerate framework (macOS ARM).
  5. Test the build

    • Compile and install locally using the new build system.
    • Run the test suite to confirm functionality is unchanged.
  6. Update CI

    • Modify the continuous integration workflow to use the new build system.
    • Ensure CI covers Linux, Intel with MKL, and macOS ARM.
  7. Documentation

    • Update the README / installation guide with new build instructions.

💡 Why this is a good first issue

  • No deep dive into algorithms or physics is needed — the challenge is purely build infrastructure.
  • It improves portability and maintainability.
  • It’s a great way to contribute without spending too much time learning the internals of the code.

Metadata

Metadata

Labels

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions