From e213fb4585092a06b1b3b33f98d28e2006578cc9 Mon Sep 17 00:00:00 2001 From: Ralf Gommers Date: Mon, 17 Oct 2022 00:41:19 +0200 Subject: [PATCH] Update docs on OpenBLAS dependency API [ci skip] --- docs/markdown/Dependencies.md | 15 ++++++++++++++- mesonbuild/dependencies/blas_lapack.py | 4 ++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/docs/markdown/Dependencies.md b/docs/markdown/Dependencies.md index b505943c2138..8943d17669b7 100644 --- a/docs/markdown/Dependencies.md +++ b/docs/markdown/Dependencies.md @@ -367,7 +367,20 @@ The `version` and `interface` keywords may be passed to request the use of a specific version and interface, correspondingly: ```meson -openblas_dep = dependency('openblas', version : '>=0.3.21', interface : 'ilp64') +openblas_dep = dependency('openblas', + version : '>=0.3.21', + language: 'c', # can be c/cpp/fortran + modules: [ + 'interface: ilp64', # can be lp64 or ilp64 (or auto?) + 'symbol-suffix: 64_', # check/auto-detect? default to 64_ or no suffix? + 'cblas', + ] +) + +# Query properties as needed: +has_cblas = openblas.get_variable('cblas') +is_ilp64 = openblas_dep.get_variable('interface') == 'ilp64' +blas_symbol_suffix = openblas_dep.get_variable('symbol-suffix') ``` If OpenBLAS is installed in a nonstandard location *with* pkg-config files, diff --git a/mesonbuild/dependencies/blas_lapack.py b/mesonbuild/dependencies/blas_lapack.py index 4a0b8b533f5e..b3b935639513 100644 --- a/mesonbuild/dependencies/blas_lapack.py +++ b/mesonbuild/dependencies/blas_lapack.py @@ -286,6 +286,10 @@ def detect(self, lib_dirs: T.Optional[T.List[str]] = None, inc_dirs: T.Optional[ if inc_dirs is None: inc_dirs = [] + # TODO: add the default symbol suffix for ilp64 ("64_"), check that + # symbols are present in the library, and then store a validated symbol + # suffix. Also check for availability of CBLAS interface (`dgemm_` -> `cblas_dgemm`) + # See `self.run_check` below. if self.interface == 'lp64': libnames = ['openblas'] elif self.interface == 'ilp64':