Skip to content

CMake 4.5+ issue with OpenBLAS #6294

Done

Description

@mathomp4

So, today I built CMake 4.5.1 on my local machine and then did a build of OpenBLAS. When I did I got a lot of warnings like:

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.

So, I believe this is due to the extension of the new test_prep stuff:

https://cmake.org/cmake/help/latest/manual/cmake-buildsystem.7.html?utm_source=chatgpt.com#test-preparation-targets

which in 4.5 was extended to the GNU Make generator:

https://cmake.org/cmake/help/latest/release/4.5.html#generators

Now, does this break anything? No...? I think this means that you can't use the new test_prep targets with these tests? (I might mention @bradking to be sure).

The "fixes" are:

  1. I use Ninja and so no warnings 🙂
  2. We probably need to rename/fix the tests using a colon a la:

add_test(NAME "SNEP:_Testing_Nonsymmetric_Eigenvalue_Problem_routines"

But I don't know if CI, etc. depends on these colons.

I'd be willing to try out a PR, but I'd like someone like @martin-frbg to give me guidance on the preferred rename.

Activity

  1. bradking commented on Nov 30, 2026

    @bradking
    Contributor

    For reference, projects that don't care about having test_prep/ targets can set CMAKE_SKIP_TEST_PREP_TARGETS to disable them altogether. Or users can configure with -DCMAKE_SKIP_TEST_PREP_TARGETS=OFF.

  2. martin-frbg commented on Nov 30, 2026

    @martin-frbg
    Collaborator

    I haven't performed a proper coloscopy yet, but I don't expect anything depends on the presence of these colons. (I'm not aware of us or Reference-LAPACK using test_prep either, so perhaps disabling that CMake option would be the quickest solution)
    A fix would (also) need to be upstreamed as it is Reference-LAPACK who came up with the fancy names

  3. mathomp4 commented on Nov 30, 2026

    @mathomp4
    ContributorAuthor

    @martin-frbg Well then, that might be best. I'll take a look and try it out. I'm not sure if I'll need to gate it by CMake version as CMAKE_SKIP_TEST_PREP_TARGETS seem to be a 4.5 setting. But should be simple

  4. martin-frbg commented on Dec 1, 2026

    @martin-frbg
    Collaborator

    As far as I can tell, the added code in CMake 4.5.1 has no negative impact besides the alarming message, building with the generated makefiles still works without issues. On the other hand, older versions of CMake do not appear to be bothered by a set (CMAKE_SKIP_TEST_PREP_TARGETS on) in the toplevel CMakeLists.txt , so this is probably the cleanest solution.

  5. mathomp4 commented on Dec 1, 2026

    @mathomp4
    ContributorAuthor

    @martin-frbg Here is a PR:

    #6296

    Please unverbose it at your leisure. 😄

  6. martin-frbg commented on Dec 1, 2026

    @martin-frbg
    Collaborator

    Right - it was my impression that tests with colons in their name still run completely as normal, so the lengthy comment would seem to be unnecessary ? I admit to not having looked into what a test_prep step (that neither OpenBLAS nor Reference-LAPACK defines, to my knowledge) is intended to add to the ctest procedure though...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions