Skip to content

Conversation

@tpadioleau
Copy link
Member

The PR adds two CMake options to disable Variorum (KokkosTools_ENABLE_VARIORUM) and SystemTap (KokkosTools_ENABLE_SYSTEMTAP). This work is related to the issue spack/spack-packages#377 that needs an explicit way to disable the search of Variorum and dtrace.

set(KOKKOSTOOLS_HAS_VARIORUM TRUE)
else()
message(WARNING "Variorum not found: ${MSG_NOTFOUND}")
message(FATAL_ERROR "Variorum not found: ${MSG_NOTFOUND}")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The message is made FATAL_ERROR because the user can now explicitly disable Variorum if it cannot be found.

I think once a new release of variorum is made, shipping llnl/variorum@c3b620a, we could replace this file by find_package(Variorum REQUIRED).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why don't we instead do find_package(Variorum REQUIRED) L19 and drop that if...else statement.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My intent was to keep the message to help the user to set the expected variables. For example the user could expect that setting CMAKE_PREFIX_PATH works.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any strong preference ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My intent was to keep the message to help the user to set the expected variables. For example the user could expect that setting CMAKE_PREFIX_PATH works.

Why would it not work?

Any strong preference ?

No. That's fine we can rework the find modules later as necessary.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why would it not work?

Variorum used to install the CMake files in a non standard directory, CMake could not find them with CMAKE_PREFIX_PATH nor Variorum_ROOT. I suspect this is why we have all the logic about paths in the configure_variorum.cmake. The commit llnl/variorum@c3b620a should fix that but this will be available only in the next release of Variorum.

@tpadioleau tpadioleau force-pushed the introduce-variorum-and-systemtap-options branch 3 times, most recently from d0fbb66 to 9a308a7 Compare October 13, 2025 10:40
Copy link
Member

@dalg24 dalg24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding options is fine because it is consistent with what we currently do with other dependency.

Longer-term, I would like us to consider simply using the CMake native support for controlling finding packages, CMAKE_DISABLE_FIND_PACKAGE_<PackageName> and CMAKE_REQUIRE_FIND_PACKAGE_<PackageName>, instead of rolling our own.
(Not blocking your PR though as it is a legitimate improvement over the status quo)

set(KOKKOSTOOLS_HAS_VARIORUM TRUE)
else()
message(WARNING "Variorum not found: ${MSG_NOTFOUND}")
message(FATAL_ERROR "Variorum not found: ${MSG_NOTFOUND}")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why don't we instead do find_package(Variorum REQUIRED) L19 and drop that if...else statement.

@tpadioleau
Copy link
Member Author

Longer-term, I would like us to consider simply using the CMake native support for controlling finding packages, CMAKE_DISABLE_FIND_PACKAGE_<PackageName> and CMAKE_REQUIRE_FIND_PACKAGE_<PackageName>, instead of rolling our own. (Not blocking your PR though as it is a legitimate improvement over the status quo)

A difficulty I see with CMake options is that they only relate to dependencies but not to features of the project. Some features have multiple dependencies, some dependencies belong to different features (like MPI). If we remove all our options and rely only on the predefined variables, I think it might end up be more difficult for the user to find the correct options to set.

@tpadioleau tpadioleau force-pushed the introduce-variorum-and-systemtap-options branch from 9a308a7 to 6b11729 Compare October 14, 2025 16:11
@tpadioleau tpadioleau marked this pull request as ready for review October 15, 2025 08:26
find_program(KOKKOSTOOLS_DTRACE_EXECUTABLE dtrace)
if(KOKKOSTOOLS_DTRACE_EXECUTABLE)
if(KokkosTools_ENABLE_SYSTEMTAP)
if(NOT WIN32 AND NOT APPLE)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would slightly prefer avoiding the negations

if(WIN32 OR APPLE)
  message(FATAL_ERROR ...
else()
  find_package(...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point

set(KOKKOSTOOLS_HAS_VARIORUM TRUE)
else()
message(WARNING "Variorum not found: ${MSG_NOTFOUND}")
message(FATAL_ERROR "Variorum not found: ${MSG_NOTFOUND}")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My intent was to keep the message to help the user to set the expected variables. For example the user could expect that setting CMAKE_PREFIX_PATH works.

Why would it not work?

Any strong preference ?

No. That's fine we can rework the find modules later as necessary.

@dalg24 dalg24 merged commit 0ef4350 into kokkos:develop Oct 15, 2025
7 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.

3 participants