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

arm64 build error: ‘_Float16’ was not declared in this scope; did you mean ‘_Float64’? #186

Closed
benthetechguy opened this issue Jan 16, 2023 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@benthetechguy
Copy link

Environment

toml++ version and/or commit hash:
Version 3.2.0 with backported commits c8780a5 and 0a90913

Compiler:
gcc 12.2.0

C++ standard mode:
17

Target arch:
aarch64

Library configuration overrides:
None

Relevant compilation flags:
-Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/lib/python3/dist-packages/pybind11/include -I/usr/include/python3.11 -c src/encoding_decoding.cpp -o build/temp.linux-arm64-cpython-311/src/encoding_decoding.o -std=c++17

Describe the bug

I am packaging pytomlpp for Debian. It depends on @Tachi107's tomlplusplus package, which does nothing special except adding the two Float16 commits made after the last release. When I try to build the pytomlpp package on arm64, I get the error

In file included from /usr/include/toml++/toml.h:39,
                 from include/pytomlpp/pytomlpp.hpp:31,
                 from src/encoding_decoding.cpp:1:
/usr/include/toml++/impl/forward_declarations.h:630:29: error: ‘_Float16’ was not declared in this scope; did you mean ‘_Float64’?
  630 |         struct float_traits<_Float16> : float_traits_base<_Float16, __FLT16_MANT_DIG__, __FLT16_DIG__>
      |                             ^~~~~~~~
      |                             _Float64

in a few different places. My current packaging of pytomlpp is available here if that would help.

@benthetechguy benthetechguy added the bug Something isn't working label Jan 16, 2023
@marzer
Copy link
Owner

marzer commented Jan 16, 2023

Does it work if you explicitly set -DTOML_ENABLE_FLOAT16=0?

The default for this is "use the compiler settings", but that has proven to be very difficult to detect in a reliable way (compiler bugs etc.). I will probably make 0 the default in a future version.

@benthetechguy
Copy link
Author

Yes, it works if I set that option.

@marzer
Copy link
Owner

marzer commented Jan 16, 2023

Ah excellent.

@marzer marzer closed this as completed in cb1d6d7 Jan 22, 2023
marzer added a commit that referenced this issue Jan 22, 2023
marzer added a commit that referenced this issue Jan 22, 2023
@marzer
Copy link
Owner

marzer commented Jan 22, 2023

@benthetechguy I have pulled the trigger on this and removed all the 'automagic' _Float16 detection nonsense, so as of d8bb717 this should no longer be an issue. Thanks for the report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants