[Openmp-commits] [openmp] 1524cec - [OpenMP][libomp] Cleanup OpenMP specification version information (#225427)
via Openmp-commits
openmp-commits at lists.llvm.org
Thu Oct 1 15:49:00 PDT 2026
Author: Hansang Bae
Date: 2026-10-01T17:48:53-05:00
New Revision: 1524cec90a78ad6da741458ee6fdea4721894398
URL: https://github.com/llvm/llvm-project/commit/1524cec90a78ad6da741458ee6fdea4721894398
DIFF: https://github.com/llvm/llvm-project/commit/1524cec90a78ad6da741458ee6fdea4721894398.diff
LOG: [OpenMP][libomp] Cleanup OpenMP specification version information (#225427)
Make OpenMP specification version and date aligned with what is defined
in the CMake configuration.
Added:
Modified:
openmp/runtime/src/CMakeLists.txt
openmp/runtime/src/kmp_runtime.cpp
openmp/runtime/src/kmp_version.cpp
Removed:
################################################################################
diff --git a/openmp/runtime/src/CMakeLists.txt b/openmp/runtime/src/CMakeLists.txt
index f8bf6ac0cfd9f..d0803bcfb471a 100644
--- a/openmp/runtime/src/CMakeLists.txt
+++ b/openmp/runtime/src/CMakeLists.txt
@@ -157,6 +157,10 @@ libomp_get_asmflags(LIBOMP_CONFIGURED_ASMFLAGS)
set_source_files_properties(${LIBOMP_CXXFILES} PROPERTIES COMPILE_FLAGS "${LIBOMP_CONFIGURED_CXXFLAGS}")
set_source_files_properties(${LIBOMP_ASMFILES} ${LIBOMP_GNUASMFILES} PROPERTIES COMPILE_FLAGS "${LIBOMP_CONFIGURED_ASMFLAGS}")
+# OpenMP version and date
+add_compile_definitions(KMP_SPEC_VERSION=${LIBOMP_VERSION_MAJOR}.${LIBOMP_VERSION_MINOR})
+add_compile_definitions(KMP_SPEC_DATE=${LIBOMP_OMP_YEAR_MONTH})
+
# Disable libstdc++ assertions, even in an LLVM_ENABLE_ASSERTIONS build, to
# avoid an unwanted dependency on libstdc++.so.
add_compile_definitions(_GLIBCXX_NO_ASSERTIONS)
diff --git a/openmp/runtime/src/kmp_runtime.cpp b/openmp/runtime/src/kmp_runtime.cpp
index 8ebebfcb7e056..68ea0410310b3 100644
--- a/openmp/runtime/src/kmp_runtime.cpp
+++ b/openmp/runtime/src/kmp_runtime.cpp
@@ -59,19 +59,6 @@ static char *ProfileTraceFile = nullptr;
#define SHM_SIZE 1024
#endif
-#if defined(KMP_GOMP_COMPAT)
-char const __kmp_version_alt_comp[] =
- KMP_VERSION_PREFIX "alternative compiler support: yes";
-#endif /* defined(KMP_GOMP_COMPAT) */
-
-char const __kmp_version_omp_api[] =
- KMP_VERSION_PREFIX "API version: 5.0 (201611)";
-
-#ifdef KMP_DEBUG
-char const __kmp_version_lock[] =
- KMP_VERSION_PREFIX "lock type: run time selectable";
-#endif /* KMP_DEBUG */
-
#define KMP_MIN(x, y) ((x) < (y) ? (x) : (y))
/* ------------------------------------------------------------------------ */
diff --git a/openmp/runtime/src/kmp_version.cpp b/openmp/runtime/src/kmp_version.cpp
index 39d0f6084badc..213cafa9e4684 100644
--- a/openmp/runtime/src/kmp_version.cpp
+++ b/openmp/runtime/src/kmp_version.cpp
@@ -91,10 +91,23 @@
#define KMP_LIBRARY KMP_LIB_TYPE " library (" KMP_LINK_TYPE ")"
#define KMP_COPYRIGHT ""
+#if defined(KMP_GOMP_COMPAT)
+char const __kmp_version_alt_comp[] =
+ KMP_VERSION_PREFIX "alternative compiler support: yes";
+#endif /* defined(KMP_GOMP_COMPAT) */
+
+char const __kmp_version_omp_api[] = KMP_VERSION_PREFIX
+ "API version: " stringer(KMP_SPEC_VERSION) " (" stringer(KMP_SPEC_DATE) ")";
+
+#ifdef KMP_DEBUG
+char const __kmp_version_lock[] =
+ KMP_VERSION_PREFIX "lock type: run time selectable";
+#endif /* KMP_DEBUG */
+
int const __kmp_version_major = KMP_VERSION_MAJOR;
int const __kmp_version_minor = KMP_VERSION_MINOR;
int const __kmp_version_build = KMP_VERSION_BUILD;
-int const __kmp_openmp_version = 201611;
+int const __kmp_openmp_version = KMP_SPEC_DATE;
/* Do NOT change the format of this string! Intel(R) Thread Profiler checks for
a specific format some changes in the recognition routine there need to be
More information about the Openmp-commits
mailing list