cardboardcode / epd_core

A ROS2 package that accelerates the training and deployment of CV models for industries.
Apache License 2.0
0 stars 0 forks source link

Unable to install onnxruntime on Ubuntu 22.04 #7

Closed cardboardcode closed 2 years ago

cardboardcode commented 2 years ago

Issue Description

The following error is generated when running bash install_dep_cpu.bash in an attempt to install EPD dependencies:

[ 72%] Built target onnxruntime
Consolidate compiler generated dependencies of target onnxruntime_test_utils
[ 73%] Built target onnxruntime_test_utils
Consolidate compiler generated dependencies of target onnx_test_data_proto
[ 75%] Built target onnx_test_data_proto
Consolidate compiler generated dependencies of target onnx_test_runner_common
[ 76%] Built target onnx_test_runner_common
Consolidate compiler generated dependencies of target gtest
[ 76%] Built target gtest
Consolidate compiler generated dependencies of target gmock
[ 76%] Built target gmock
Consolidate compiler generated dependencies of target onnxruntime_test_all
[ 76%] Building CXX object CMakeFiles/onnxruntime_test_all.dir/home/rosi/onnxruntime/onnxruntime/test/providers/cpu/controlflow/loop_test.cc.o
/home/rosi/onnxruntime/onnxruntime/test/providers/cpu/controlflow/loop_test.cc: In lambda function:
/home/rosi/onnxruntime/onnxruntime/test/providers/cpu/controlflow/loop_test.cc:557:23: error: \u2018sleep_for\u2019 is not a member of \u2018std::this_thread\u2019
  557 |     std::this_thread::sleep_for(std::chrono::seconds(3));
      |                       ^~~~~~~~~
make[2]: *** [CMakeFiles/onnxruntime_test_all.dir/build.make:1420: CMakeFiles/onnxruntime_test_all.dir/home/rosi/onnxruntime/onnxruntime/test/providers/cpu/controlflow/loop_test.cc.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:680: CMakeFiles/onnxruntime_test_all.dir/all] Error 2
make: *** [Makefile:146: all] Error 2
Uninstall with cat install_manifest.txt | sudo xargs rm

Source of Error

For now, the source of error can be narrowed down to a potential discrepancy in the CPP library where std::thread is different. This could be solved by using a more recent version of onnxruntime or downgrading the cmake.

sleep_for is not a member of std::this_thread
cardboardcode commented 2 years ago

The onnxruntime EPD still currently depends on is 1.4.0.

cardboardcode commented 2 years ago

Solution :partying_face:

To resolve this, an simple edit in the onnxruntime installation folder needs to be done (strangely):

nano ~/onnxruntime/onnxruntime/test/providers/cpu/controlflow/loop_test.cc

Include #include<thread> into ~/onnxruntime/onnxruntime/test/providers/cpu/controlflow/loop_test.cc

References

Screenshot from 2022-08-02 20-56-44

https://stackoverflow.com/questions/12523122/what-is-glibcxx-use-nanosleep-all-about