Skip to content

Commit

Permalink
fix(barretenberg): brittle headers caused error compiling for clang-1…
Browse files Browse the repository at this point in the history
…6 on mainframe (#2547)

Compilation failure (error below).

If I move the `#include <cstdint>` 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<uint64_t>(a >> 64) << std::setw(16)
```
  • Loading branch information
dbanks12 authored Sep 27, 2023
1 parent 974b037 commit cc909da
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions barretenberg/cpp/src/barretenberg/bb/exec_pipe.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#pragma once
#include <cstdint>
#include <cstdio>
#include <iostream>
#include <vector>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#pragma once
#include <cstdint>
#include <iomanip>
#include <ostream>

#ifdef __i386__
#include "barretenberg/common/serialize.hpp"
#include <cstdint>

namespace numeric {

Expand Down

0 comments on commit cc909da

Please sign in to comment.