Build information: compiler and CUDA version in rugnux's log and banner, the broker's and writer's start, the viewer's About

GitInfo gains jfjoch_build_compiler() (CMake's compiler id and version), jfjoch_build_cuda() (the CUDA
toolkit version, empty without CUDA) and jfjoch_build_info(with_cuda), one line of compiler, CUDA and flags,
stamped like the git hash. rugnux logs it as "Build:" (beside the "Build flags:" line the timing table
reads) and prints it under its version; jfjoch_broker and jfjoch_writer (without CUDA, which it does not
use) log it at start; jfjoch_viewer shows it in About. Nothing is written into the output files.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PXc1zD1yxHqaR1DGdCTHL4
This commit is contained in:
leonarski_fandClaude Opus 5.5 committed 2026-10-19 03:18:23 +02:00
1 parent 197ddef6a7
commit 43928ec490
7 files changed
+39

No files matched your search

+3
View File
@@ -9,6 +9,7 @@
#include <nlohmann/json.hpp>
#include "../common/GitInfo.h"
#include "../common/Logger.h"
#include "../common/print_license.h"
#include "../detector_control/DectrisSimplonClient.h"
@@ -61,6 +62,8 @@ int main(int argc, char **argv) {
if (argc >= 3) http_port = static_cast<uint16_t>(std::atoi(argv[2]));
Logger logger("jfjoch_broker");
logger.Info("jfjoch_broker {} (git {}), built with {}", jfjoch_version(), jfjoch_git_sha1().substr(0, 6),
jfjoch_build_info(true));
org::openapitools::server::model::Jfjoch_settings settings;
std::ifstream file(argv[1]);
+9
View File
@@ -7,6 +7,13 @@ SET(GITINFO_SOURCE_DIR "${CMAKE_SOURCE_DIR}")
SET(GITINFO_TEMPLATE "${CMAKE_CURRENT_SOURCE_DIR}/GitInfo.cpp.in")
SET(GITINFO_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/GitInfo.cpp")
SET(JFJOCH_BUILD_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
# The compiler, and the CUDA toolkit where the build uses one, for the line each program logs at start.
SET(JFJOCH_BUILD_COMPILER "${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}")
IF (JFJOCH_CUDA_AVAILABLE)
SET(JFJOCH_BUILD_CUDA "${CMAKE_CUDA_COMPILER_VERSION}")
ELSE()
SET(JFJOCH_BUILD_CUDA "")
ENDIF()
INCLUDE("${CMAKE_CURRENT_SOURCE_DIR}/GitInfoStamp.cmake")
set (THREADS_PREFER_PTHREAD_FLAG ON)
@@ -26,6 +33,8 @@ ADD_CUSTOM_TARGET(JFJochGitInfo
"-DGITINFO_OUTPUT=${CMAKE_CURRENT_BINARY_DIR}/GitInfo.cpp"
"-DJFJOCH_VERSION=${JFJOCH_VERSION}"
"-DJFJOCH_BUILD_CXX_FLAGS=${CMAKE_CXX_FLAGS}"
"-DJFJOCH_BUILD_COMPILER=${JFJOCH_BUILD_COMPILER}"
"-DJFJOCH_BUILD_CUDA=${JFJOCH_BUILD_CUDA}"
-P "${CMAKE_CURRENT_SOURCE_DIR}/GitInfoStamp.cmake"
BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/GitInfo.cpp"
COMMENT "Stamping GitInfo.cpp from git HEAD"
+16
View File
@@ -18,3 +18,19 @@ std::string jfjoch_version() {
std::string jfjoch_build_cxx_flags() {
return "@JFJOCH_BUILD_CXX_FLAGS@";
}
std::string jfjoch_build_compiler() {
return "@JFJOCH_BUILD_COMPILER@";
}
std::string jfjoch_build_cuda() {
return "@JFJOCH_BUILD_CUDA@";
}
std::string jfjoch_build_info(bool with_cuda) {
std::string out = jfjoch_build_compiler();
if (with_cuda)
out += jfjoch_build_cuda().empty() ? ", no CUDA" : ", CUDA " + jfjoch_build_cuda();
out += jfjoch_build_cxx_flags().empty() ? ", no extra compiler flags" : ", flags " + jfjoch_build_cxx_flags();
return out;
}
+5
View File
@@ -11,3 +11,8 @@ std::string jfjoch_version();
// CMAKE_CXX_FLAGS of the build - empty on a plain configure. Recorded because two builds of one
// commit can differ by flags alone, and -march moves the CPU-bound results.
std::string jfjoch_build_cxx_flags();
// The C++ compiler (CMake's id and version), and the CUDA toolkit version - empty in a build without CUDA.
std::string jfjoch_build_compiler();
std::string jfjoch_build_cuda();
// One line for a program's start: compiler, CUDA (where `with_cuda`: a program that can use it) and flags.
std::string jfjoch_build_info(bool with_cuda);
+2
View File
@@ -699,6 +699,7 @@ namespace {
c.Line(fmt::format(" rugnux Version {}{}", jfjoch_version(),
jfjoch_git_sha1().empty() ? std::string()
: fmt::format(" (git {} {})", jfjoch_git_sha1().substr(0, 6), jfjoch_git_date())));
c.Line(" Built with " + jfjoch_build_info(true));
c.Line(" Copyright (C) 2019-2026 Paul Scherrer Institute. Free software under GPLv3,");
c.Line(" with ABSOLUTELY NO WARRANTY. The methods and software rugnux builds on are");
c.Line(" credited in ACKNOWLEDGEMENT.md, LICENSE and THIRD_PARTY_NOTICES.md.");
@@ -918,6 +919,7 @@ static int RunRugnux(int argc, char **argv, bool no_gpu) {
jfjoch_git_sha1().empty() ? std::string()
: fmt::format(" (git {} {})", jfjoch_git_sha1().substr(0, 6), jfjoch_git_date()), build);
logger.Info("Build flags: {}", jfjoch_build_cxx_flags().empty() ? "none" : jfjoch_build_cxx_flags());
logger.Info("Build: {}", jfjoch_build_info(true));
logger.Info("Command line: {}", provenance.command_line);
logger.Info("GPU: {}", no_gpu ? std::string("not used (--no-gpu) - running on the CPU")
: provenance.gpu_count > 0 ? fmt::format("{} ({} visible)", provenance.gpu_description, provenance.gpu_count)
+1
View File
@@ -201,6 +201,7 @@ void JFJochViewerMenu::aboutSelected() {
QString about_text = "<h3>Jungfraujoch Image Viewer</h3>" // Use HTML for improved style
"<p><b>Version:</b> " + version + "</p>"
"<p><b>Build:</b> " + QString::fromStdString(jfjoch_build_info(true)).toHtmlEscaped() + "</p>"
"<p><b>Copyright:</b> 2019-2025 Paul Scherrer Institute</p>"
"<p><b>Author:</b> Filip Leonarski &lt;filip.leonarski@psi.ch&gt;</p>"
"<p><b>Links:</b> <a href='https://jungfraujoch.readthedocs.io'>Documentation</a>, "
+3
View File
@@ -5,6 +5,7 @@
#include <filesystem>
#include <csignal>
#include <sys/wait.h>
#include "../common/GitInfo.h"
#include "../common/Logger.h"
#include "StreamWriter.h"
#include "../common/print_license.h"
@@ -185,6 +186,8 @@ int main(int argc, char **argv) {
exit(EXIT_FAILURE);
}
}
logger.Info("jfjoch_writer {} (git {}), built with {}", jfjoch_version(), jfjoch_git_sha1().substr(0, 6),
jfjoch_build_info(false));
logger.Info("Current path {}", std::filesystem::current_path().string());
std::string repub_zmq_addr, file_done_zmq_addr;