Modern Fortran 90 modules and wrappers for BLAS and LAPACK routines.
The goal is to expose all BLAS/LAPACK interfaces through type-safe Fortran modules, enabling:
- Safer usage of BLAS/LAPACK.
- Optional masking or renaming of BLAS/LAPACK symbols.
Available modules:
blas77lapack77: combined BLAS and LAPACK interfaces.blas77: BLAS-only interfaces.lapack77: LAPACK-only interfaces.
The library currently supports building via the CMake build system or by manual integration.
Fetching the library with CMake:
include(FetchContent)
FetchContent_Declare(BLAS77Interface
GIT_REPOSITORY https://github.com/foxtran/BLAS77Interface.git
)
FetchContent_MakeAvailable(BLAS77Interface)Then link it to your Fortran target:
target_link_libraries(<TARGET> PUBLIC BLAS77Interface)Configuration options (should be set before calling FetchContent_MakeAvailable()):
BLAS77Interface_ENABLE_LAPACK— enable LAPACK interfaces (default:ON).BLAS77Interface_BLA_SIZEOF_INTEGER— BLAS integer size in bytes (4or8, default:4).BLAS77Interface_LINKER_TEST— force a link-time error if BLAS/LAPACK symbols are used without the modules (default:OFF).
BLAS77Interface links against chosen BLAS and, when enabled, LAPACK. Examples are available under example/.
The BLAS77Interface generator uses the latest commit of Reference LAPACK to extract routine signatures and generate Fortran modules.
Generation steps:
- Extract APIs for non-auxiliary BLAS and LAPACK routines.
- Generate
blas77andlapack77modules from the APIs. - Generate dummy BLAS/LAPACK routines (
BLAS77_blas.F90,BLAS77_lapack.F90) used whenBLAS77Interface_LINKER_TESTis enabled. - Apply patches for special cases.
- LAPACK routines with
EXTERNALprocedures are omitted. - Only the CMake build is provided.
- Only a limited set of Fortran compilers is supported.