Skip to content

cmake: fix FindLAPACKE picking openblas.pc over lapacke.pc#7421

Open
petrasovaa wants to merge 1 commit into
OSGeo:mainfrom
petrasovaa:cmake-lapack
Open

cmake: fix FindLAPACKE picking openblas.pc over lapacke.pc#7421
petrasovaa wants to merge 1 commit into
OSGeo:mainfrom
petrasovaa:cmake-lapack

Conversation

@petrasovaa
Copy link
Copy Markdown
Contributor

I had trouble configuring GRASS with cmake and this PR is what my AI suggested. It solved the problem for me.

AI summary

When both lapacke.pc and openblas.pc are present, _search_lapacke_pkgs overwrites LAPACKE_PKGCONFIG on every iteration, so openblas (last in the list) always wins. On Debian/Ubuntu the openblas-pthread variant doesn't ship LAPACKE symbols, so the LAPACKE_dgesv check links only libopenblas.so and fails:

Could NOT find LAPACKE (missing: HAVE_LAPACKE_DGESV) (found version "0.3.26")

Add break() so the first match wins, matching the documented "lapacke and openblas... in that order" priority.

@petrasovaa petrasovaa requested a review from nilason May 20, 2026 19:27
@github-actions github-actions Bot added the CMake label May 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant