diff --git a/.github/workflows/bvt-clang.yml b/.github/workflows/bvt-clang.yml index 84c6c2cd..4c62cb41 100644 --- a/.github/workflows/bvt-clang.yml +++ b/.github/workflows/bvt-clang.yml @@ -11,24 +11,24 @@ jobs: run: | wget https://apt.llvm.org/llvm.sh chmod +x llvm.sh - sudo ./llvm.sh 20 - sudo apt install -y libc++-20-dev clang-format-20 + sudo ./llvm.sh 21 + sudo apt install -y libc++-21-dev clang-format-21 - name: check compiler version run: | - clang++-20 --version + clang++-21 --version - - name: build and run test with clang 20 + - name: build and run test with clang 21 run: | - cmake -B build -GNinja -DCMAKE_C_COMPILER=clang-20 -DCMAKE_CXX_COMPILER=clang++-20 -DCMAKE_CXX_FLAGS="-stdlib=libc++" -DCMAKE_CXX_STANDARD=23 -DCMAKE_BUILD_TYPE=Release -DPROXY_BUILD_MODULES=TRUE + cmake -B build -GNinja -DCMAKE_C_COMPILER=clang-21 -DCMAKE_CXX_COMPILER=clang++-21 -DCMAKE_CXX_FLAGS="-stdlib=libc++" -DCMAKE_CXX_STANDARD=23 -DCMAKE_BUILD_TYPE=Release -DPROXY_BUILD_MODULES=TRUE mapfile -t FILES < <(find include tests benchmarks build/examples_from_docs tools -type f \( -name '*.h' -o -name '*.ixx' -o -name '*.cpp' \)) echo "Running clang-format on ${#FILES[@]} files: ${FILES[*]}" - clang-format-20 --dry-run --Werror "${FILES[@]}" + clang-format-21 --dry-run --Werror "${FILES[@]}" cmake --build build -j ctest --test-dir build -j mkdir build/drop chmod +x tools/dump_build_env.sh - ./tools/dump_build_env.sh clang++-20 build/drop/env-info.json + ./tools/dump_build_env.sh clang++-21 build/drop/env-info.json - name: run benchmarks run: | diff --git a/.github/workflows/bvt-compatibility.yml b/.github/workflows/bvt-compatibility.yml index 7164c839..83f41dfe 100644 --- a/.github/workflows/bvt-compatibility.yml +++ b/.github/workflows/bvt-compatibility.yml @@ -9,6 +9,9 @@ jobs: - name: install compilers run: | + wget https://apt.llvm.org/llvm.sh + chmod +x llvm.sh + sudo ./llvm.sh 20 sudo apt install -y gcc-13 g++-13 gcc-14 g++-14 clang-16 clang-17 clang-18 clang-19 libc++-17-dev - name: check compiler versions @@ -19,6 +22,7 @@ jobs: clang++-17 --version clang++-18 --version clang++-19 --version + clang++-20 --version - name: build and run test with gcc 14 run: | @@ -32,6 +36,11 @@ jobs: cmake --build build-gcc-13 -j ctest --test-dir build-gcc-13 -j + - name: build and run test with clang 20 + run: | + cmake -B build-clang-20 -GNinja -DCMAKE_C_COMPILER=clang-20 -DCMAKE_CXX_COMPILER=clang++-20 -DCMAKE_CXX_FLAGS="-stdlib=libc++" -DCMAKE_BUILD_TYPE=Release -DPROXY_BUILD_MODULES=TRUE + cmake --build build-clang-20 -j + ctest --test-dir build-clang-20 -j - name: build and run test with clang 19 run: | cmake -B build-clang-19 -DCMAKE_C_COMPILER=clang-19 -DCMAKE_CXX_COMPILER=clang++-19 -DCMAKE_CXX_FLAGS="-stdlib=libc++" -DCMAKE_BUILD_TYPE=Release -DPROXY_BUILD_MODULES=FALSE diff --git a/.github/workflows/bvt-gcc.yml b/.github/workflows/bvt-gcc.yml index 81679dd0..b0909e21 100644 --- a/.github/workflows/bvt-gcc.yml +++ b/.github/workflows/bvt-gcc.yml @@ -4,25 +4,27 @@ on: jobs: bvt-gcc: runs-on: ubuntu-24.04 + container: gcc:15 steps: - uses: actions/checkout@v4 - - name: install gcc + - name: install dependencies run: | - sudo apt install -y gcc-14 g++-14 + apt-get update + apt-get install -y cmake ninja-build - name: check compiler version run: | - g++-14 --version + g++ --version - - name: build and run test with gcc 14 + - name: build and run test with gcc 15 run: | - cmake -B build -GNinja -DCMAKE_C_COMPILER=gcc-14 -DCMAKE_CXX_COMPILER=g++-14 -DCMAKE_CXX_STANDARD=23 -DCMAKE_BUILD_TYPE=Release -DPROXY_BUILD_MODULES=TRUE + cmake -B build -GNinja -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_CXX_STANDARD=23 -DCMAKE_BUILD_TYPE=Release -DPROXY_BUILD_MODULES=TRUE cmake --build build -j ctest --test-dir build -j mkdir build/drop chmod +x tools/dump_build_env.sh - ./tools/dump_build_env.sh g++-14 build/drop/env-info.json + ./tools/dump_build_env.sh g++ build/drop/env-info.json - name: run benchmarks run: | diff --git a/.github/workflows/bvt-nvhpc.yml b/.github/workflows/bvt-nvhpc.yml index 78696e46..9a333311 100644 --- a/.github/workflows/bvt-nvhpc.yml +++ b/.github/workflows/bvt-nvhpc.yml @@ -10,16 +10,16 @@ jobs: - name: free disk space uses: jlumbroso/free-disk-space@v1.3.1 - - name: install NVHPC 25.7 + - name: install NVHPC 25.11 run: | curl https://developer.download.nvidia.com/hpc-sdk/ubuntu/DEB-GPG-KEY-NVIDIA-HPC-SDK | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-hpcsdk-archive-keyring.gpg echo 'deb [signed-by=/usr/share/keyrings/nvidia-hpcsdk-archive-keyring.gpg] https://developer.download.nvidia.com/hpc-sdk/ubuntu/amd64 /' | sudo tee /etc/apt/sources.list.d/nvhpc.list sudo apt-get update -y - sudo apt-get install -y nvhpc-25-7 + sudo apt-get install -y nvhpc-25-11 - - name: build and run test with NVHPC 25.7 + - name: build and run test with NVHPC 25.11 run: | - PATH=/opt/nvidia/hpc_sdk/Linux_x86_64/25.7/compilers/bin:$PATH; export PATH + PATH=/opt/nvidia/hpc_sdk/Linux_x86_64/25.11/compilers/bin:$PATH; export PATH cmake -B build -GNinja -DCMAKE_C_COMPILER=nvc -DCMAKE_CXX_COMPILER=nvc++ -DCMAKE_BUILD_TYPE=Release -DPROXY_BUILD_MODULES=FALSE cmake --build build -j ctest --test-dir build -j diff --git a/CMakeLists.txt b/CMakeLists.txt index ee8d16c0..ae1ffdcb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -94,6 +94,22 @@ install( # build tests if BUILD_TESTING is ON if (BUILD_TESTING) include(CTest) + + include(FetchContent) + # The policy uses the download time for timestamp, instead of the timestamp in the archive. This + # allows for proper rebuilds when a projects URL changes. + if(POLICY CMP0135) + cmake_policy(SET CMP0135 NEW) + endif() + + FetchContent_Declare( + fmt + URL https://github.com/fmtlib/fmt/archive/refs/tags/12.1.0.tar.gz + URL_HASH SHA256=ea7de4299689e12b6dddd392f9896f08fb0777ac7168897a244a6d6085043fea + SYSTEM + ) + FetchContent_MakeAvailable(fmt) + add_subdirectory(tests) add_subdirectory(benchmarks) add_subdirectory(docs) diff --git a/benchmarks/CMakeLists.txt b/benchmarks/CMakeLists.txt index 882f1043..018a9841 100644 --- a/benchmarks/CMakeLists.txt +++ b/benchmarks/CMakeLists.txt @@ -1,16 +1,9 @@ project(msft_proxy_benchmarks) -include(FetchContent) -# The policy uses the download time for timestamp, instead of the timestamp in the archive. This -# allows for proper rebuilds when a projects URL changes. -if(POLICY CMP0135) - cmake_policy(SET CMP0135 NEW) -endif() - FetchContent_Declare( benchmark - URL https://github.com/google/benchmark/archive/refs/tags/v1.9.0.tar.gz - URL_HASH SHA256=35a77f46cc782b16fac8d3b107fbfbb37dcd645f7c28eee19f3b8e0758b48994 + URL https://github.com/google/benchmark/archive/refs/tags/v1.9.4.tar.gz + URL_HASH SHA256=b334658edd35efcf06a99d9be21e4e93e092bd5f95074c1673d5c8705d95c104 ) set(BENCHMARK_ENABLE_TESTING OFF CACHE BOOL "Disable tests for google benchmark") set(BENCHMARK_ENABLE_GTEST_TESTS OFF CACHE BOOL "Disable google benchmark unit tests") diff --git a/cmake/msft_proxy4ModuleTargets.cmake b/cmake/msft_proxy4ModuleTargets.cmake index a4c2d1bc..ee130027 100644 --- a/cmake/msft_proxy4ModuleTargets.cmake +++ b/cmake/msft_proxy4ModuleTargets.cmake @@ -22,5 +22,6 @@ target_sources(msft_proxy4_module PUBLIC target_compile_features(msft_proxy4_module PUBLIC cxx_std_20) target_compile_options(msft_proxy4_module PRIVATE $<$:/utf-8> + $<$:-Wno-c++2b-extensions> ) target_link_libraries(msft_proxy4_module PUBLIC msft_proxy4::proxy) diff --git a/docs/CMakeLists.txt b/docs/CMakeLists.txt index 4ed3bb1f..ff9dc5b4 100644 --- a/docs/CMakeLists.txt +++ b/docs/CMakeLists.txt @@ -1,12 +1,5 @@ project(msft_proxy_docs) -FetchContent_Declare( - fmt - URL https://github.com/fmtlib/fmt/archive/refs/tags/11.2.0.tar.gz - URL_HASH SHA256=ac366b7b4c2e9f0dde63a59b3feb5ee59b67974b14ee5dc9ea8ad78aa2c1ee1e -) -FetchContent_MakeAvailable(fmt) - find_package(Python3 REQUIRED COMPONENTS Interpreter) file(GLOB_RECURSE DOC_FILES "*.md") diff --git a/include/proxy/v4/proxy.h b/include/proxy/v4/proxy.h index e502b173..923e41c5 100644 --- a/include/proxy/v4/proxy.h +++ b/include/proxy/v4/proxy.h @@ -2456,7 +2456,7 @@ struct operator_dispatch; #define PROD_DEF_RHS_ASSIGNMENT_OP_ACCESSOR(oq, pq, ne, ...) \ template \ struct accessor { \ - friend Arg& operator __VA_ARGS__(Arg & arg, P pq self) ne { \ + friend Arg& operator __VA_ARGS__(Arg& arg, P pq self) ne { \ proxy_invoke(static_cast

(self), arg); \ return arg; \ } \ diff --git a/include/proxy/v4/proxy_fmt.h b/include/proxy/v4/proxy_fmt.h index 7d2c4839..be6a3684 100644 --- a/include/proxy/v4/proxy_fmt.h +++ b/include/proxy/v4/proxy_fmt.h @@ -11,31 +11,25 @@ #error Please ensure that proxy.h is included before proxy_fmt.h. #endif // __msft_lib_proxy4 -#if FMT_VERSION >= 60100 -static_assert(fmt::is_char::value, - "The {fmt} library must have wchar_t support enabled. " - "Include fmt/xchar.h before including proxy_fmt.h."); -#else +#if FMT_VERSION < 60100 #error Please ensure that the appropriate {fmt} headers (version 6.1.0 or \ later) are included before proxy_fmt.h. -#endif // FMT_VERSION >= 60100 +#endif // FMT_VERSION < 60100 namespace pro::inline v4 { namespace details { template -struct fmt_format_overload_traits; -template <> -struct fmt_format_overload_traits - : std::type_identity {}; -template <> -struct fmt_format_overload_traits - : std::type_identity {}; +#if FMT_VERSION >= 110000 +using fmt_buffered_context = fmt::buffered_context; +#else +using fmt_buffered_context = fmt::buffer_context; +#endif // FMT_VERSION + template -using fmt_format_overload_t = typename fmt_format_overload_traits::type; +using fmt_format_overload_t = fmt_buffered_context::iterator( + std::basic_string_view spec, fmt_buffered_context& fc) const; struct fmt_format_dispatch { template diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 775e958e..127c21bf 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,29 +1,15 @@ project(msft_proxy_tests) -include(FetchContent) -# The policy uses the download time for timestamp, instead of the timestamp in the archive. This -# allows for proper rebuilds when a projects URL changes. -if(POLICY CMP0135) - cmake_policy(SET CMP0135 NEW) -endif() - FetchContent_Declare( googletest - URL https://github.com/google/googletest/releases/download/v1.15.2/googletest-1.15.2.tar.gz - URL_HASH SHA256=7b42b4d6ed48810c5362c265a17faebe90dc2373c885e5216439d37927f02926 + URL https://github.com/google/googletest/archive/refs/tags/v1.17.0.tar.gz + URL_HASH SHA256=65fab701d9829d38cb77c14acdc431d2108bfdbf8979e40eb8ae567edf10b27c ) set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) # For Windows: Prevent overriding the parent project's compiler/linker settings set(BUILD_GMOCK OFF CACHE BOOL "" FORCE) # Disable GMock FetchContent_MakeAvailable(googletest) include(GoogleTest) -FetchContent_Declare( - fmt - URL https://github.com/fmtlib/fmt/archive/refs/tags/11.1.4.tar.gz - URL_HASH SHA256=ac366b7b4c2e9f0dde63a59b3feb5ee59b67974b14ee5dc9ea8ad78aa2c1ee1e -) -FetchContent_MakeAvailable(fmt) - add_executable(msft_proxy_tests proxy_creation_tests.cpp proxy_dispatch_tests.cpp diff --git a/tests/proxy_fmt_format_tests.cpp b/tests/proxy_fmt_format_tests.cpp index 74293f9d..10e1fb83 100644 --- a/tests/proxy_fmt_format_tests.cpp +++ b/tests/proxy_fmt_format_tests.cpp @@ -3,19 +3,8 @@ #include -#if defined(__NVCOMPILER) -#pragma diagnostic push -#pragma diag_suppress inline_gnu_noinline_conflict -#pragma diagnostic push -#pragma diag_suppress code_is_unreachable -#endif // defined(__NVCOMPILER) #include #include -#if defined(__NVCOMPILER) -#pragma diagnostic pop -#pragma diagnostic pop -#endif // defined(__NVCOMPILER) - #include #include diff --git a/tools/report_generator/CMakeLists.txt b/tools/report_generator/CMakeLists.txt index bd99f380..63eda321 100644 --- a/tools/report_generator/CMakeLists.txt +++ b/tools/report_generator/CMakeLists.txt @@ -11,8 +11,8 @@ endif() FetchContent_Declare( nlohmann_json - URL https://github.com/nlohmann/json/releases/download/v3.11.3/json.tar.xz - URL_HASH SHA256=d6c65aca6b1ed68e7a182f4757257b107ae403032760ed6ef121c9d55e81757d + URL https://github.com/nlohmann/json/archive/refs/tags/v3.12.0.tar.gz + URL_HASH SHA256=4b92eb0c06d10683f7447ce9406cb97cd4b453be18d7279320f7b2f025c10187 ) FetchContent_MakeAvailable(nlohmann_json)