Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .github/workflows/bvt-clang.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/bvt-compatibility.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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: |
Expand All @@ -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
Expand Down
14 changes: 8 additions & 6 deletions .github/workflows/bvt-gcc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/bvt-nvhpc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ jobs:
- name: free disk space
uses: jlumbroso/[email protected]

- 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
Expand Down
16 changes: 16 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
11 changes: 2 additions & 9 deletions benchmarks/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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")
Expand Down
1 change: 1 addition & 0 deletions cmake/msft_proxy4ModuleTargets.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
$<$<CXX_COMPILER_ID:MSVC>:/utf-8>
$<$<CXX_COMPILER_ID:Clang>:-Wno-c++2b-extensions>
)
target_link_libraries(msft_proxy4_module PUBLIC msft_proxy4::proxy)
7 changes: 0 additions & 7 deletions docs/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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")
Expand Down
2 changes: 1 addition & 1 deletion include/proxy/v4/proxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -2456,7 +2456,7 @@ struct operator_dispatch;
#define PROD_DEF_RHS_ASSIGNMENT_OP_ACCESSOR(oq, pq, ne, ...) \
template <class P, class D, class R, class Arg> \
struct accessor<P, D, R(Arg&) oq ne> { \
friend Arg& operator __VA_ARGS__(Arg & arg, P pq self) ne { \
friend Arg& operator __VA_ARGS__(Arg& arg, P pq self) ne { \
proxy_invoke<D, R(Arg&) oq ne>(static_cast<P pq>(self), arg); \
return arg; \
} \
Expand Down
26 changes: 10 additions & 16 deletions include/proxy/v4/proxy_fmt.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<wchar_t>::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 <class CharT>
struct fmt_format_overload_traits;
template <>
struct fmt_format_overload_traits<char>
: std::type_identity<fmt::format_context::iterator(
std::string_view spec, fmt::format_context& fc) const> {};
template <>
struct fmt_format_overload_traits<wchar_t>
: std::type_identity<fmt::wformat_context::iterator(
std::wstring_view spec, fmt::wformat_context& fc) const> {};
#if FMT_VERSION >= 110000
using fmt_buffered_context = fmt::buffered_context<CharT>;
#else
using fmt_buffered_context = fmt::buffer_context<CharT>;
#endif // FMT_VERSION

template <class CharT>
using fmt_format_overload_t = typename fmt_format_overload_traits<CharT>::type;
using fmt_format_overload_t = fmt_buffered_context<CharT>::iterator(
std::basic_string_view<CharT> spec, fmt_buffered_context<CharT>& fc) const;

struct fmt_format_dispatch {
template <class T, class CharT, class FormatContext>
Expand Down
18 changes: 2 additions & 16 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down
11 changes: 0 additions & 11 deletions tests/proxy_fmt_format_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,8 @@

#include <gtest/gtest.h>

#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 <fmt/format.h>
#include <fmt/xchar.h>
#if defined(__NVCOMPILER)
#pragma diagnostic pop
#pragma diagnostic pop
#endif // defined(__NVCOMPILER)

#include <proxy/proxy.h>
#include <proxy/proxy_fmt.h>

Expand Down
4 changes: 2 additions & 2 deletions tools/report_generator/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down