CMake build: Add -DLAPACK option, un-break CBLAS+BLAS build, do not require C++ if unnecessary#972
Open
drhpc wants to merge 3 commits intoReference-LAPACK:masterfrom
Open
CMake build: Add -DLAPACK option, un-break CBLAS+BLAS build, do not require C++ if unnecessary#972drhpc wants to merge 3 commits intoReference-LAPACK:masterfrom
drhpc wants to merge 3 commits intoReference-LAPACK:masterfrom
Conversation
All components are optional now, so that only BLAS can be built.
This enables cmake -DLAPACK=off -DLAPACKE=off -DCBLAS=ON -DUSE_OPTIMIZED_BLAS=OFF .. to finish without complaining about cblas missing blas-targets. This installs additional cmake machinery for libblas, which seems to be fair, like the other libs.
The current setup requires a C++ compiler when none is needed, tripping up some build frameworks that are picky about that. And … there are situations where you have a C compiler and no C++.
Author
|
Does #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? |
quant
reviewed
Jan 29, 2024
| cmake_minimum_required(VERSION 3.6) | ||
|
|
||
| project(LAPACK) | ||
| project(LAPACK Fortran C) |
There was a problem hiding this comment.
With the project language specified here, statements enable_language(Fortran) at lines 226 and 301 are not needed anymore.
quant
reviewed
Jan 29, 2024
|
|
||
| option(USE_OPTIMIZED_LAPACK "Whether or not to use an optimized LAPACK library instead of included netlib LAPACK" OFF) | ||
|
|
||
| option(LAPACK "Whether to build or use LAPACK (to enable a BLAS-only build)") |
There was a problem hiding this comment.
Please be explicit, do not omit OFF, even though it is the default.
And consider building LAPACK enabled by default, in the project named LAPACK.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fixes some build issues I face when packaging for pkgsrc using the CMake build.
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.