diff --git a/CMakeLists.txt b/CMakeLists.txt index 58b189ce17..70ac087991 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,7 +11,7 @@ list(APPEND CMAKE_MODULE_PATH "${UMF_CMAKE_SOURCE_DIR}/cmake") include(${UMF_CMAKE_SOURCE_DIR}/cmake/helpers.cmake) # We use semver aligned version, set via git tags. We parse git output to -# establih the version of UMF to be used in CMake, Win dll's, and within the +# establish the version of UMF to be used in CMake, Win dll's, and within the # code (e.g. in logger). We have 3-component releases (e.g. 1.5.1) plus release # candidates and git info. Function below sets all variables related to version. set_version_variables() @@ -33,36 +33,47 @@ include(CMakePackageConfigHelpers) include(GNUInstallDirs) find_package(PkgConfig) +# Define a list to store the names of all options +set(UMF_OPTIONS_LIST "") +list(APPEND UMF_OPTIONS_LIST CMAKE_BUILD_TYPE) + +# Define a macro to wrap the option() command and track the options +macro(umf_option) + list(APPEND UMF_OPTIONS_LIST ${ARGV0}) + option(${ARGV}) +endmacro() + # Build Options -option(UMF_BUILD_SHARED_LIBRARY "Build UMF as shared library" OFF) -option(UMF_BUILD_LEVEL_ZERO_PROVIDER "Build Level Zero memory provider" ON) -option(UMF_BUILD_CUDA_PROVIDER "Build CUDA memory provider" ON) -option(UMF_BUILD_LIBUMF_POOL_DISJOINT - "Build the libumf_pool_disjoint static library" OFF) -option(UMF_BUILD_LIBUMF_POOL_JEMALLOC - "Build the libumf_pool_jemalloc static library" OFF) -option(UMF_BUILD_TESTS "Build UMF tests" ON) -option(UMF_BUILD_GPU_TESTS "Build UMF GPU tests" OFF) -option(UMF_BUILD_BENCHMARKS "Build UMF benchmarks" OFF) -option(UMF_BUILD_BENCHMARKS_MT "Build UMF multithreaded benchmarks" OFF) -option(UMF_BUILD_EXAMPLES "Build UMF examples" ON) -option(UMF_BUILD_FUZZTESTS "Build UMF fuzz tests" OFF) -option(UMF_BUILD_GPU_EXAMPLES "Build UMF GPU examples" OFF) -option(UMF_DEVELOPER_MODE "Enable additional developer checks" OFF) -option( +umf_option(UMF_BUILD_SHARED_LIBRARY "Build UMF as shared library" OFF) +umf_option(UMF_BUILD_LEVEL_ZERO_PROVIDER "Build Level Zero memory provider" ON) +umf_option(UMF_BUILD_CUDA_PROVIDER "Build CUDA memory provider" ON) +umf_option(UMF_BUILD_LIBUMF_POOL_DISJOINT + "Build the libumf_pool_disjoint static library" OFF) +umf_option(UMF_BUILD_LIBUMF_POOL_JEMALLOC + "Build the libumf_pool_jemalloc static library" OFF) +umf_option(UMF_BUILD_TESTS "Build UMF tests" ON) +umf_option(UMF_BUILD_GPU_TESTS "Build UMF GPU tests" OFF) +umf_option(UMF_BUILD_BENCHMARKS "Build UMF benchmarks" OFF) +umf_option(UMF_BUILD_BENCHMARKS_MT "Build UMF multithreaded benchmarks" OFF) +umf_option(UMF_BUILD_EXAMPLES "Build UMF examples" ON) +umf_option(UMF_BUILD_FUZZTESTS "Build UMF fuzz tests" OFF) +umf_option(UMF_BUILD_GPU_EXAMPLES "Build UMF GPU examples" OFF) +umf_option(UMF_DEVELOPER_MODE "Enable additional developer checks" OFF) +umf_option( UMF_DISABLE_HWLOC "Disable hwloc and UMF features requiring it (OS provider, memtargets, topology discovery)" OFF) -option( +umf_option( UMF_LINK_HWLOC_STATICALLY "Link UMF with HWLOC library statically (proxy library will be disabled on Windows+Debug build)" OFF) -option(UMF_FORMAT_CODE_STYLE - "Add clang, cmake, and black -format-check and -format-apply targets" - OFF) +umf_option( + UMF_FORMAT_CODE_STYLE + "Add clang, cmake, and black -format-check and -format-apply targets" OFF) set(UMF_HWLOC_NAME "hwloc" CACHE STRING "Custom name for hwloc library w/o extension") +list(APPEND UMF_OPTIONS_LIST UMF_HWLOC_NAME) set(UMF_INSTALL_RPATH "" CACHE @@ -71,13 +82,13 @@ set(UMF_INSTALL_RPATH ) # Only a part of skips is treated as a failure now. TODO: extend to all tests -option(UMF_TESTS_FAIL_ON_SKIP "Treat skips in tests as fail" OFF) -option(UMF_USE_ASAN "Enable AddressSanitizer checks" OFF) -option(UMF_USE_UBSAN "Enable UndefinedBehaviorSanitizer checks" OFF) -option(UMF_USE_TSAN "Enable ThreadSanitizer checks" OFF) -option(UMF_USE_MSAN "Enable MemorySanitizer checks" OFF) -option(UMF_USE_VALGRIND "Enable Valgrind instrumentation" OFF) -option(UMF_USE_COVERAGE "Build with coverage enabled (Linux only)" OFF) +umf_option(UMF_TESTS_FAIL_ON_SKIP "Treat skips in tests as fail" OFF) +umf_option(UMF_USE_ASAN "Enable AddressSanitizer checks" OFF) +umf_option(UMF_USE_UBSAN "Enable UndefinedBehaviorSanitizer checks" OFF) +umf_option(UMF_USE_TSAN "Enable ThreadSanitizer checks" OFF) +umf_option(UMF_USE_MSAN "Enable MemorySanitizer checks" OFF) +umf_option(UMF_USE_VALGRIND "Enable Valgrind instrumentation" OFF) +umf_option(UMF_USE_COVERAGE "Build with coverage enabled (Linux only)" OFF) # set UMF_PROXY_LIB_BASED_ON_POOL to one of: SCALABLE or JEMALLOC set(KNOWN_PROXY_LIB_POOLS SCALABLE JEMALLOC) @@ -87,6 +98,7 @@ set(UMF_PROXY_LIB_BASED_ON_POOL "A UMF pool the proxy library is based on (SCALABLE or JEMALLOC)") set_property(CACHE UMF_PROXY_LIB_BASED_ON_POOL PROPERTY STRINGS ${KNOWN_PROXY_LIB_POOLS}) +list(APPEND UMF_OPTIONS_LIST UMF_PROXY_LIB_BASED_ON_POOL) if(UMF_BUILD_TESTS AND DEFINED ENV{CI} diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index cd4a2a7906..7b9749c491 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,15 +2,19 @@ -- [Opening new issues](#opening-new-issues) -- [Submitting Pull Requests](#submitting-pull-requests) +- [Contributing to UMF (Unified Memory Framework)](#contributing-to-umf-unified-memory-framework) + - [Opening new issues](#opening-new-issues) + - [Submitting Pull Requests](#submitting-pull-requests) - [Building and testing](#building-and-testing) - [Code style](#code-style) - - [When my PR is merged?](#when-my-PR-is-merged) + - [When my PR is merged?](#when-my-pr-is-merged) - [Extending public API](#extending-public-api) - [License](#license) - [Adding new dependency](#adding-new-dependency) -- [Code coverage](#code-coverage) + - [Code coverage](#code-coverage) + - [Debugging](#debugging) + - [Checking the UMF version and CMake variables (Linux only)](#checking-the-umf-version-and-cmake-variables-linux-only) + - [Requirements](#requirements) Below you'll find instructions on how to contribute to UMF, either with code changes or issues. All contributions are most welcome! @@ -222,3 +226,19 @@ $ apt install lcov $ lcov --capture --directory . --output-file coverage.info $ genhtml -o html_report coverage.info ``` + +## Debugging + +### Checking the UMF version and CMake variables (Linux only) + +Strings with the UMF version and useful CMake variables can be grepped in the following way: + +```bash +$ strings libumf.so | grep "@(#)" +@(#) Intel(R) UMF version: 0.11.0-dev.git66.g89e3831d +@(#) Intel(R) UMF CMake variables: "CMAKE_BUILD_TYPE:Debug,... +``` + +#### Requirements + +- binutils package (Linux) diff --git a/ChangeLog b/ChangeLog index ce55033506..a4afa52cee 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +Fri Jan 10 2025 Łukasz Stolarczuk + + * Version 0.10.1 + + This patch release contains: + - Set symbol versions 0.10 in def/map files (#1013) + - Fix: remove incorrect assert in utils_align_ptr_up_size_down() (#977) + - Add strings with UMF version and useful CMake options (#992) + - Extended error messages, when providers are disabled (#1012) + Mon Dec 09 2024 Łukasz Stolarczuk * Version 0.10.0 diff --git a/RELEASE_STEPS.md b/RELEASE_STEPS.md index 9e04dc8502..09a972598b 100644 --- a/RELEASE_STEPS.md +++ b/RELEASE_STEPS.md @@ -38,9 +38,9 @@ Do changes for a release: - If previously we decided not to create such branch, create it now, based on the appropriate minor or major tag - For major/minor release start from the `main` branch - Add an entry to ChangeLog, remember to change the day of the week in the release date - - For major releases mention API and ABI compatibility with the previous release + - For major and minor (prior 1.0.0) releases mention API and ABI compatibility with the previous release - For major and minor releases, update `UMF_VERSION_CURRENT` in `include/umf/base.h` (the API version) -- For major releases update ABI version in `.map` and `.def` files +- For major and minor (prior 1.0.0) releases update ABI version in `.map` and `.def` files - These files are defined for all public libraries (`libumf` and `proxy_lib`, at the moment) - Commit these changes and tag the release: - `git commit -a -S -m "$VERSION release"` diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 0ee5619680..68683bedd5 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2023-2024 Intel Corporation +# Copyright (C) 2023-2025 Intel Corporation # Under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception @@ -11,11 +11,24 @@ set(UMF_CUDA_INCLUDE_DIR "" CACHE PATH "Directory containing the CUDA headers") +# Compose the UMF_ALL_CMAKE_VARIABLES variable containing CMake options that +# will be saved in the constant string. +list(SORT UMF_OPTIONS_LIST ORDER DESCENDING) +foreach(_var ${UMF_OPTIONS_LIST}) + # Preprocessor definitions containing '#' cannot be passed on to the + # compiler command line because many compilers do not support it. + if(NOT "${${_var}}" MATCHES "#") + set(UMF_ALL_CMAKE_VARIABLES + "${_var}:${${_var}},${UMF_ALL_CMAKE_VARIABLES}") + endif() +endforeach() + # Compile definitions for UMF library. # # TODO: Cleanup the compile definitions across all the CMake files -set(UMF_COMMON_COMPILE_DEFINITIONS ${UMF_COMMON_COMPILE_DEFINITIONS} - UMF_VERSION=${UMF_VERSION}) +set(UMF_COMMON_COMPILE_DEFINITIONS + ${UMF_COMMON_COMPILE_DEFINITIONS} UMF_VERSION=${UMF_VERSION} + UMF_ALL_CMAKE_VARIABLES="${UMF_ALL_CMAKE_VARIABLES}") set(BA_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/base_alloc/base_alloc.c diff --git a/src/libumf.def b/src/libumf.def index d4c8bb7776..d053fa2407 100644 --- a/src/libumf.def +++ b/src/libumf.def @@ -4,9 +4,9 @@ ; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception ;;;; End Copyright Notice -LIBRARY umf +LIBRARY UMF -VERSION 1.0 +VERSION 0.11 EXPORTS DllMain diff --git a/src/libumf.map b/src/libumf.map index ff6348e229..21e9ec55ab 100644 --- a/src/libumf.map +++ b/src/libumf.map @@ -2,7 +2,7 @@ # Under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -UMF_1.0 { +UMF_0.10 { global: umfInit; umfTearDown; @@ -117,3 +117,9 @@ UMF_1.0 { local: *; }; + +UMF_0.11 { + umfFixedMemoryProviderOps; + umfFixedMemoryProviderParamsCreate; + umfFixedMemoryProviderParamsDestroy; +} UMF_0.10; diff --git a/src/provider/provider_cuda.c b/src/provider/provider_cuda.c index f46e049723..9bb11327b9 100644 --- a/src/provider/provider_cuda.c +++ b/src/provider/provider_cuda.c @@ -12,17 +12,21 @@ #include #include +#include "utils_log.h" + #if defined(UMF_NO_CUDA_PROVIDER) umf_result_t umfCUDAMemoryProviderParamsCreate( umf_cuda_memory_provider_params_handle_t *hParams) { (void)hParams; + LOG_ERR("CUDA provider is disabled (UMF_BUILD_CUDA_PROVIDER is OFF)!"); return UMF_RESULT_ERROR_NOT_SUPPORTED; } umf_result_t umfCUDAMemoryProviderParamsDestroy( umf_cuda_memory_provider_params_handle_t hParams) { (void)hParams; + LOG_ERR("CUDA provider is disabled (UMF_BUILD_CUDA_PROVIDER is OFF)!"); return UMF_RESULT_ERROR_NOT_SUPPORTED; } @@ -30,6 +34,7 @@ umf_result_t umfCUDAMemoryProviderParamsSetContext( umf_cuda_memory_provider_params_handle_t hParams, void *hContext) { (void)hParams; (void)hContext; + LOG_ERR("CUDA provider is disabled (UMF_BUILD_CUDA_PROVIDER is OFF)!"); return UMF_RESULT_ERROR_NOT_SUPPORTED; } @@ -37,6 +42,7 @@ umf_result_t umfCUDAMemoryProviderParamsSetDevice( umf_cuda_memory_provider_params_handle_t hParams, int hDevice) { (void)hParams; (void)hDevice; + LOG_ERR("CUDA provider is disabled (UMF_BUILD_CUDA_PROVIDER is OFF)!"); return UMF_RESULT_ERROR_NOT_SUPPORTED; } @@ -45,11 +51,13 @@ umf_result_t umfCUDAMemoryProviderParamsSetMemoryType( umf_usm_memory_type_t memoryType) { (void)hParams; (void)memoryType; + LOG_ERR("CUDA provider is disabled (UMF_BUILD_CUDA_PROVIDER is OFF)!"); return UMF_RESULT_ERROR_NOT_SUPPORTED; } umf_memory_provider_ops_t *umfCUDAMemoryProviderOps(void) { // not supported + LOG_ERR("CUDA provider is disabled (UMF_BUILD_CUDA_PROVIDER is OFF)!"); return NULL; } diff --git a/src/provider/provider_devdax_memory.c b/src/provider/provider_devdax_memory.c index 79a0662754..4841a99199 100644 --- a/src/provider/provider_devdax_memory.c +++ b/src/provider/provider_devdax_memory.c @@ -17,10 +17,13 @@ #include #include +#include "utils_log.h" + #if defined(_WIN32) || defined(UMF_NO_HWLOC) umf_memory_provider_ops_t *umfDevDaxMemoryProviderOps(void) { // not supported + LOG_ERR("DevDax memory provider is disabled!"); return NULL; } @@ -30,12 +33,14 @@ umf_result_t umfDevDaxMemoryProviderParamsCreate( (void)hParams; (void)path; (void)size; + LOG_ERR("DevDax memory provider is disabled!"); return UMF_RESULT_ERROR_NOT_SUPPORTED; } umf_result_t umfDevDaxMemoryProviderParamsDestroy( umf_devdax_memory_provider_params_handle_t hParams) { (void)hParams; + LOG_ERR("DevDax memory provider is disabled!"); return UMF_RESULT_ERROR_NOT_SUPPORTED; } @@ -45,6 +50,7 @@ umf_result_t umfDevDaxMemoryProviderParamsSetDeviceDax( (void)hParams; (void)path; (void)size; + LOG_ERR("DevDax memory provider is disabled!"); return UMF_RESULT_ERROR_NOT_SUPPORTED; } @@ -52,6 +58,7 @@ umf_result_t umfDevDaxMemoryProviderParamsSetProtection( umf_devdax_memory_provider_params_handle_t hParams, unsigned protection) { (void)hParams; (void)protection; + LOG_ERR("DevDax memory provider is disabled!"); return UMF_RESULT_ERROR_NOT_SUPPORTED; } diff --git a/src/provider/provider_file_memory.c b/src/provider/provider_file_memory.c index 03aa80b022..ea69dc7b62 100644 --- a/src/provider/provider_file_memory.c +++ b/src/provider/provider_file_memory.c @@ -18,10 +18,13 @@ #include #include +#include "utils_log.h" + #if defined(_WIN32) || defined(UMF_NO_HWLOC) umf_memory_provider_ops_t *umfFileMemoryProviderOps(void) { // not supported + LOG_ERR("File memory provider is disabled!"); return NULL; } @@ -29,12 +32,14 @@ umf_result_t umfFileMemoryProviderParamsCreate( umf_file_memory_provider_params_handle_t *hParams, const char *path) { (void)hParams; (void)path; + LOG_ERR("File memory provider is disabled!"); return UMF_RESULT_ERROR_NOT_SUPPORTED; } umf_result_t umfFileMemoryProviderParamsDestroy( umf_file_memory_provider_params_handle_t hParams) { (void)hParams; + LOG_ERR("File memory provider is disabled!"); return UMF_RESULT_ERROR_NOT_SUPPORTED; } @@ -42,6 +47,7 @@ umf_result_t umfFileMemoryProviderParamsSetPath( umf_file_memory_provider_params_handle_t hParams, const char *path) { (void)hParams; (void)path; + LOG_ERR("File memory provider is disabled!"); return UMF_RESULT_ERROR_NOT_SUPPORTED; } @@ -49,6 +55,7 @@ umf_result_t umfFileMemoryProviderParamsSetProtection( umf_file_memory_provider_params_handle_t hParams, unsigned protection) { (void)hParams; (void)protection; + LOG_ERR("File memory provider is disabled!"); return UMF_RESULT_ERROR_NOT_SUPPORTED; } @@ -57,6 +64,7 @@ umf_result_t umfFileMemoryProviderParamsSetVisibility( umf_memory_visibility_t visibility) { (void)hParams; (void)visibility; + LOG_ERR("File memory provider is disabled!"); return UMF_RESULT_ERROR_NOT_SUPPORTED; } diff --git a/src/provider/provider_level_zero.c b/src/provider/provider_level_zero.c index 964d91e105..f3ce269b25 100644 --- a/src/provider/provider_level_zero.c +++ b/src/provider/provider_level_zero.c @@ -14,17 +14,23 @@ #include #include +#include "utils_log.h" + #if defined(UMF_NO_LEVEL_ZERO_PROVIDER) umf_result_t umfLevelZeroMemoryProviderParamsCreate( umf_level_zero_memory_provider_params_handle_t *hParams) { (void)hParams; + LOG_ERR("L0 memory provider is disabled! (UMF_BUILD_LEVEL_ZERO_PROVIDER is " + "OFF)"); return UMF_RESULT_ERROR_NOT_SUPPORTED; } umf_result_t umfLevelZeroMemoryProviderParamsDestroy( umf_level_zero_memory_provider_params_handle_t hParams) { (void)hParams; + LOG_ERR("L0 memory provider is disabled! (UMF_BUILD_LEVEL_ZERO_PROVIDER is " + "OFF)"); return UMF_RESULT_ERROR_NOT_SUPPORTED; } @@ -33,6 +39,8 @@ umf_result_t umfLevelZeroMemoryProviderParamsSetContext( ze_context_handle_t hContext) { (void)hParams; (void)hContext; + LOG_ERR("L0 memory provider is disabled! (UMF_BUILD_LEVEL_ZERO_PROVIDER is " + "OFF)"); return UMF_RESULT_ERROR_NOT_SUPPORTED; } @@ -41,6 +49,8 @@ umf_result_t umfLevelZeroMemoryProviderParamsSetDevice( ze_device_handle_t hDevice) { (void)hParams; (void)hDevice; + LOG_ERR("L0 memory provider is disabled! (UMF_BUILD_LEVEL_ZERO_PROVIDER is " + "OFF)"); return UMF_RESULT_ERROR_NOT_SUPPORTED; } @@ -49,6 +59,8 @@ umf_result_t umfLevelZeroMemoryProviderParamsSetMemoryType( umf_usm_memory_type_t memoryType) { (void)hParams; (void)memoryType; + LOG_ERR("L0 memory provider is disabled! (UMF_BUILD_LEVEL_ZERO_PROVIDER is " + "OFF)"); return UMF_RESULT_ERROR_NOT_SUPPORTED; } @@ -58,11 +70,15 @@ umf_result_t umfLevelZeroMemoryProviderParamsSetResidentDevices( (void)hParams; (void)hDevices; (void)deviceCount; + LOG_ERR("L0 memory provider is disabled! (UMF_BUILD_LEVEL_ZERO_PROVIDER is " + "OFF)"); return UMF_RESULT_ERROR_NOT_SUPPORTED; } umf_memory_provider_ops_t *umfLevelZeroMemoryProviderOps(void) { // not supported + LOG_ERR("L0 memory provider is disabled! (UMF_BUILD_LEVEL_ZERO_PROVIDER is " + "OFF)"); return NULL; } diff --git a/src/proxy_lib/proxy_lib.def b/src/proxy_lib/proxy_lib.def index f30b405568..82b666b6af 100644 --- a/src/proxy_lib/proxy_lib.def +++ b/src/proxy_lib/proxy_lib.def @@ -5,6 +5,7 @@ ;;;; End Copyright Notice LIBRARY UMF_PROXY + EXPORTS DllMain aligned_alloc diff --git a/src/proxy_lib/proxy_lib.map b/src/proxy_lib/proxy_lib.map index 5d93d03ba5..93ae001e64 100644 --- a/src/proxy_lib/proxy_lib.map +++ b/src/proxy_lib/proxy_lib.map @@ -2,8 +2,8 @@ # Under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -# linker VERSION script - +# These functions are meant to be in unnamed scope. They are also not named +# with any umf prefix, as they should override functions with the same name. { global: aligned_alloc; diff --git a/src/utils/utils_log.c b/src/utils/utils_log.c index bdb9ce8232..2fd28fc2ce 100644 --- a/src/utils/utils_log.c +++ b/src/utils/utils_log.c @@ -32,6 +32,29 @@ #include "utils_common.h" #include "utils_log.h" +#define UMF_MAGIC_STR "\x00@(#) " +#define UMF_PREF_STR "Intel(R) " +#define UMF_PREFIX UMF_MAGIC_STR UMF_PREF_STR + +// convert a define to a C string +#define STR_(X) #X +#define STR(X) STR_(X) + +#ifdef UMF_VERSION +#define STR_UMF_VERSION "UMF version: " STR(UMF_VERSION) +#define LOG_STR_UMF_VERSION STR_UMF_VERSION ", " +char const __umf_str_2_version[] = UMF_PREFIX STR_UMF_VERSION; +#else /* !UMF_VERSION */ +#error "UMF_VERSION not defined!" +#endif /* !UMF_VERSION */ + +#ifdef UMF_ALL_CMAKE_VARIABLES +char const __umf_str_1__all_cmake_vars[] = + UMF_PREFIX "UMF CMake variables: " STR(UMF_ALL_CMAKE_VARIABLES); +#else /* !UMF_ALL_CMAKE_VARIABLES */ +#error "UMF_ALL_CMAKE_VARIABLES not defined!" +#endif /* !UMF_ALL_CMAKE_VARIABLES */ + #define LOG_MAX 8192 #define LOG_HEADER 256 #define MAX_FILE_PATH 256 @@ -305,17 +328,8 @@ void utils_log_init(void) { loggerConfig.flushLevel = LOG_FATAL; } -#ifdef UMF_VERSION -// convert a define to a C string -#define STR_(X) #X -#define STR(X) STR_(X) -#define STR_UMF_VERSION "UMF version: " STR(UMF_VERSION) ", " -#else /* !UMF_VERSION */ -#error "UMF_VERSION not defined!" -#endif /* !UMF_VERSION */ - LOG_INFO( - "Logger enabled (" STR_UMF_VERSION + "Logger enabled (" LOG_STR_UMF_VERSION "level: %s, flush: %s, pid: %s, timestamp: %s)", level_to_str(loggerConfig.level), level_to_str(loggerConfig.flushLevel), bool_to_str(loggerConfig.pid), bool_to_str(loggerConfig.timestamp)); diff --git a/test/utils/utils_log.cpp b/test/utils/utils_log.cpp index c0f81abf01..cce61db585 100644 --- a/test/utils/utils_log.cpp +++ b/test/utils/utils_log.cpp @@ -110,6 +110,9 @@ const char *env_variable = ""; #ifndef UMF_VERSION #define UMF_VERSION "test version" #endif +#ifndef UMF_ALL_CMAKE_VARIABLES +#define UMF_ALL_CMAKE_VARIABLES "test UMF_ALL_CMAKE_VARIABLES" +#endif #include "utils/utils_log.c" #undef utils_env_var #undef fopen