cmake: Only add -DACCELERATE_NEW_LAPACK definition if linking the macOS Accelerate Framework #8626
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.
Description of proposed changes
In PRs conda-forge/gmt-feedstock#302 and conda-forge/gmt-feedstock#303, conda-forge is trying to rebuild GMT 6.5.0 and the master branch.
The builds fail on macOS, with errors like (see https://dev.azure.com/conda-forge/feedstock-builds/_build/results?buildId=1084283&view=logs&jobId=e0208569-136d-54da-4ec5-14d0e8771cbc&j=e0208569-136d-54da-4ec5-14d0e8771cbc&t=25992e30-3e2a-5788-2b3e-e373b0534bf7 for the detailed report):
The failures are because:
ACCELERATE_NEW_LAPACK
definition when linking the macOS Accelerate Framework.ACCELERATE_NEW_LAPACK
is defined, then thedgemm_
function is not defined.gmt/src/gmt_vector.c
Lines 1333 to 1339 in fa3eda0
However, the conda-forge builds are linking GMT to the lapack library from conda-forge, not the one from macOS Accelerate Framework. In this case, we should not add
ACCELERATE_NEW_LAPACK
. This PR fixes the issue by checking if theLAPACK_LIBRARIES
matches".*Accelerate.*"
FYI, I've applied the same patch on the conda-forge recipe and the macOS builds now pass.