diff --git a/kitsune/CMakeLists.txt b/kitsune/CMakeLists.txt index 7b10a799619bad..e2ac6f7e0e4a45 100644 --- a/kitsune/CMakeLists.txt +++ b/kitsune/CMakeLists.txt @@ -523,6 +523,7 @@ endforeach() add_subdirectory(configs) add_subdirectory(include/kitsune) +add_subdirectory(tools) add_subdirectory(experiments) if(KITSUNE_INCLUDE_TESTS) diff --git a/kitsune/cmake/caches/kitsune-dev-darwin-aarch64.cmake b/kitsune/cmake/caches/kitsune-dev-darwin-aarch64.cmake index 255de943a34a70..650d2c5452cd5f 100644 --- a/kitsune/cmake/caches/kitsune-dev-darwin-aarch64.cmake +++ b/kitsune/cmake/caches/kitsune-dev-darwin-aarch64.cmake @@ -83,7 +83,7 @@ set(CLANG_VENDOR_UTI "gov.lanl.kitsune" CACHE STRING "") set(LLVM_TARGETS_TO_BUILD "AArch64;X86;NVPTX;AMDGPU" CACHE STRING "") # Enable specific tapir targets. -set(KITSUNE_ENABLE_TAPIR_TARGETS "cuda;hip;opencilk") +set(KITSUNE_ENABLED_TAPIR_TARGETS "cuda;hip;opencilk") # Enable tailored Kokkos compilation. set(KITSUNE_KOKKOS_ENABLED ON CACHE BOOL diff --git a/kitsune/cmake/caches/kitsune-dev-darwin.cmake b/kitsune/cmake/caches/kitsune-dev-darwin.cmake index bb4ac5d6ea07fd..930e8c277bdaa9 100644 --- a/kitsune/cmake/caches/kitsune-dev-darwin.cmake +++ b/kitsune/cmake/caches/kitsune-dev-darwin.cmake @@ -80,7 +80,7 @@ set(CLANG_VENDOR_UTI "gov.lanl.kitsune" CACHE STRING "") set(LLVM_TARGETS_TO_BUILD "X86;NVPTX;AMDGPU" CACHE STRING "") # Enable specific tapir targets. -set(KITSUNE_ENABLE_TAPIR_TARGETS "cuda;hip;opencilk") +set(KITSUNE_ENABLED_TAPIR_TARGETS "cuda;hip;opencilk") # Enable tailored Kokkos compilation. set(KITSUNE_KOKKOS_ENABLED ON CACHE BOOL diff --git a/kitsune/cmake/caches/kitsune-dev-desktop.cmake b/kitsune/cmake/caches/kitsune-dev-desktop.cmake index 5ce26c9597d0f4..8b80aefb2b1258 100644 --- a/kitsune/cmake/caches/kitsune-dev-desktop.cmake +++ b/kitsune/cmake/caches/kitsune-dev-desktop.cmake @@ -72,7 +72,7 @@ set(CLANG_VENDOR "Kitsune" CACHE STRING "") set(CLANG_VENDOR_UTI "gov.lanl.kitsune" CACHE STRING "") # Enable specific tapir targets. -set(KITSUNE_ENABLE_TAPIR_TARGETS "cuda;hip;opencilk") +set(KITSUNE_ENABLED_TAPIR_TARGETS "cuda;hip;opencilk") # Enable tailored Kokkos compilation. set(KITSUNE_KOKKOS_ENABLED ON CACHE BOOL diff --git a/kitsune/include/kitsune/Config/config.h.cmake b/kitsune/include/kitsune/Config/config.h.cmake index 5ca252f6cc8108..c7a9b7a1115389 100644 --- a/kitsune/include/kitsune/Config/config.h.cmake +++ b/kitsune/include/kitsune/Config/config.h.cmake @@ -77,4 +77,7 @@ #define KITSUNE_REALM_EXTRA_COMPILER_FLAGS "${KITSUNE_REALM_EXTRA_COMPILER_FLAGS}" #define KITSUNE_REALM_EXTRA_LINKER_FLAGS "${KITSUNE_REALM_EXTRA_LINKER_FLAGS}" +// The Tapir targets that have been enabled in this build +#define KITSUNE_ENABLED_TAPIR_TARGETS "${KITSUNE_ENABLED_TAPIR_TARGETS_STR}" + #endif diff --git a/kitsune/tools/CMakeLists.txt b/kitsune/tools/CMakeLists.txt new file mode 100644 index 00000000000000..8bf7ac3414ceb6 --- /dev/null +++ b/kitsune/tools/CMakeLists.txt @@ -0,0 +1 @@ +add_subdirectory(kit-config) diff --git a/kitsune/tools/kit-config/CMakeLists.txt b/kitsune/tools/kit-config/CMakeLists.txt new file mode 100644 index 00000000000000..98a14405a7630d --- /dev/null +++ b/kitsune/tools/kit-config/CMakeLists.txt @@ -0,0 +1,9 @@ +set(LLVM_LINK_COMPONENTS + Support) + +# set(BUILDVARIABLES_SRCPATH ${CMAKE_CURRENT_SOURCE_DIR}/BuildVariables.inc.in) +# set(BUILDVARIABLES_OBJPATH ${CMAKE_CURRENT_BINARY_DIR}/BuildVariables.inc) + +# Add the kit-config tool. +add_llvm_tool(kit-config + kit-config.cpp) diff --git a/kitsune/tools/kit-config/kit-config.cpp b/kitsune/tools/kit-config/kit-config.cpp new file mode 100644 index 00000000000000..e17b4b709296cc --- /dev/null +++ b/kitsune/tools/kit-config/kit-config.cpp @@ -0,0 +1,91 @@ +//===-- kit-config.cpp - Kitsune configuration utility --------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// +// +// This tool encapsulates information about Kitsune's configuration. This is +// an analog of the LLVM project's llvm-config utility, but the scope is very +// narrow. For most things, llvm-config should be used. +// +//===----------------------------------------------------------------------===// + +#include "kitsune/Config/config.h" +#include "llvm/Config/config.h" +#include "llvm/Support/raw_ostream.h" + +using namespace llvm; + +static void usage(bool exitWithFailure = true) { + errs() << "\ +usage: kit-config