-
Notifications
You must be signed in to change notification settings - Fork 216
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Description
Problem Statement
When building the Fortran Standard Library with external BLAS/LAPACK libraries, the generated fortran_stdlib.pc file includes absolute paths to the BLAS/LAPACK libraries. This is problematic for system packaging (e.g., MSYS2) where the library should reference system-wide installed libraries using standard pkg-config syntax.
Current Behavior
- Absolute paths in pkg-config: The generated
fortran_stdlib.pcfile includes absolute paths to BLAS/LAPACK libraries, e.g.,/path/to/libopenblas.dllor/path/to/mkl_core.dll - No pkg-config integration: The build system does not leverage existing pkg-config files for BLAS/LAPACK libraries
- Packaging complexity: System packagers need to patch the generated pkg-config file
Root Cause
The current build system directly uses the absolute paths found by find_package(BLAS) and find_package(LAPACK) without considering if the BLAS/LAPACK vendor provides a pkg-config file.
(I know little about MKL and am not sure if it provides .pc files, while openblas has one.)
Proposed Solution
- Detect pkg-config files: Check if common BLAS/LAPACK vendors (e.g., OpenBLAS, Intel MKL) provide pkg-config files
- Use standard syntax: When a pkg-config file exists, use the
Requiresfield instead of absolute paths - Maintain compatibility: Fall back to absolute paths when no pkg-config file is available
Expected Behaviour
Current problematic output:
Libs: -L${libdir} -lfortran_stdlib /path/to/libopenblas.dll ...
Desired output:
Requires: openblas
Libs: -L${libdir} -lfortran_stdlib ...
or just
Libs: -L${libdir} -lfortran_stdlib -lopenblas ...
Cflags: -I${includedir} -I${moduledir} -I/folder/to/libopenblas.dll
Version of stdlib
Platform and Architecture
Windows OS
Additional Information
No response
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working