diff --git a/CMakeLists.txt b/CMakeLists.txt index 39e74ed3..87a015d9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,8 +1,14 @@ CMAKE_MINIMUM_REQUIRED(VERSION 3.26) +# The VERSION file is the single source of truth for the version, and JFJOCH_VERSION carries it +# verbatim - including a pre-release suffix such as "-rc.161" - into the package names, the DKMS +# install path and the version every binary reports. PROJECT(VERSION) cannot hold that string: it +# only accepts numeric major.minor.patch, so the numeric part is cut out of the same file rather +# than written out a second time, and PROJECT_VERSION can never drift from VERSION. FILE(STRINGS VERSION JFJOCH_VERSION) +STRING(REGEX MATCH "^[0-9]+\\.[0-9]+\\.[0-9]+" JFJOCH_VERSION_NUMERIC "${JFJOCH_VERSION}") -PROJECT(jfjoch VERSION 1.0.0 LANGUAGES C CXX) +PROJECT(jfjoch VERSION ${JFJOCH_VERSION_NUMERIC} LANGUAGES C CXX) SET(CMAKE_POLICY_DEFAULT_CMP0077 NEW) SET(CMAKE_CXX_STANDARD 20) @@ -62,7 +68,11 @@ ENDIF() CHECK_LANGUAGE(CUDA) -SET(CMAKE_CUDA_ARCHITECTURES 75 80 86 89 90 100 120) # T4, A100, RTX A4000, L4 +# GPU architectures to generate device code for: Turing (T4), Ampere (A100; RTX A4000), Ada (L4), +# Hopper, and Blackwell in both its data-centre and consumer forms. A bare entry emits SASS *and* +# PTX for that architecture, so the newest one here also covers any future GPU: the driver +# JIT-compiles its PTX on first launch. +SET(CMAKE_CUDA_ARCHITECTURES 75 80 86 89 90 100 120) SET(CMAKE_CUDA_STANDARD 20) SET(CMAKE_CUDA_STANDARD_REQUIRED True) SET(CMAKE_CUDA_FLAGS_RELEASE "-O3 -lineinfo") @@ -79,7 +89,7 @@ IF (CMAKE_CUDA_COMPILER) ADD_COMPILE_DEFINITIONS(JFJOCH_USE_CUDA) SET(JFJOCH_CUDA_AVAILABLE ON) # Blackwell GB10 (DGX Spark) is sm_121, only known to nvcc >= 12.9; add it there so the - # binary launches natively on Spark (the list above tops out at sm_120 and embeds no PTX). + # binary runs natively on Spark instead of having the driver JIT sm_120 PTX for it. IF (CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL "12.9") LIST(APPEND CMAKE_CUDA_ARCHITECTURES 121) ENDIF() diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index 43eafcec..0884f5bb 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -19,10 +19,9 @@ EXECUTE_PROCESS(COMMAND set (THREADS_PREFER_PTHREAD_FLAG ON) find_package (Threads REQUIRED) -FILE(STRINGS ../VERSION PACKAGE_VERSION) MESSAGE(STATUS "Jungfraujoch git SHA1: ${GIT_SHA1}") MESSAGE(STATUS "Jungfraujoch git date: ${GIT_DATE}") -MESSAGE(STATUS "Jungfraujoch version: ${PACKAGE_VERSION}") +MESSAGE(STATUS "Jungfraujoch version: ${JFJOCH_VERSION}") CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/GitInfo.cpp.in" "${CMAKE_CURRENT_BINARY_DIR}/GitInfo.cpp" @ONLY) diff --git a/common/GitInfo.cpp.in b/common/GitInfo.cpp.in index f5619485..98caf90e 100644 --- a/common/GitInfo.cpp.in +++ b/common/GitInfo.cpp.in @@ -12,5 +12,5 @@ std::string jfjoch_git_date() { } std::string jfjoch_version() { - return "@PACKAGE_VERSION@"; + return "@JFJOCH_VERSION@"; } \ No newline at end of file