From cc909da0464003aee6d2ff4036ba59c321a5b617 Mon Sep 17 00:00:00 2001 From: David Banks <47112877+dbanks12@users.noreply.github.com> Date: Tue, 26 Sep 2023 20:58:27 -0400 Subject: [PATCH] fix(barretenberg): brittle headers caused error compiling for clang-16 on mainframe (#2547) Compilation failure (error below). If I move the `#include ` outside of the `#ifdef` in `uint128.hpp` and add that include to `exec_pipe.hpp`, compilation works. ``` Preset environment variables: CC="clang-16" CMAKE_EXPORT_COMPILE_COMMANDS="ON" CXX="clang++-16" -- The CXX compiler identification is Clang 16.0.4 -- The C compiler identification is Clang 16.0.4 ... ... [24/448] Building CXX object src/barretenberg/numeric/CMakeFiles/numeric_bench_objects.dir/bitop/bitop.bench.cpp.o FAILED: src/barretenberg/numeric/CMakeFiles/numeric_bench_objects.dir/bitop/bitop.bench.cpp.o /usr/bin/clang++-16 -DBENCHMARK_STATIC_DEFINE -DNO_OMP_MULTITHREADING -DNO_TBB -I/mnt/user-data/david/projects/3-aztec3/aztec-packages-hash/barretenberg/cpp/src -I/mnt/user-data/david/projects/3-aztec3/aztec-packages-hash/barretenberg/cpp/src/msgpack-c/include -I/mnt/user-data/david/projects/3-aztec3/aztec-packages-hash/barretenberg/cpp/build/_deps/benchmark-src/include -O3 -DNDEBUG -march=skylake -pthread -Werror -Wall -Wextra -Wconversion -Wsign-conversion -Wfatal-errors -fcolor-diagnostics -fconstexpr-steps=100000000 -std=gnu++20 -MD -MT src/barretenberg/numeric/CMakeFiles/numeric_bench_objects.dir/bitop/bitop.bench.cpp.o -MF src/barretenberg/numeric/CMakeFiles/numeric_bench_objects.dir/bitop/bitop.bench.cpp.o.d -o src/barretenberg/numeric/CMakeFiles/numeric_bench_objects.dir/bitop/bitop.bench.cpp.o -c /mnt/user-data/david/projects/3-aztec3/aztec-packages-hash/barretenberg/cpp/src/barretenberg/numeric/bitop/bitop.bench.cpp In file included from /mnt/user-data/david/projects/3-aztec3/aztec-packages-hash/barretenberg/cpp/src/barretenberg/numeric/bitop/bitop.bench.cpp:1: In file included from /mnt/user-data/david/projects/3-aztec3/aztec-packages-hash/barretenberg/cpp/src/barretenberg/numeric/bitop/count_leading_zeros.hpp:2: /mnt/user-data/david/projects/3-aztec3/aztec-packages-hash/barretenberg/cpp/src/barretenberg/numeric/bitop/../uint128/uint128.hpp:205:81: fatal error: unknown type name 'uint64_t' os << std::hex << "0x" << std::setfill('0') << std::setw(16) << static_cast(a >> 64) << std::setw(16) ``` --- barretenberg/cpp/src/barretenberg/bb/exec_pipe.hpp | 1 + barretenberg/cpp/src/barretenberg/numeric/uint128/uint128.hpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/barretenberg/cpp/src/barretenberg/bb/exec_pipe.hpp b/barretenberg/cpp/src/barretenberg/bb/exec_pipe.hpp index 945901a8107..5ab7fcab34b 100644 --- a/barretenberg/cpp/src/barretenberg/bb/exec_pipe.hpp +++ b/barretenberg/cpp/src/barretenberg/bb/exec_pipe.hpp @@ -1,4 +1,5 @@ #pragma once +#include #include #include #include diff --git a/barretenberg/cpp/src/barretenberg/numeric/uint128/uint128.hpp b/barretenberg/cpp/src/barretenberg/numeric/uint128/uint128.hpp index fc0410b647d..3dc320abe2d 100644 --- a/barretenberg/cpp/src/barretenberg/numeric/uint128/uint128.hpp +++ b/barretenberg/cpp/src/barretenberg/numeric/uint128/uint128.hpp @@ -1,10 +1,10 @@ #pragma once +#include #include #include #ifdef __i386__ #include "barretenberg/common/serialize.hpp" -#include namespace numeric {