Skip to content

CMake: Disable test_prep targets - #6296

Merged
martin-frbg merged 3 commits into
OpenMathLib:developfrom
mathomp4:feature/turn-off-test-prep
Dec 1, 2026
Merged

martin-frbg merged 3 commits into
OpenMathLib:developfrom
mathomp4:feature/turn-off-test-prep

Conversation

@mathomp4

@mathomp4 mathomp4 commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Closes #6294

This PR disables the test_prep targets that come with CMake 4.5. If building with the GNU Make generator, the test targets in lapack-netlib that have colons throw warnings:

CMake Warning at lapack-netlib/TESTING/CMakeLists.txt:267 (add_test):
  Test "SNEP:_Testing_Nonsymmetric_Eigenvalue_Problem_routines" has a name
  containing ':', which cannot be used as a Makefile build target.  No
  "test_prep/" target will be generated for it.  Use the Ninja generator or
  rename the test to build its dependencies with a "test_prep/" target.

For now disable the targets and if users want them they should:

  1. Pass in -DCMAKE_SKIP_TEST_PREP_TARGETS=ON
  2. Use the Ninja build generator

Comment thread CMakeLists.txt Resolved
@martin-frbg

Copy link
Copy Markdown
Collaborator

I think for the OpenBLAS codebase as such, there is little if any value in having a separate build step for "prerequisites for building the test executables", as the only prerequisite would appear to be the library itself.

My current understanding is that the new option would be valuable for a complex project comprising several third-party libraries, where one would want to build and run a global ctest only when all components are in place and considered stable enough. Perhaps it would be unfair to deny such use when OpenBLAS is the subproject ? I will raise this issue with the Reference-LAPACK project where the potentially problematic test names originated.

Perhaps as an additional safeguard in addition to Brad's suggestion, the set should also be inside an if (CMAKE_GENERATOR MATCHES "Unix Makefiles") , if that is the only generator where the colons are a problem

mathomp4 and others added 2 commits December 1, 2026 14:33
Co-authored-by: Brad King <brad.king@kitware.com>
@mathomp4

mathomp4 commented Dec 1, 2026

Copy link
Copy Markdown
Contributor Author

@martin-frbg I've pulled in the change from @bradking and then incorporated your suggestion. Please take a look

@martin-frbg

Copy link
Copy Markdown
Collaborator

Great, thanks. This should fix the immediate issue, and if Reference-LAPACK decides to adjust their test names to fix the root cause, we can follow suit later. (I haven't even gotten around to creating the issue there yet...)

@martin-frbg
martin-frbg merged commit 4ae1cdc into OpenMathLib:develop Dec 1, 2026
93 of 110 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CMake 4.5+ issue with OpenBLAS

3 participants