SciPy's Fortran Footprint: `linalg`'s Legacy & Modernization Efforts

SciPy modules like `scipy.linalg` directly wrap Fortran LAPACK routines, making a Fortran compiler a build dependency. While old Fortran 77 code still constitutes about 10% of SciPy's codebase, maintainers are actively working to slowly remove or modernize these dependencies to mitigate build issues and improve long-term maintainability.

The top 3

  1. SciPy's `linalg` Core: Fortran's BLAS & LAPACK Legacy: SciPy's `linalg` module heavily relies on decades-old, highly optimized Fortran libraries like BLAS (Basic Linear Algebra Subprograms) for fundamental vector/matrix operations and LAPACK (Linear Algebra PACKage) for higher-level linear algebra routines.
  2. Fortran's Enduring Performance Edge in Numerical Computing: Fortran remains crucial due to its highly optimized compilers for array-based numerical computations, delivering performance that often surpasses C/C++ and is hundreds of times faster than pure Python for intensive tasks, making it a cornerstone for high-performance scientific applications.
  3. SciPy's Modernization Drive: Phasing Out Legacy Fortran: SciPy is actively working to replace its older Fortran 77 code, citing challenges like difficult maintenance, compiler compatibility issues on Windows and macOS Aarch64, and a scarcity of Fortran-proficient maintainers, with C++ and Cython being preferred languages for new development.

Sources

Open the full topic