Repository navigation
CMake: restore PLAT so EXAMPLE/ and TESTING/ link the built library - #35
Merged
Merged
Conversation
Commit b121cf0 replaced the PLAT cache variable with THREAD_API, but EXAMPLE/CMakeLists.txt and TESTING/MATGEN/CMakeLists.txt still link against superlu_mt${PLAT}. With PLAT unset this became "superlu_mt", which is not a target, so CMake passed a raw -lsuperlu_mt to the linker and added no build dependency on the library, breaking the default build: /usr/bin/ld: cannot find -lsuperlu_mt: No such file or directory Derive PLAT from THREAD_API (_OPENMP for OPENMP, otherwise _PTHREAD) so examples and tests link the actual superlu_mt_PTHREAD/_OPENMP target. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017GsYX7J15S6uvtUoRMWYwi
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.
Problem
The default CMake build fails (e.g. this CI run):
Commit b121cf0 ("Add option THREAD_API …") replaced the
PLATcache variable withTHREAD_API, andSRC/now buildssuperlu_mt_PTHREADand/orsuperlu_mt_OPENMP. ButEXAMPLE/CMakeLists.txtandTESTING/MATGEN/CMakeLists.txtstill dotarget_link_libraries(... superlu_mt${PLAT}). WithPLATunset this resolves tosuperlu_mt, which is not a target. CMake therefore passes a raw-lsuperlu_mtto the linker and adds no build dependency on the library, so linking fails.Fix
The top-level
CMakeLists.txtnow setsPLATfromTHREAD_API:_OPENMPforOPENMP, and_PTHREADforPTHREADorBOTH. The examples and tests then link the real library target again. No other files change.Testing
Locally (GCC, reference BLAS), with the CI flags
-Wall -Wextra -Wpedantic:THREAD_APINote: with
THREAD_API=OPENMP,pztest_4_10_2_100000000_LAfailed once in about 6 full runs (z_div: division by zero,info 10). It looks like a nondeterministic issue in the OpenMP code path itself, not in this build fix. Before this change that configuration did not link at all. CI does not exercise it.🤖 Generated with Claude Code
https://claude.ai/code/session_017GsYX7J15S6uvtUoRMWYwi
Generated by Claude Code