gap_sdk icon indicating copy to clipboard operation
gap_sdk copied to clipboard

Compile gvsoc/nntool meet a failure due to a deprecated function

Open hustc12 opened this issue 2 years ago • 0 comments

When I try to build gvsoc or nntool, the following error message pops up.

LD /home/username/1-working/gap8_sdk/build/gvsoc/models/utils/loader_impl/utils/loader_impl.o CP /home/username/1-working/gap8_sdk/build/gvsoc/models/utils/loader_impl.so CXX utils/dpi_wrapper_impl.cpp utils/dpi_wrapper_impl.cpp: In member function 'void dpi_wrapper::raise_event_from_ext()': utils/dpi_wrapper_impl.cpp:313:18: error: 'int pthread_yield()' is deprecated: pthread_yield is deprecated, use sched_yield instead [-Werror=deprecated-declarations] 313 | pthread_yield(); | ~~~~~~~~~~~~~^~ compilation terminated due to -Wfatal-errors. cc1plus: all warnings being treated as errors make[4]: *** [/home/username/1-working/gap8_sdk/install/workstation/rules/vp_models.mk:204: /home/username/1-working/gap8_sdk/build/gvsoc/models/utils/dpi_wrapper_impl/utils/dpi_wrapper_impl.o] Error 1 make[4]: Leaving directory '/home/username/1-working/gap8_sdk/gvsoc/gvsoc/models' make[3]: *** [Makefile:29: build] Error 2 make[3]: Leaving directory '/home/username/1-working/gap8_sdk/gvsoc/gvsoc' make[2]: *** [gap8/gap8.mk:152: gvsoc.build] Error 2 make[2]: Leaving directory '/home/username/1-working/gap8_sdk' make[1]: *** [gap8/gap8.mk:139: gvsoc] Error 2 make[1]: Leaving directory '/home/username/1-working/gap8_sdk' make: *** [Makefile:42: all] Error 2

After I replaced the pthread_yield() in dpi_wrapper_impl.cpp with sched_yield(), it can be successfully built.

hustc12 avatar Dec 29 '22 13:12 hustc12