jatinchowdhury18/RTNeural

<limits> std::numeric_limits include error.

rerdavies opened this issue · 4 comments

Edit:

Not such a trivia fix. The issue is in xsimd include files. xsimd has a fix for the issue. You need to update the github submodule reference to -- I'm not sure what.


An include error on g++-11 ARM AARCH64 builds.

You need to add #include <limits> somewhere appropriate. fwiw, this seems to be a recurrent problem on this platform. There has been some change to implicit std c++ includes on this platform that avoids needlessly including somewhere.

The obvious completely trivial workaround: add #include <limits> before including RTNeural/RTNeural.h.

Apologies in advance for not pushing a trivial fix myself, but I have the project checked out as a git submodule, and I'm not sure I can push the change safely.

/bin/g++-11 -DRTNEURAL_DEFAULT_ALIGNMENT=16 -DRTNEURAL_USE_XSIMD=1 -I../modules/RTNeural/RTNeural/../modules/json -I../modules/RTNeural/modules/xsimd/include -g -fPIC -std=c++17 -std=gnu++14 -MD -MT modules/RTNeural/RTNeural/CMakeFiles/RTNeural.dir/RTNeural.cpp.o -MF modules/RTNeural/RTNeural/CMakeFiles/RTNeural.dir/RTNeural.cpp.o.d -o modules/RTNeural/RTNeural/CMakeFiles/RTNeural.dir/RTNeural.cpp.o -c ../modules/RTNeural/RTNeural/RTNeural.cpp
[build] In file included from ../modules/RTNeural/modules/xsimd/include/xsimd/types/xsimd_neon_complex.hpp:25,
[build]                  from ../modules/RTNeural/modules/xsimd/include/xsimd/types/xsimd_types_include.hpp:69,
[build]                  from ../modules/RTNeural/modules/xsimd/include/xsimd/types/xsimd_traits.hpp:17,
[build]                  from ../modules/RTNeural/modules/xsimd/include/xsimd/xsimd.hpp:16,
[build]                  from ../modules/RTNeural/RTNeural/activation/../common.h:69,
[build]                  from ../modules/RTNeural/RTNeural/activation/activation_xsimd.h:4,
[build]                  from ../modules/RTNeural/RTNeural/activation/activation.h:44,
[build]                  from ../modules/RTNeural/RTNeural/Model.h:8,
[build]                  from ../modules/RTNeural/RTNeural/RTNeural.h:5,
[build]                  from ../modules/RTNeural/RTNeural/RTNeural.cpp:1:
[build] ../modules/RTNeural/modules/xsimd/include/xsimd/types/xsimd_complex_base.hpp:102:45: error: ‘numeric_limits’ is not a member of ‘std’
[build]   102 |         : std::integral_constant<bool, std::numeric_limits<std::complex<T>>::is_iec559>
[build]       |                                             ^~~~~~~~~~~~~~

Ah, thanks for catching this! I don't think I've tested with that compiler/platform combination yet.

I've been meaning to upgrade xsimd at some point, but I've been putting it off a little bit, since they made some changes to the API that will take some time to get familiar with.

I wonder if it might work to #include <limits> in an RTNeural header before including xsimd? I've made a test branch with that change if you'd like to test it out.

Ah, good call! I had tried to do that at first, but was getting an error. Must have spelled it wrong or something silly. I'll get that merged shortly.

Thanks,
Jatin