jatinchowdhury18 / RTNeural

Real-time neural network inferencing
BSD 3-Clause "New" or "Revised" License
551 stars 57 forks source link

<limits> std::numeric_limits include error. #47

Closed rerdavies closed 2 years ago

rerdavies commented 2 years ago

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]       |                                             ^~~~~~~~~~~~~~
jatinchowdhury18 commented 2 years ago

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.

rerdavies commented 2 years ago

A better fix (which works) is to use

include

instead of

include

in the same place, which (I think) will allow you to turn the deprecated header warning back on again.

Regards,

Robin Davies.

On Wed, Feb 16, 2022 at 4:23 AM jatinchowdhury18 @.***> wrote:

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 in an RTNeural header before including xsimd? I've made a test branch https://github.com/jatinchowdhury18/RTNeural/compare/include-limits-fix with that change if you'd like to test it out.

— Reply to this email directly, view it on GitHub https://github.com/jatinchowdhury18/RTNeural/issues/47#issuecomment-1041281408, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACXK2DC7RXM64S3GEIA66DTU3NUHLANCNFSM5OPTUTGA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you authored the thread.Message ID: @.***>

jatinchowdhury18 commented 2 years ago

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

rerdavies commented 2 years ago

Thank you for the prompt turnaround.

On Wed, Feb 16, 2022 at 11:53 AM jatinchowdhury18 @.***> wrote:

Closed #47 https://github.com/jatinchowdhury18/RTNeural/issues/47 via

49 https://github.com/jatinchowdhury18/RTNeural/pull/49.

— Reply to this email directly, view it on GitHub https://github.com/jatinchowdhury18/RTNeural/issues/47#event-6084325708, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACXK2DHQ4AG2OY3RQE4N273U3PJBTANCNFSM5OPTUTGA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you authored the thread.Message ID: @.***>