XNNPACK icon indicating copy to clipboard operation
XNNPACK copied to clipboard

error: array type has incomplete element type xnn_timestamp (struct timespec branch)

Open Nick-infinity opened this issue 1 year ago • 10 comments

          Hello @alankelly @wei-v-wang , How can we fix this issue if we are sticking to ubuntu 16 & gcc 5.4.0 ? I have tried #define _POSIX_C_SOURCE 199309L as suggested by @alankelly but it doesn't work.

Originally posted by @Nick-infinity in https://github.com/google/XNNPACK/issues/2993#issuecomment-1492182354

Nick-infinity avatar Mar 31 '23 15:03 Nick-infinity

Hello @alankelly @wei-v-wang , How can we fix this issue if we are sticking to ubuntu 16 & gcc 5.4.0 ? I have tried #define _POSIX_C_SOURCE 199309L as suggested by @alankelly but it doesn't work.

Nick-infinity avatar Mar 31 '23 17:03 Nick-infinity

It looks like src/xnnpack/subgraph.{c,h} tries to use timespec from time.h, but this was something introduced in C11. Maybe if you replace CMAKE_C_STANDARD 99 with CMAKE_C_STANDARD 11 in the root CMakeLists.txt that will work? We do that when we compile PyTorch and it builds successfully in that case. This seems like a bug in the build system though that should be fixed and require C11, but I'd be interested in getting input from the project maintainers on this.

https://en.cppreference.com/w/c/chrono/timespec

gtkramer avatar Jul 25 '23 02:07 gtkramer

Though with an old compiler like GCC 5.4, support for C11 may not be complete. But give it a try?

gtkramer avatar Jul 25 '23 02:07 gtkramer

see my bitbucket: https://www.bitbucket.org/humangolem/

justzh avatar Mar 30 '24 05:03 justzh

Your issue seems to be with time. If you need help; I can help you code a time log.

justzh avatar Mar 30 '24 05:03 justzh

This issue seems to be resolved. Please close this issue.

justzh avatar Mar 30 '24 12:03 justzh

Because the right way to do things is usually the first way.

justzh avatar Mar 30 '24 13:03 justzh

Though with an old compiler like GCC 5.4, support for C11 may not be complete. But give it a try?

Shouldn't we be using g++ (the latest version)? Do not give C11 a try nor the other thing.

justzh avatar Mar 30 '24 13:03 justzh

Oh wait, let me re-read the problem.

justzh avatar Mar 30 '24 13:03 justzh

This is not me, lol. You can just write the title as "Is this Justin Zhang?" next time, lol. Issue resolved. Please, close.

justzh avatar Mar 30 '24 13:03 justzh