Skip to content

Commit

Permalink
lib/gmath: use C interface to BLAS and LAPACK libraries (#4247)
Browse files Browse the repository at this point in the history
Replace outdated direct use of Fortran libraries via g2c.h,  f2c.h
or private prototypes, with the C interface API and libraries
CBLAS and LAPACKE. This simplifies our own code and makes
it easier to maintain and expand.

Configure is simplified to use pkg-config to retrieve INC and
LIB info. `--with-blas` defaults to `--with-blas=cblas` where "cblas"
is the pkg-config package name; `---with-lapack` defaults to
`--with-lapack=lapacke`.

If the default fails the test a list of package names are tested:
- BLAS package names tested: cblas blas-netlib openblas blas-atlas
- LAPACKE package name tested: lapacke openblas

- CI(Linux): replace libopenblas-dev with liblapacke-dev dependency
- CI(macOS): replace blas and lapack with openblas dependency
- CI(Windows): replace lapack with openblas dependency
  • Loading branch information
nilason authored Sep 19, 2024
1 parent a536bd4 commit d5bb442
Show file tree
Hide file tree
Showing 14 changed files with 416 additions and 6,361 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/apt.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ libfftw3-dev
libgdal-dev
libgl1-mesa-dev
libglu1-mesa-dev
liblapacke-dev
libnetcdf-dev
libopenblas-dev
libpdal-dev
libpng-dev
libproj-dev
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/macos_dependencies.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
blas
cairo
clangxx_osx-arm64
clang_osx-arm64
Expand All @@ -13,7 +12,6 @@ giflib
git
ipython
krb5
lapack
lastools
libgdal-arrow-parquet
libgdal-core
Expand All @@ -32,6 +30,7 @@ libtiff
llvm-openmp
matplotlib
numpy<2
openblas
pandoc
pdal
pillow
Expand Down
8 changes: 2 additions & 6 deletions .github/workflows/macos_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,8 @@ CONFIGURE_FLAGS="\
--with-bzlib-libs=${CONDA_PREFIX}/lib \
--with-bzlib-includes=${CONDA_PREFIX}/include \
--with-netcdf=${CONDA_PREFIX}/bin/nc-config \
--with-blas \
--with-blas-libs=${CONDA_PREFIX}/lib \
--with-blas-includes=${CONDA_PREFIX}/include \
--with-lapack
--with-lapack-includes=${CONDA_PREFIX}/include \
--with-lapack-libs=${CONDA_PREFIX}/lib \
--with-blas=openblas \
--with-lapack=openblas \
--with-netcdf=${CONDA_PREFIX}/bin/nc-config \
--with-nls \
--with-libs=${CONDA_PREFIX}/lib \
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/osgeo4w.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
update: true
msystem: MINGW64
install: tar libintl make bison flex diffutils git dos2unix zip mingw-w64-x86_64-toolchain
mingw-w64-x86_64-fftw mingw-w64-x86_64-lapack mingw-w64-x86_64-pkgconf
mingw-w64-x86_64-fftw mingw-w64-x86_64-openblas mingw-w64-x86_64-pkgconf
mingw-w64-x86_64-gcc mingw-w64-x86_64-ccache mingw-w64-x86_64-zlib mingw-w64-x86_64-libiconv
mingw-w64-x86_64-bzip2 mingw-w64-x86_64-gettext mingw-w64-x86_64-libsystre
mingw-w64-x86_64-libtre-git mingw-w64-x86_64-libwinpthread-git mingw-w64-x86_64-libpng
Expand Down
Loading

0 comments on commit d5bb442

Please sign in to comment.