question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Improve BLAS/LAPACK support: dependency detection, UX, and ILP64

See original GitHub issue

This is an issue to keep track of and break down and plan the work for making the BLAS and LAPACK dependency detection as robust and easy to use as possible.

The related items in gh-16293 are:

  • Improved BLAS/LAPACK detection/support (it works now, but only using pkg-config): https://github.com/mesonbuild/meson/issues/2835
  • ILP64 support. This is now still tested in one numpy.distutils based CI job, and not supported yet in the Meson-based build.

Let’s break this down more. Here is what I think we need:

  • detection of any supported BLAS/LAPACK library via pkg-config
  • detection of any supported BLAS/LAPACK library installed in standard paths (for native, i.e. now cross-compilation, builds) automatically via Meson
  • detection of any supported BLAS/LAPACK library via CMake as a fallback, if that is installed, with the same name as for pkg-config
  • ability to specify which BLAS/LAPACK library to use plus the directory in which it is installed in a native-file.ini or cross-file.ini.
  • Work around potential issue with OpenBLAS not including LAPACK symbols: gh-17465
  • gh-17362
  • passing through selections via pip/build instead of having to invoke meson setup separately: https://github.com/mesonbuild/meson-python/issues/54
  • ability to specify a preferred order (ala NPY_LAPACK_ORDER) in an ini file
  • comprehensive documentation on all of these methods
  • ILP64 support in the Meson build
    • implement support in Meson
    • move SciPy’s CI job to Meson
    • user interface support so we can select ILP64 via pip/build/ini-file
  • (and to enable work on this) an easy way of testing all this, locally and in CI (perhaps in conda-forge, ala https://github.com/conda-forge/scipy-feedstock/pull/199 - but first need the ability to just run the configure stages, rather than a heavy build for a large test matrix)). Tests should be able to select one or all of:
    • library: OpenBLAS, MKL, Netlib
    • interface: LP64 and ILP64 flavors
    • detection method: pkg-config, CMake, Meson system, ini file
  • add a CI job using MSVC + Intel Fortran + MKL: gh-16957

A bunch of these things are in progress already at https://github.com/mesonbuild/meson/pull/10921.

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
rgommerscommented, Nov 7, 2022

Then this is just a lack of support in Meson, because FindBLAS does return all the information about the library found, so it should be straightforward to expose it.

I suspect it may be by design that the name is the one you asked for. Not many dependencies work like BLAS, which is kind of a virtual dependency which can have multiple implementations. I think it’ll require a BLASCMakeDependency, similar to the OpenBLASCMakeDependency I’m adding in https://github.com/mesonbuild/meson/pull/10921. I’ll try to make this work.

0reactions
eli-schwartzcommented, Nov 8, 2022

So what do you do with that information? Hand-rolled regex matches against linker flags inside CMakeLists.txt?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Tracking issue for further build system improvements #16293
See Improve BLAS/LAPACK support: dependency detection, UX, and ILP64 #17244; Passing through SciPy-specific build options when using pip ...
Read more >
Intel® oneAPI Base Toolkit Release Notes
Intel® oneAPI Base Toolkit supports direct programming and API programming, it delivers a unified language and libraries with full native code support.
Read more >
News | HLIBpro
Added support for ILP64 BLAS/LAPACK implementations (64bit integers). Added support for AMD-LibM (integrated in binary Linux distributions).
Read more >
Building from source — NumPy v1.25.dev0 Manual
The detection of LAPACK libraries may be bypassed by defining the environment variable NPY_LAPACK_LIBS , which should contain the exact linker flags you...
Read more >
What is the easiest way to install BLAS and LAPACK for scipy?
For Debian Jessie and Stretch installing the following packages resolves the issue: sudo apt install libblas3 liblapack3 liblapack-dev libblas-dev ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found