Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Build on stock apple clang. #592

Merged
merged 4 commits into from
Jul 11, 2023
Merged

fix: Build on stock apple clang. #592

merged 4 commits into from
Jul 11, 2023

Conversation

charlielye
Copy link
Contributor

Description

As title.

Checklist:

  • I have reviewed my diff in github, line by line.
  • Every change is related to the PR description.
  • The branch has been merged with/rebased against the head of its merge target.
  • There are no unexpected formatting changes, superfluous debug logs, or commented-out code.
  • There are no circuit changes, OR a cryptographer has been assigned for review.
  • New functions, classes, etc. have been documented according to the doxygen comment format. Classes and structs must have @brief describing the intended functionality.
  • If existing code has been modified, such documentation has been added or updated.
  • No superfluous include directives have been added.
  • I have linked to any issue(s) it resolves.
  • I'm happy for the PR to be merged at the reviewer's next convenience.

@kevaundray
Copy link
Contributor

For context:

Apple Clang version 14.0.0 was not able to compile the current barretenberg due to libc++ not having the methods on std::span that barretenberg were calling. It works on libstdc++ which implies that there is a discrepancy between libstdc++ and libc++ for this feature (understandable because its quite new).

Note: It does work on Apple Clang version 14.0.3.

Snippet of the error:

[49/140] Building CXX object src/barretenberg/polynomials/CMakeFiles/polynomials_objects.dir/polynomial.cpp.o
[157](https://github.com/crate-crypto/bb-test-me-out/actions/runs/5518686540/jobs/10062978813#step:5:158)
FAILED: src/barretenberg/polynomials/CMakeFiles/polynomials_objects.dir/polynomial.cpp.o 
[158](https://github.com/crate-crypto/bb-test-me-out/actions/runs/5518686540/jobs/10062978813#step:5:159)
/Applications/Xcode_14.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -DNO_OMP_MULTITHREADING -DNO_TBB -I/Users/runner/work/bb-test-me-out/bb-test-me-out/cpp/src -I/Users/runner/work/bb-test-me-out/bb-test-me-out/cpp/src/msgpack-c/include -std=gnu++20 -isysroot /Applications/Xcode_14.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk -mmacosx-version-min=12.6 -O3 -pthread -Werror -Wall -Wextra -Wconversion -Wsign-conversion -Wfatal-errors -fcolor-diagnostics -fconstexpr-steps=100000000 -MD -MT src/barretenberg/polynomials/CMakeFiles/polynomials_objects.dir/polynomial.cpp.o -MF src/barretenberg/polynomials/CMakeFiles/polynomials_objects.dir/polynomial.cpp.o.d -o src/barretenberg/polynomials/CMakeFiles/polynomials_objects.dir/polynomial.cpp.o -c /Users/runner/work/bb-test-me-out/bb-test-me-out/cpp/src/barretenberg/polynomials/polynomial.cpp
[159](https://github.com/crate-crypto/bb-test-me-out/actions/runs/5518686540/jobs/10062978813#step:5:160)
In file included from /Users/runner/work/bb-test-me-out/bb-test-me-out/cpp/src/barretenberg/polynomials/polynomial.cpp:1:
[160](https://github.com/crate-crypto/bb-test-me-out/actions/runs/5518686540/jobs/10062978813#step:5:161)
/Users/runner/work/bb-test-me-out/bb-test-me-out/cpp/src/barretenberg/polynomials/polynomial.hpp:199:88: fatal error: no matching constructor for initialization of 'std::span<field<Bn254FrParams>, 18446744073709551615>' (aka 'std::span<barretenberg::field<barretenberg::Bn254FrParams>, 18446744073709551615>')
[161](https://github.com/crate-crypto/bb-test-me-out/actions/runs/5518686540/jobs/10062978813#step:5:162)
    void factor_roots(std::span<const Fr> roots) { polynomial_arithmetic::factor_roots(std::span{ *this }, roots); };
[162](https://github.com/crate-crypto/bb-test-me-out/actions/runs/5518686540/jobs/10062978813#step:5:163)
                                                                                       ^        ~~~~~~~~~
[163](https://github.com/crate-crypto/bb-test-me-out/actions/runs/5518686540/jobs/10062978813#step:5:164)
/Users/runner/work/bb-test-me-out/bb-test-me-out/cpp/src/barretenberg/polynomials/polynomial.cpp:349:16: note: in instantiation of member function 'barretenberg::Polynomial<barretenberg::field<barretenberg::Bn254FrParams>>::factor_roots' requested here
[164](https://github.com/crate-crypto/bb-test-me-out/actions/runs/5518686540/jobs/10062978813#step:5:165)
template class Polynomial<barretenberg::fr>;
[165](https://github.com/crate-crypto/bb-test-me-out/actions/runs/5518686540/jobs/10062978813#step:5:166)
               ^
[166](https://github.com/crate-crypto/bb-test-me-out/actions/runs/5518686540/jobs/10062978813#step:5:167)
/Applications/Xcode_14.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/c++/v1/span:402:15: note: candidate constructor not viable: no known conversion from 'barretenberg::Polynomial<barretenberg::fr>' to 'const std::span<barretenberg::field<barretenberg::Bn254FrParams>, 18446744073709551615>' for 1st argument
[167](https://github.com/crate-crypto/bb-test-me-out/actions/runs/5518686540/jobs/10062978813#step:5:168)
    constexpr span           (const span&) noexcept = default;
[168](https://github.com/crate-crypto/bb-test-me-out/actions/runs/5518686540/jobs/10062978813#step:5:169)
              ^
[169](https://github.com/crate-crypto/bb-test-me-out/actions/runs/5518686540/jobs/10062978813#step:5:170)
/Applications/Xcode_14.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/c++/v1/span:410:15: note: candidate template ignored: could not match 'std::span<barretenberg::field<barretenberg::Bn254FrParams>, 18446744073709551615>::element_type[_Sz]' against 'barretenberg::Polynomial<barretenberg::fr>'
[170](https://github.com/crate-crypto/bb-test-me-out/actions/runs/5518686540/jobs/10062978813#step:5:171)
    constexpr span(element_type (&__arr)[_Sz])          noexcept : __data{__arr}, __size{_Sz} {}
[171](https://github.com/crate-crypto/bb-test-me-out/actions/runs/5518686540/jobs/10062978813#step:5:172)
              ^
[172](https://github.com/crate-crypto/bb-test-me-out/actions/runs/5518686540/jobs/10062978813#step:5:173)
/Applications/Xcode_14.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/c++/v1/span:415:15: note: candidate template ignored: could not match 'array' against 'Polynomial'
[173](https://github.com/crate-crypto/bb-test-me-out/actions/runs/5518686540/jobs/10062978813#step:5:174)
    constexpr span(array<_OtherElementType, _Sz>& __arr) noexcept : __data{__arr.data()}, __size{_Sz} {}
[174](https://github.com/crate-crypto/bb-test-me-out/actions/runs/5518686540/jobs/10062978813#step:5:175)
              ^
[175](https://github.com/crate-crypto/bb-test-me-out/actions/runs/5518686540/jobs/10062978813#step:5:176)
/Applications/Xcode_14.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/c++/v1/span:420:15: note: candidate template ignored: could not match 'array' against 'Polynomial'
[176](https://github.com/crate-crypto/bb-test-me-out/actions/runs/5518686540/jobs/10062978813#step:5:177)
    constexpr span(const array<_OtherElementType, _Sz>& __arr) noexcept : __data{__arr.data()}, __size{_Sz} {}
[177](https://github.com/crate-crypto/bb-test-me-out/actions/runs/5518686540/jobs/10062978813#step:5:178)
              ^
[178](https://github.com/crate-crypto/bb-test-me-out/actions/runs/5518686540/jobs/10062978813#step:5:179)
/Applications/Xcode_14.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/c++/v1/span:424:19: note: candidate template ignored: requirement '__is_span_compatible_container<barretenberg::Polynomial<barretenberg::field<barretenberg::Bn254FrParams>>, barretenberg::field<barretenberg::Bn254FrParams>, void>::value' was not satisfied [with _Container = barretenberg::Polynomial<barretenberg::fr>]
[179](https://github.com/crate-crypto/bb-test-me-out/actions/runs/5518686540/jobs/10062978813#step:5:180)
        constexpr span(      _Container& __c,
[180](https://github.com/crate-crypto/bb-test-me-out/actions/runs/5518686540/jobs/10062978813#step:5:181)
                  ^

@charlielye charlielye merged commit 0ac4bc3 into master Jul 11, 2023
@charlielye charlielye deleted the cl/stock_apple_clang branch July 11, 2023 12:08
ludamad pushed a commit to AztecProtocol/aztec-packages that referenced this pull request Jul 22, 2023
ludamad pushed a commit to AztecProtocol/aztec-packages that referenced this pull request Jul 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants