microsoft / onnxruntime

ONNX Runtime: cross-platform, high performance ML inferencing and training accelerator
https://onnxruntime.ai
MIT License
14.56k stars 2.92k forks source link

Unable to compile ONNX Runtime on Linux 32-bit ARM #12650

Closed AnatoliyZabrovskiy closed 2 years ago

AnatoliyZabrovskiy commented 2 years ago

Describe the bug Unable to compile ONNX runtime on 32-bit ARM (Linux pcm52-sn20000364000024 4.19.152-rt66-00264-gd266199, armv7l GNU/Linux).

Urgency None

System information

To Reproduce I tried to compile onnxruntime using CROSS COMPILING ON LINUX (https://onnxruntime.ai/docs/build/inferencing.html#cross-compiling-on-linux) (1) First, I prepared the file tool.cmake which is used as one of the input parameters for cmake. It includes the following lines: SET(CMAKE_SYSTEM_NAME Linux) SET(CMAKE_SYSTEM_VERSION 1) SET(CMAKE_C_COMPILER arm-cortexa7hft-linux-gnueabi-gcc) SET(CMAKE_CXX_COMPILER arm-cortexa7hft-linux-gnueabi-g++) SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) SET(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)

(2) I then ran the following commands: $ git clone https://github.com/Microsoft/onnxruntime $ wget https://github.com/protocolbuffers/protobuf/releases/download/v3.18.2/protoc-3.18.2-linux-x86_64.zip $ unzip protoc-3.18.2-linux-x86_64.zip -d ./protoc-3.18.2 $ cd ./onnxruntime/cmake/ $ cmake -DONNX_CUSTOM_PROTOC_EXECUTABLE=/home/TESTS/onnx-runtime-arm/protoc-3.18.2/bin/protoc -DCMAKE_TOOLCHAIN_FILE=/home/TESTS/onnx-runtime-arm/tool.cmake > cmake_output.txt 2>&1 $ make > make_output.txt 2>&1

(3) I have also tried various versions of the protoc program and played around a bit with other options. In the attached archive you can find the output for cmake and make when I use protoc version 3.18.2. With any options I've tried, the compilation process shows some errors.

Expected behavior Compiled ONNX Runtime for the ARM 32-bit processor.

Screenshots

Additional context Cmake and make output are attached to the issue.


-----------CMAKE Output----------

CMake Warning: No source or binary directory provided. Both will be assumed to be the same as the current working directory, but note that this warning will become a fatal error in future CMake releases.

-- The C compiler identification is GNU 6.3.0 -- The CXX compiler identification is GNU 6.3.0 -- The ASM compiler identification is GNU -- Found assembler: /usr/bin/arm-cortexa7hft-linux-gnueabi-gcc -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /usr/bin/arm-cortexa7hft-linux-gnueabi-gcc - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /usr/bin/arm-cortexa7hft-linux-gnueabi-g++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Build type not set - using RelWithDebInfo Building ONNX Runtime for -- Performing Test onnxruntime_HAVE_BUILTIN_ATOMICS -- Performing Test onnxruntime_HAVE_BUILTIN_ATOMICS - Success -- Performing Test HAS_NOERROR -- Performing Test HAS_NOERROR - Success -- Performing Test CMAKE_HAVE_LIBC_PTHREAD -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed -- Looking for pthread_create in pthreads -- Looking for pthread_create in pthreads - not found -- Looking for pthread_create in pthread -- Looking for pthread_create in pthread - found -- Found Threads: TRUE
-- Found Patch: /usr/bin/patch
Patch found: /usr/bin/patch -- Performing Test COMPILER_SUPPORT_MF16C -- Performing Test COMPILER_SUPPORT_MF16C - Failed F16C instruction set is not supported. -- Performing Test COMPILER_SUPPORT_FMA -- Performing Test COMPILER_SUPPORT_FMA - Failed FMA instruction set is not supported. -- Performing Test COMPILER_SUPPORT_AVX -- Performing Test COMPILER_SUPPORT_AVX - Failed AVX instruction set is not supported. One or more AVX/F16C instruction flags are not supported. Use gtest from submodule -- Found Python: /usr/bin/python3.8 (found version "3.8.10") found components: Interpreter Doing crosscompiling Use nsync from submodule Use protobuf from submodule -- -- 3.18.1.0 -- Found ZLIB: /usr/share/pcm52/v3.0.5.0/deif/arm-cortexa7hft-linux-gnueabi/sysroot/usr/lib/libz.so (found version "1.2.8") -- Performing Test protobuf_HAVE_BUILTIN_ATOMICS -- Performing Test protobuf_HAVE_BUILTIN_ATOMICS - Success Use date from submodule

date: USE_SYSTEM_TZ_DB ON

date: USE_TZ_DB_IN_DOT OFF

date: BUILD_SHARED_LIBS OFF

date: ENABLE_DATE_TESTING OFF

Use mp11 from submodule Use json from submodule -- Using the single-header code from /home/TESTS/onnx-runtime-arm/onnxruntime/cmake/external/json/single_include/ Use re2 from submodule -- Check if compiler accepts -pthread -- Check if compiler accepts -pthread - yes Use cpuinfo from submodule CMake Warning at external/pytorch_cpuinfo/CMakeLists.txt:59 (MESSAGE): Target processor architecture is not specified. cpuinfo will compile, but cpuinfo_initialize() will always fail.

-- Performing Test HAS_UNUSED_BUT_SET_PARAMETER -- Performing Test HAS_UNUSED_BUT_SET_PARAMETER - Success -- Performing Test HAS_UNUSED_BUT_SET_VARIABLE -- Performing Test HAS_UNUSED_BUT_SET_VARIABLE - Success -- Performing Test HAS_UNUSED_VARIABLE -- Performing Test HAS_UNUSED_VARIABLE - Success -- Performing Test HAS_CAST_FUNCTION_TYPE -- Performing Test HAS_CAST_FUNCTION_TYPE - Failed -- Performing Test HAS_PARENTHESES -- Performing Test HAS_PARENTHESES - Success -- Performing Test HAS_USELESS_CAST -- Performing Test HAS_USELESS_CAST - Success -- Performing Test HAS_NONNULL_COMPARE -- Performing Test HAS_NONNULL_COMPARE - Success -- Performing Test HAS_TAUTOLOGICAL_POINTER_COMPARE -- Performing Test HAS_TAUTOLOGICAL_POINTER_COMPARE - Failed -- Performing Test HAS_CATCH_VALUE -- Performing Test HAS_CATCH_VALUE - Failed -- Performing Test HAS_MISSING_BRACES -- Performing Test HAS_MISSING_BRACES - Success -- Performing Test HAS_IGNORED_ATTRIBUTES -- Performing Test HAS_IGNORED_ATTRIBUTES - Success -- Performing Test HAS_DEPRECATED_COPY -- Performing Test HAS_DEPRECATED_COPY - Failed -- Performing Test HAS_DEPRECATED_DECLARATIONS -- Performing Test HAS_DEPRECATED_DECLARATIONS - Success -- Performing Test HAS_CLASS_MEMACCESS -- Performing Test HAS_CLASS_MEMACCESS - Failed -- Performing Test HAS_MAYBE_UNINITIALIZED -- Performing Test HAS_MAYBE_UNINITIALIZED - Success -- Performing Test HAS_STRICT_ALIASING -- Performing Test HAS_STRICT_ALIASING - Success NVCC_ERROR = NVCC_OUT = No such file or directory -- Performing Test HAS_AMBIGUOUS_REVERSED_OPERATOR -- Performing Test HAS_AMBIGUOUS_REVERSED_OPERATOR - Failed -- Performing Test HAS_DEPRECATED_ANON_ENUM_ENUM_CONVERSION -- Performing Test HAS_DEPRECATED_ANON_ENUM_ENUM_CONVERSION - Failed -- Performing Test HAS_UNDEFINED_VAR_TEMPLATE -- Performing Test HAS_UNDEFINED_VAR_TEMPLATE - Failed -- Performing Test HAS_FORMAT_TRUNCATION -- Performing Test HAS_FORMAT_TRUNCATION - Failed -- Performing Test HAS_BITWISE_INSTEAD_OF_LOGICAL -- Performing Test HAS_BITWISE_INSTEAD_OF_LOGICAL - Failed -- Found PythonInterp: /usr/bin/python3.8 (found version "3.8.10") -- Could NOT find PythonLibs (missing: PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS) -- Using custom protoc executable Generated: /home/TESTS/onnx-runtime-arm/onnxruntime/cmake/external/onnx/onnx/onnx-ml.proto Generated: /home/TESTS/onnx-runtime-arm/onnxruntime/cmake/external/onnx/onnx/onnx-operators-ml.proto Generated: /home/TESTS/onnx-runtime-arm/onnxruntime/cmake/external/onnx/onnx/onnx-data.proto -- -- **** Summary **** -- CMake version : 3.24.0-rc1 -- CMake command : /opt/cmake-3.24.0-rc1-linux-x86_64/bin/cmake -- System : Linux -- C++ compiler : /usr/bin/arm-cortexa7hft-linux-gnueabi-g++ -- C++ compiler version : 6.3.0 -- CXX flags : -ffunction-sections -fdata-sections -Wno-error=attributes -DCPUINFO_SUPPORTED -Wnon-virtual-dtor -- Build type : RelWithDebInfo -- Compile definitions : ORT_NO_RTTI;EIGEN_MPL2_ONLY;PLATFORM_POSIX;__STDC_FORMAT_MACROS -- CMAKE_PREFIX_PATH : -- CMAKE_INSTALL_PREFIX : /usr/local -- CMAKE_MODULE_PATH : /home/TESTS/onnx-runtime-arm/onnxruntime/cmake/external -- -- ONNX version : 1.12.0 -- ONNX NAMESPACE : onnx -- ONNX_USE_LITE_PROTO : ON -- USE_PROTOBUF_SHARED_LIBS : OFF -- Protobuf_USE_STATIC_LIBS : ON -- ONNX_DISABLE_EXCEPTIONS : OFF -- ONNX_WERROR : OFF -- ONNX_BUILD_TESTS : OFF -- ONNX_BUILD_BENCHMARKS : OFF -- ONNXIFI_DUMMY_BACKEND : OFF -- ONNXIFI_ENABLE_EXT : OFF -- -- Protobuf compiler : -- Protobuf includes : -- Protobuf libraries : -- BUILD_ONNX_PYTHON : OFF Use flatbuffers from submodule -- Looking for strtof_l -- Looking for strtof_l - found -- Looking for strtoull_l -- Looking for strtoull_l - found -- Using toolchain file: /home/TESTS/onnx-runtime-arm/tool.cmake. CMake Warning (dev) at /opt/cmake-3.24.0-rc1-linux-x86_64/share/cmake-3.24/Modules/FetchContent.cmake:1237 (message): The DOWNLOAD_EXTRACT_TIMESTAMP option was not given and policy CMP0135 is not set. The policy's OLD behavior will be used. When using a URL download, the timestamps of extracted files should preferably be that of the time of extraction, otherwise code that depends on the extracted contents might not be rebuilt if the URL changes. The OLD behavior preserves the timestamps from the archive instead, but this is usually not what you want. Update your project to the NEW behavior or specify the DOWNLOAD_EXTRACT_TIMESTAMP option with a value of true to avoid this robustness issue. Call Stack (most recent call first): external/abseil-cpp.cmake:16 (FetchContent_Declare) onnxruntime_common.cmake:112 (include) CMakeLists.txt:1992 (include) This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning at _deps/abseil_cpp-src/absl/copts/AbseilConfigureCopts.cmake:30 (message): Value of CMAKE_SYSTEM_PROCESSOR () is unknown and cannot be used to set ABSL_RANDOM_RANDEN_COPTS Call Stack (most recent call first): _deps/abseil_cpp-src/CMake/AbseilHelpers.cmake:18 (include) _deps/abseil_cpp-src/CMakeLists.txt:85 (include)

-- Looking for clock_gettime in rt -- Looking for clock_gettime in rt - found -- Configuring done -- Generating done -- Build files have been written to: /home/TESTS/onnx-runtime-arm/onnxruntime/cmake


------------MAKE Output-----------

[ 1%] Building CXX object external/flatbuffers/CMakeFiles/flatbuffers.dir/src/idl_parser.cpp.o [ 1%] Building CXX object external/flatbuffers/CMakeFiles/flatbuffers.dir/src/idl_gen_text.cpp.o [ 1%] Building CXX object external/flatbuffers/CMakeFiles/flatbuffers.dir/src/reflection.cpp.o [ 1%] Building CXX object external/flatbuffers/CMakeFiles/flatbuffers.dir/src/util.cpp.o [ 1%] Linking CXX static library libflatbuffers.a [ 1%] Built target flatbuffers [ 1%] Building C object external/pytorch_cpuinfo/deps/clog/CMakeFiles/clog.dir/src/clog.c.o [ 1%] Linking C static library libclog.a [ 1%] Built target clog [ 1%] Building C object external/pytorch_cpuinfo/CMakeFiles/cpuinfo.dir/src/init.c.o [ 1%] Building C object external/pytorch_cpuinfo/CMakeFiles/cpuinfo.dir/src/api.c.o In file included from /home/TESTS/onnx-runtime-arm/onnxruntime/cmake/external/pytorch_cpuinfo/src/cpuinfo/internal-api.h:11:0, from /home/TESTS/onnx-runtime-arm/onnxruntime/cmake/external/pytorch_cpuinfo/src/api.c:5: /home/TESTS/onnx-runtime-arm/onnxruntime/cmake/external/pytorch_cpuinfo/src/api.c: In function 'cpuinfo_get_current_processor': /home/TESTS/onnx-runtime-arm/onnxruntime/cmake/external/pytorch_cpuinfo/src/api.c:319:23: warning: implicit declaration of function 'syscall' [-Wimplicit-function-declaration] if CPUINFO_UNLIKELY(syscall(__NR_getcpu, &cpu, NULL, NULL) != 0) { ^ /home/TESTS/onnx-runtime-arm/onnxruntime/cmake/external/pytorch_cpuinfo/src/cpuinfo/common.h:16:59: note: in definition of macro 'CPUINFO_UNLIKELY'

define CPUINFO_UNLIKELY(condition) (__builtin_expect(!!(condition), 0))

                                                       ^~~~~~~~~

[ 1%] Building C object external/pytorch_cpuinfo/CMakeFiles/cpuinfo.dir/src/cache.c.o [ 1%] Linking C static library libcpuinfo.a [ 1%] Built target cpuinfo [ 1%] Running C++ protocol buffer compiler on /home/TESTS/onnx-runtime-arm/onnxruntime/cmake/external/onnx/onnx/onnx-ml.proto [ 1%] Built target gen_onnx_proto [ 1%] Running C++ protocol buffer compiler on /home/TESTS/onnx-runtime-arm/onnxruntime/cmake/external/onnx/onnx/onnx-data.proto [ 1%] Built target gen_onnx_data_proto [ 2%] Building CXX object external/protobuf/cmake/CMakeFiles/libprotobuf-lite.dir//src/google/protobuf/any_lite.cc.o [ 2%] Building CXX object external/protobuf/cmake/CMakeFiles/libprotobuf-lite.dir//src/google/protobuf/arena.cc.o [ 2%] Building CXX object external/protobuf/cmake/CMakeFiles/libprotobuf-lite.dir//src/google/protobuf/arenastring.cc.o [ 2%] Building CXX object external/protobuf/cmake/CMakeFiles/libprotobuf-lite.dir/__/src/google/protobuf/extension_set.cc.o [ 2%] Building CXX object external/protobuf/cmake/CMakeFiles/libprotobuf-lite.dir//src/google/protobuf/generated_enum_util.cc.o [ 2%] Building CXX object external/protobuf/cmake/CMakeFiles/libprotobuf-lite.dir//src/google/protobuf/generated_message_table_driven_lite.cc.o [ 2%] Building CXX object external/protobuf/cmake/CMakeFiles/libprotobuf-lite.dir//src/google/protobuf/generated_message_util.cc.o [ 2%] Building CXX object external/protobuf/cmake/CMakeFiles/libprotobuf-lite.dir//src/google/protobuf/implicit_weak_message.cc.o [ 2%] Building CXX object external/protobuf/cmake/CMakeFiles/libprotobuf-lite.dir//src/google/protobuf/inlined_string_field.cc.o [ 2%] Building CXX object external/protobuf/cmake/CMakeFiles/libprotobuf-lite.dir//src/google/protobuf/io/coded_stream.cc.o [ 2%] Building CXX object external/protobuf/cmake/CMakeFiles/libprotobuf-lite.dir/__/src/google/protobuf/io/io_win32.cc.o [ 2%] Building CXX object external/protobuf/cmake/CMakeFiles/libprotobuf-lite.dir//src/google/protobuf/io/strtod.cc.o [ 2%] Building CXX object external/protobuf/cmake/CMakeFiles/libprotobuf-lite.dir//src/google/protobuf/io/zero_copy_stream.cc.o [ 3%] Building CXX object external/protobuf/cmake/CMakeFiles/libprotobuf-lite.dir//src/google/protobuf/io/zero_copy_stream_impl.cc.o [ 3%] Building CXX object external/protobuf/cmake/CMakeFiles/libprotobuf-lite.dir//src/google/protobuf/io/zero_copy_stream_impl_lite.cc.o [ 3%] Building CXX object external/protobuf/cmake/CMakeFiles/libprotobuf-lite.dir//src/google/protobuf/map.cc.o [ 3%] Building CXX object external/protobuf/cmake/CMakeFiles/libprotobuf-lite.dir//src/google/protobuf/message_lite.cc.o [ 3%] Building CXX object external/protobuf/cmake/CMakeFiles/libprotobuf-lite.dir/__/src/google/protobuf/parse_context.cc.o [ 3%] Building CXX object external/protobuf/cmake/CMakeFiles/libprotobuf-lite.dir//src/google/protobuf/repeated_field.cc.o [ 3%] Building CXX object external/protobuf/cmake/CMakeFiles/libprotobuf-lite.dir//src/google/protobuf/stubs/bytestream.cc.o [ 3%] Building CXX object external/protobuf/cmake/CMakeFiles/libprotobuf-lite.dir//src/google/protobuf/stubs/common.cc.o [ 3%] Building CXX object external/protobuf/cmake/CMakeFiles/libprotobuf-lite.dir//src/google/protobuf/stubs/int128.cc.o [ 3%] Building CXX object external/protobuf/cmake/CMakeFiles/libprotobuf-lite.dir//src/google/protobuf/stubs/status.cc.o [ 3%] Building CXX object external/protobuf/cmake/CMakeFiles/libprotobuf-lite.dir//src/google/protobuf/stubs/statusor.cc.o [ 3%] Building CXX object external/protobuf/cmake/CMakeFiles/libprotobuf-lite.dir//src/google/protobuf/stubs/stringpiece.cc.o [ 3%] Building CXX object external/protobuf/cmake/CMakeFiles/libprotobuf-lite.dir//src/google/protobuf/stubs/stringprintf.cc.o [ 4%] Building CXX object external/protobuf/cmake/CMakeFiles/libprotobuf-lite.dir//src/google/protobuf/stubs/structurally_valid.cc.o [ 4%] Building CXX object external/protobuf/cmake/CMakeFiles/libprotobuf-lite.dir//src/google/protobuf/stubs/strutil.cc.o [ 4%] Building CXX object external/protobuf/cmake/CMakeFiles/libprotobuf-lite.dir//src/google/protobuf/stubs/time.cc.o [ 4%] Building CXX object external/protobuf/cmake/CMakeFiles/libprotobuf-lite.dir/__/src/google/protobuf/wire_format_lite.cc.o [ 4%] Linking CXX static library libprotobuf-lite.a [ 4%] Built target libprotobuf-lite [ 4%] Running C++ protocol buffer compiler on /home/TESTS/onnx-runtime-arm/onnxruntime/cmake/external/onnx/onnx/onnx-operators-ml.proto [ 4%] Built target gen_onnx_operators_proto [ 4%] Building CXX object external/onnx/CMakeFiles/onnx_proto.dir/onnx/onnx-ml.pb.cc.o [ 4%] Building CXX object external/onnx/CMakeFiles/onnx_proto.dir/onnx/onnx-operators-ml.pb.cc.o [ 5%] Building CXX object external/onnx/CMakeFiles/onnx_proto.dir/onnx/onnx-data.pb.cc.o [ 5%] Linking CXX static library libonnx_proto.a [ 5%] Built target onnx_proto [ 7%] Building CXX object CMakeFiles/onnxruntime_common.dir/home/TESTS/onnx-runtime-arm/onnxruntime/onnxruntime/core/common/cpuid_info.cc.o In file included from /home/TESTS/onnx-runtime-arm/onnxruntime/include/onnxruntime/core/common/common.h:37:0, from /home/TESTS/onnx-runtime-arm/onnxruntime/onnxruntime/core/common/cpuid_info.h:6, from /home/TESTS/onnx-runtime-arm/onnxruntime/onnxruntime/core/common/cpuid_info.cc:3: /home/TESTS/onnx-runtime-arm/onnxruntime/include/onnxruntime/core/common/status.h:114:21: warning: 'nodiscard' attribute directive ignored [-Wattributes] class [[nodiscard]] Status { ^~ [ 7%] Building CXX object CMakeFiles/onnxruntime_common.dir/home/TESTS/onnx-runtime-arm/onnxruntime/onnxruntime/core/common/denormal.cc.o In file included from /home/TESTS/onnx-runtime-arm/onnxruntime/include/onnxruntime/core/common/common.h:37:0, from /home/TESTS/onnx-runtime-arm/onnxruntime/onnxruntime/core/common/denormal.cc:21: /home/TESTS/onnx-runtime-arm/onnxruntime/include/onnxruntime/core/common/status.h:114:21: warning: 'nodiscard' attribute directive ignored [-Wattributes] class [[nodiscard]] Status { ^~ [ 7%] Building CXX object CMakeFiles/onnxruntime_common.dir/home/TESTS/onnx-runtime-arm/onnxruntime/onnxruntime/core/common/helper.cc.o In file included from /home/TESTS/onnx-runtime-arm/onnxruntime/include/onnxruntime/core/common/common.h:37:0, from /home/TESTS/onnx-runtime-arm/onnxruntime/onnxruntime/core/common/helper.cc:4: /home/TESTS/onnx-runtime-arm/onnxruntime/include/onnxruntime/core/common/status.h:114:21: warning: 'nodiscard' attribute directive ignored [-Wattributes] class [[nodiscard]] Status { ^~ [ 7%] Building CXX object CMakeFiles/onnxruntime_common.dir/home/TESTS/onnx-runtime-arm/onnxruntime/onnxruntime/core/common/logging/capture.cc.o In file included from /home/TESTS/onnx-runtime-arm/onnxruntime/include/onnxruntime/core/common/common.h:37:0, from /home/TESTS/onnx-runtime-arm/onnxruntime/include/onnxruntime/core/common/logging/capture.h:8, from /home/TESTS/onnx-runtime-arm/onnxruntime/onnxruntime/core/common/logging/capture.cc:4: /home/TESTS/onnx-runtime-arm/onnxruntime/include/onnxruntime/core/common/status.h:114:21: warning: 'nodiscard' attribute directive ignored [-Wattributes] class [[nodiscard]] Status { ^~ [ 7%] Building CXX object CMakeFiles/onnxruntime_common.dir/home/TESTS/onnx-runtime-arm/onnxruntime/onnxruntime/core/common/logging/logging.cc.o In file included from /home/TESTS/onnx-runtime-arm/onnxruntime/include/onnxruntime/core/common/common.h:37:0, from /home/TESTS/onnx-runtime-arm/onnxruntime/include/onnxruntime/core/common/exceptions.h:13, from /home/TESTS/onnx-runtime-arm/onnxruntime/onnxruntime/core/common/logging/logging.cc:9: /home/TESTS/onnx-runtime-arm/onnxruntime/include/onnxruntime/core/common/status.h:114:21: warning: 'nodiscard' attribute directive ignored [-Wattributes] class [[nodiscard]] Status { ^~ /home/TESTS/onnx-runtime-arm/onnxruntime/onnxruntime/core/common/logging/logging.cc: In constructor 'onnxruntime::logging::LoggingManager::LoggingManager(std::unique_ptr, onnxruntime::logging::Severity, bool, onnxruntime::logging::LoggingManager::InstanceType, const string, int)': /home/TESTS/onnx-runtime-arm/onnxruntime/onnxruntime/core/common/logging/logging.cc:111:19: error: 'is_always_lock_free' is not a member of 'std::remove_reference_t<std::atomic<void>&> {aka std::atomic<void*>}' static_assert(std::remove_reference_t<decltype(DefaultLoggerManagerInstance())>::is_always_lock_free); ^~~ make[2]: [CMakeFiles/onnxruntime_common.dir/build.make:132: CMakeFiles/onnxruntime_common.dir/home/TESTS/onnx-runtime-arm/onnxruntime/onnxruntime/core/common/logging/logging.cc.o] Error 1 make[1]: [CMakeFiles/Makefile2:1606: CMakeFiles/onnxruntime_common.dir/all] Error 2 make: *** [Makefile:166: all] Error 2

skottmckay commented 2 years ago

-- The C compiler identification is GNU 6.3.0 -- The CXX compiler identification is GNU 6.3.0

I believe you'd need gcc 8 or higher as we use a lot of C++17 features.

https://onnxruntime.ai/docs/build/inferencing.html#oscompiler-matrix

AnatoliyZabrovskiy commented 2 years ago

I see. Thank you.

tianleiwu commented 2 years ago

According to https://gcc.gnu.org/projects/cxx-status.html#cxx17, I think gcc 7 is enough for most C++17 features. I used to build with GCC 7.5 and there is no problem.