lapack
lapack copied to clipboard
CMake build: Add -DLAPACK option, un-break CBLAS+BLAS build, do not require C++ if unnecessary
This fixes some build issues I face when packaging for pkgsrc using the CMake build.
- Adds option to build without LAPACK, so that any of BLAS, LAPACK, CBLAS, LAPACKE can be built as individual library from source.
- Fixes CBLAS build missing blas-targets for CMake by adding that. Note that I do not use those cmake files and scrub them from the install. Would like an option to avoid that machinery, as we use pkg-config also for CMake to locate BLAS deps (BLA_PREFER_PKGCONFIG in FindBLAS).
- Avoids requiring a C++ compiler when not needed.
- Also fixes macro usage for BLAS++ / LAPACK++.
I hope that can be merged in one go. Though, I have to admit that I am no CMake expert and someone might find further errors. But this works for me at least.
Does https://github.com/Reference-LAPACK/lapack/pull/834 mean that LAPACKE may be built without Fortran … but only LAPACKE? This PR might need some adaptation to only enable Fortran for BLAS, LAPACK … and CBLAS?