microsoft / onnxruntime

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

How to build onnxruntime CPU on ubuntu14.04 docker? #6000

Closed wnzhyee closed 3 years ago

wnzhyee commented 3 years ago

I need to build basic cpu onnxruntime and get shared libs on ubuntu14.04, and i pull the official ubuntu14.04 docker from docker hub. I installed gcc and g++ (version is 4.8.4) and cmake(3.13) in the image, and download onnxruntime 1.3.0 sources. I run the recommend command:

./build.sh --config RelWithDebInfo --build_shared_lib --parallel

And i meet the error:

2020-12-02 08:39:56,367 Build [DEBUG] - Defaulting to running update, build [and test for native builds].
2020-12-02 08:39:56,367 Build [INFO] - Build started
2020-12-02 08:39:56,367 Build [DEBUG] - Running subprocess in '/home/yckj3844/signet_sdk_ubuntu1404/library/onnxruntime/onnxruntime-1.3.0'
['git', 'submodule', 'sync', '--recursive']
2020-12-02 08:39:56,417 Build [DEBUG] - Subprocess completed. Return code=0
2020-12-02 08:39:56,417 Build [DEBUG] - Running subprocess in '/home/yckj3844/signet_sdk_ubuntu1404/library/onnxruntime/onnxruntime-1.3.0'
['git', 'submodule', 'update', '--init', '--recursive']
2020-12-02 08:39:56,472 Build [DEBUG] - Subprocess completed. Return code=0
2020-12-02 08:39:56,472 Build [INFO] - Generating CMake build tree
2020-12-02 08:39:56,475 Build [DEBUG] - Running subprocess in '/home/yckj3844/signet_sdk_ubuntu1404/library/onnxruntime/onnxruntime-1.3.0/build/Linux/RelWithDebInfo'
['/usr/local/bin/cmake', '/home/yckj3844/signet_sdk_ubuntu1404/library/onnxruntime/onnxruntime-1.3.0/cmake', '-Donnxruntime_RUN_ONNX_TESTS=OFF', '-Donnxruntime_BUILD_WINML_TESTS=ON', '-Donnxruntime_GENERATE_TEST_REPORTS=ON', '-Donnxruntime_DEV_MODE=ON', '-DPYTHON_EXECUTABLE=/usr/bin/python3', '-Donnxruntime_USE_CUDA=OFF', '-Donnxruntime_CUDNN_HOME=', '-Donnxruntime_USE_FEATURIZERS=OFF', '-Donnxruntime_CUDA_HOME=', '-Donnxruntime_USE_JEMALLOC=OFF', '-Donnxruntime_USE_MIMALLOC_STL_ALLOCATOR=OFF', '-Donnxruntime_USE_MIMALLOC_ARENA_ALLOCATOR=OFF', '-Donnxruntime_ENABLE_PYTHON=OFF', '-Donnxruntime_BUILD_CSHARP=OFF', '-Donnxruntime_BUILD_JAVA=OFF', '-Donnxruntime_BUILD_SHARED_LIB=ON', '-Donnxruntime_USE_EIGEN_FOR_BLAS=ON', '-Donnxruntime_USE_OPENBLAS=OFF', '-Donnxruntime_USE_DNNL=OFF', '-Donnxruntime_USE_MKLML=OFF', '-Donnxruntime_USE_NGRAPH=OFF', '-Donnxruntime_USE_OPENVINO=OFF', '-Donnxruntime_USE_OPENVINO_MYRIAD=OFF', '-Donnxruntime_USE_OPENVINO_GPU_FP32=OFF', '-Donnxruntime_USE_OPENVINO_GPU_FP16=OFF', '-Donnxruntime_USE_OPENVINO_CPU_FP32=OFF', '-Donnxruntime_USE_OPENVINO_VAD_M=OFF', '-Donnxruntime_USE_OPENVINO_VAD_F=OFF', '-Donnxruntime_USE_OPENVINO_BINARY=OFF', '-Donnxruntime_USE_NNAPI=OFF', '-Donnxruntime_USE_RKNPU=OFF', '-Donnxruntime_USE_OPENMP=ON', '-Donnxruntime_USE_TVM=OFF', '-Donnxruntime_USE_LLVM=OFF', '-Donnxruntime_ENABLE_MICROSOFT_INTERNAL=OFF', '-Donnxruntime_USE_NUPHAR=OFF', '-Donnxruntime_USE_TENSORRT=OFF', '-Donnxruntime_TENSORRT_HOME=', '-Donnxruntime_CROSS_COMPILING=OFF', '-Donnxruntime_DISABLE_CONTRIB_OPS=OFF', '-Donnxruntime_MSVC_STATIC_RUNTIME=OFF', '-Donnxruntime_ENABLE_LANGUAGE_INTEROP_OPS=OFF', '-Donnxruntime_USE_DML=OFF', '-Donnxruntime_USE_WINML=OFF', '-Donnxruntime_BUILD_FOR_WINDOWS_STORE=OFF', '-Donnxruntime_USE_TELEMETRY=OFF', '-Donnxruntime_ENABLE_LTO=OFF', '-Donnxruntime_USE_ACL=OFF', '-Donnxruntime_USE_ACL_1902=OFF', '-Donnxruntime_USE_ACL_1905=OFF', '-Donnxruntime_USE_ACL_1908=OFF', '-Donnxruntime_ENABLE_TRAINING=OFF', '-Donnxruntime_ENABLE_TRAINING_E2E_TESTS=OFF', '-Donnxruntime_USE_HOROVOD=OFF', '-Donnxruntime_PYBIND_EXPORT_OPSCHEMA=OFF', '-Donnxruntime_ENABLE_MEMLEAK_CHECKER=OFF', '-DCMAKE_BUILD_TYPE=RelWithDebInfo']
-- The C compiler identification is GNU 4.8.4
-- The CXX compiler identification is GNU 4.8.4
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found OpenMP_C: -fopenmp (found version "3.1") 
-- Found OpenMP_CXX: -fopenmp (found version "3.1") 
-- Found OpenMP: TRUE (found version "3.1")  
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - found
-- Found Threads: TRUE  
Use gtest from submodule
CMake Error at CMakeLists.txt:308 (add_subdirectory):
  The source directory

    /home/yckj3844/signet_sdk_ubuntu1404/library/onnxruntime/onnxruntime-1.3.0/cmake/external/googletest

  does not contain a CMakeLists.txt file.

CMake Error at CMakeLists.txt:309 (set_target_properties):
  set_target_properties Can not find target to add properties to: gmock

CMake Error at CMakeLists.txt:310 (set_target_properties):
  set_target_properties Can not find target to add properties to: gmock_main

CMake Error at CMakeLists.txt:311 (set_target_properties):
  set_target_properties Can not find target to add properties to: gtest

CMake Error at CMakeLists.txt:312 (set_target_properties):
  set_target_properties Can not find target to add properties to: gtest_main

CMake Error at CMakeLists.txt:313 (add_library):
  add_library cannot create ALIAS target "GTest::gmock" because target
  "gmock" does not already exist.

CMake Error at CMakeLists.txt:314 (add_library):
  add_library cannot create ALIAS target "GTest::gmock_main" because target
  "gmock_main" does not already exist.

CMake Error at CMakeLists.txt:315 (add_library):
  add_library cannot create ALIAS target "GTest::gtest" because target
  "gtest" does not already exist.

CMake Error at CMakeLists.txt:316 (add_library):
  add_library cannot create ALIAS target "GTest::gtest_main" because target
  "gtest_main" does not already exist.

-- Found PythonInterp: /usr/bin/python3 (found suitable version "3.6.8", minimum required is "3.4") 
CMake Error at CMakeLists.txt:356 (add_subdirectory):
  The source directory

    /home/yckj3844/signet_sdk_ubuntu1404/library/onnxruntime/onnxruntime-1.3.0/cmake/external/nsync

  does not contain a CMakeLists.txt file.

Use protobuf from submodule
CMake Error at CMakeLists.txt:395 (add_subdirectory):
  add_subdirectory given source
  "/home/yckj3844/signet_sdk_ubuntu1404/library/onnxruntime/onnxruntime-1.3.0/cmake/external/protobuf/cmake"
  which is not an existing directory.

CMake Error at CMakeLists.txt:407 (add_library):
  add_library cannot create ALIAS target "protobuf::libprotobuf" because
  target "libprotobuf-lite" does not already exist.

CMake Error at CMakeLists.txt:452 (add_subdirectory):
  The source directory

    /home/yckj3844/signet_sdk_ubuntu1404/library/onnxruntime/onnxruntime-1.3.0/cmake/external/date

  does not contain a CMakeLists.txt file.

CMake Error at CMakeLists.txt:463 (add_subdirectory):
  The source directory

    /home/yckj3844/signet_sdk_ubuntu1404/library/onnxruntime/onnxruntime-1.3.0/cmake/external/re2

  does not contain a CMakeLists.txt file.

CMake Error at CMakeLists.txt:464 (set_target_properties):
  set_target_properties Can not find target to add properties to: re2

CMake Error at CMakeLists.txt:465 (add_library):
  add_library cannot create ALIAS target "re2::re2" because target "re2" does
  not already exist.

CMake Error at onnx/CMakeLists.txt:38 (list):
  list sub-command REMOVE_ITEM requires two or more arguments.

-- Performing Test HAS_UNUSED_BUT_SET_VARIABLE
-- Performing Test HAS_UNUSED_BUT_SET_VARIABLE - Success
-- Performing Test HAS_UNUSED_PARAMETER
-- Performing Test HAS_UNUSED_PARAMETER - 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 - Failed
-- 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 - Failed
-- 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
-- Looking for clock_gettime in rt
-- Looking for clock_gettime in rt - found
-- The ASM compiler identification is GNU
-- Found assembler: /usr/bin/cc
-- Performing Test HAS_AVX512F
-- Performing Test HAS_AVX512F - Failed
-- Performing Test COMPILES_AVX512F
-- Performing Test COMPILES_AVX512F - Success
-- Performing Test HAS_AVX512CORE
-- Performing Test HAS_AVX512CORE - Failed
-- Performing Test COMPILES_AVX512CORE
-- Performing Test COMPILES_AVX512CORE - Failed
CMake Error at onnxruntime.cmake:105 (install):
  install TARGETS given no LIBRARY DESTINATION for shared library target
  "onnxruntime".
Call Stack (most recent call first):
  CMakeLists.txt:970 (include)

CMake Error at onnxruntime_unittests.cmake:628 (install):
  install TARGETS given no RUNTIME DESTINATION for executable target
  "onnx_test_runner".
Call Stack (most recent call first):
  CMakeLists.txt:990 (include)

-- Configuring incomplete, errors occurred!
See also "/home/yckj3844/signet_sdk_ubuntu1404/library/onnxruntime/onnxruntime-1.3.0/build/Linux/RelWithDebInfo/CMakeFiles/CMakeOutput.log".
See also "/home/yckj3844/signet_sdk_ubuntu1404/library/onnxruntime/onnxruntime-1.3.0/build/Linux/RelWithDebInfo/CMakeFiles/CMakeError.log".
Traceback (most recent call last):
  File "/home/yckj3844/signet_sdk_ubuntu1404/library/onnxruntime/onnxruntime-1.3.0/tools/ci_build/build.py", line 1740, in <module>
    sys.exit(main())
  File "/home/yckj3844/signet_sdk_ubuntu1404/library/onnxruntime/onnxruntime-1.3.0/tools/ci_build/build.py", line 1627, in main
    args, cmake_extra_args)
  File "/home/yckj3844/signet_sdk_ubuntu1404/library/onnxruntime/onnxruntime-1.3.0/tools/ci_build/build.py", line 806, in generate_build_tree
    cwd=config_build_dir)
  File "/home/yckj3844/signet_sdk_ubuntu1404/library/onnxruntime/onnxruntime-1.3.0/tools/ci_build/build.py", line 391, in run_subprocess
    env=my_env, shell=shell)
  File "/usr/lib/python3.6/subprocess.py", line 438, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['/usr/local/bin/cmake', '/home/yckj3844/signet_sdk_ubuntu1404/library/onnxruntime/onnxruntime-1.3.0/cmake', '-Donnxruntime_RUN_ONNX_TESTS=OFF', '-Donnxruntime_BUILD_WINML_TESTS=ON', '-Donnxruntime_GENERATE_TEST_REPORTS=ON', '-Donnxruntime_DEV_MODE=ON', '-DPYTHON_EXECUTABLE=/usr/bin/python3', '-Donnxruntime_USE_CUDA=OFF', '-Donnxruntime_CUDNN_HOME=', '-Donnxruntime_USE_FEATURIZERS=OFF', '-Donnxruntime_CUDA_HOME=', '-Donnxruntime_USE_JEMALLOC=OFF', '-Donnxruntime_USE_MIMALLOC_STL_ALLOCATOR=OFF', '-Donnxruntime_USE_MIMALLOC_ARENA_ALLOCATOR=OFF', '-Donnxruntime_ENABLE_PYTHON=OFF', '-Donnxruntime_BUILD_CSHARP=OFF', '-Donnxruntime_BUILD_JAVA=OFF', '-Donnxruntime_BUILD_SHARED_LIB=ON', '-Donnxruntime_USE_EIGEN_FOR_BLAS=ON', '-Donnxruntime_USE_OPENBLAS=OFF', '-Donnxruntime_USE_DNNL=OFF', '-Donnxruntime_USE_MKLML=OFF', '-Donnxruntime_USE_NGRAPH=OFF', '-Donnxruntime_USE_OPENVINO=OFF', '-Donnxruntime_USE_OPENVINO_MYRIAD=OFF', '-Donnxruntime_USE_OPENVINO_GPU_FP32=OFF', '-Donnxruntime_USE_OPENVINO_GPU_FP16=OFF', '-Donnxruntime_USE_OPENVINO_CPU_FP32=OFF', '-Donnxruntime_USE_OPENVINO_VAD_M=OFF', '-Donnxruntime_USE_OPENVINO_VAD_F=OFF', '-Donnxruntime_USE_OPENVINO_BINARY=OFF', '-Donnxruntime_USE_NNAPI=OFF', '-Donnxruntime_USE_RKNPU=OFF', '-Donnxruntime_USE_OPENMP=ON', '-Donnxruntime_USE_TVM=OFF', '-Donnxruntime_USE_LLVM=OFF', '-Donnxruntime_ENABLE_MICROSOFT_INTERNAL=OFF', '-Donnxruntime_USE_NUPHAR=OFF', '-Donnxruntime_USE_TENSORRT=OFF', '-Donnxruntime_TENSORRT_HOME=', '-Donnxruntime_CROSS_COMPILING=OFF', '-Donnxruntime_DISABLE_CONTRIB_OPS=OFF', '-Donnxruntime_MSVC_STATIC_RUNTIME=OFF', '-Donnxruntime_ENABLE_LANGUAGE_INTEROP_OPS=OFF', '-Donnxruntime_USE_DML=OFF', '-Donnxruntime_USE_WINML=OFF', '-Donnxruntime_BUILD_FOR_WINDOWS_STORE=OFF', '-Donnxruntime_USE_TELEMETRY=OFF', '-Donnxruntime_ENABLE_LTO=OFF', '-Donnxruntime_USE_ACL=OFF', '-Donnxruntime_USE_ACL_1902=OFF', '-Donnxruntime_USE_ACL_1905=OFF', '-Donnxruntime_USE_ACL_1908=OFF', '-Donnxruntime_ENABLE_TRAINING=OFF', '-Donnxruntime_ENABLE_TRAINING_E2E_TESTS=OFF', '-Donnxruntime_USE_HOROVOD=OFF', '-Donnxruntime_PYBIND_EXPORT_OPSCHEMA=OFF', '-Donnxruntime_ENABLE_MEMLEAK_CHECKER=OFF', '-DCMAKE_BUILD_TYPE=RelWithDebInfo']' returned non-zero exit status 1.

How to solve this? Is there any advise?

snnn commented 3 years ago

Is the folder /home/yckj3844/signet_sdk_ubuntu1404/library/onnxruntime/onnxruntime-1.3.0/cmake/external/googletest empty?

wnzhyee commented 3 years ago

Is the folder /home/yckj3844/signet_sdk_ubuntu1404/library/onnxruntime/onnxruntime-1.3.0/cmake/external/googletest empty?

yes, i found that the external is empty and i use --recursive, now it's work, but i find that i can compile success when i use gcc==7.4.0 but when i use gcc==4.8.4, it'll build error. How can i comile it in low version gcc? because if i use high version compiled libonnxruntime.so in my project, it seems glibc is mismatching, the error is like:

/home/yckj3844/signet_sdk_ubuntu1404/library/onnxruntime/lib/libonnxruntime.so: undefined reference to `VTT for std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >@GLIBCXX_3.4.21'
/home/yckj3844/signet_sdk_ubuntu1404/library/onnxruntime/lib/libonnxruntime.so: undefined reference to `std::logic_error::logic_error(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@GLIBCXX_3.4.21'
/home/yckj3844/signet_sdk_ubuntu1404/library/onnxruntime/lib/libonnxruntime.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_assign(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@GLIBCXX_3.4.21'
/home/yckj3844/signet_sdk_ubuntu1404/library/onnxruntime/lib/libonnxruntime.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::reserve(unsigned long)@GLIBCXX_3.4.21'
/home/yckj3844/signet_sdk_ubuntu1404/library/onnxruntime/lib/libonnxruntime.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::find_last_of(char const*, unsigned long, unsigned long) const@GLIBCXX_3.4.21'
/home/yckj3844/signet_sdk_ubuntu1404/library/onnxruntime/lib/libonnxruntime.so: undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream(std::_Ios_Openmode)@GLIBCXX_3.4.21'
/home/yckj3844/signet_sdk_ubuntu1404/library/onnxruntime/lib/libonnxruntime.so: undefined reference to `std::logic_error::logic_error(char const*)@GLIBCXX_3.4.21'
/home/yckj3844/signet_sdk_ubuntu1404/library/onnxruntime/lib/libonnxruntime.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::resize(unsigned long, char)@GLIBCXX_3.4.21'
/home/yckj3844/signet_sdk_ubuntu1404/library/onnxruntime/lib/libonnxruntime.so: undefined reference to `vtable for std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >@GLIBCXX_3.4.21'
/home/yckj3844/signet_sdk_ubuntu1404/library/onnxruntime/lib/libonnxruntime.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_erase(unsigned long, unsigned long)@GLIBCXX_3.4.21'
/home/yckj3844/signet_sdk_ubuntu1404/library/onnxruntime/lib/libonnxruntime.so: undefined reference to `std::logic_error::logic_error(char const*)@GLIBCXX_3.4.21'
/home/yckj3844/signet_sdk_ubuntu1404/library/onnxruntime/lib/libonnxruntime.so: undefined reference to `std::runtime_error::runtime_error(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@GLIBCXX_3.4.21'
/home/yckj3844/signet_sdk_ubuntu1404/library/onnxruntime/lib/libonnxruntime.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::find_first_not_of(char const*, unsigned long, unsigned long) const@GLIBCXX_3.4.21'
/home/yckj3844/signet_sdk_ubuntu1404/library/onnxruntime/lib/libonnxruntime.so: undefined reference to `std::__cxx11::numpunct<char> const& std::use_facet<std::__cxx11::numpunct<char> >(std::locale const&)@GLIBCXX_3.4.21'
/home/yckj3844/signet_sdk_ubuntu1404/library/onnxruntime/lib/libonnxruntime.so: undefined reference to `std::invalid_argument::invalid_argument(char const*)@GLIBCXX_3.4.21'
/home/yckj3844/signet_sdk_ubuntu1404/library/onnxruntime/lib/libonnxruntime.so: undefined reference to `std::__throw_out_of_range_fmt(char const*, ...)@GLIBCXX_3.4.20'
/home/yckj3844/signet_sdk_ubuntu1404/library/onnxruntime/lib/libonnxruntime.so: undefined reference to `logf@GLIBC_2.27'
/home/yckj3844/signet_sdk_ubuntu1404/library/onnxruntime/lib/libonnxruntime.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::push_back(char)@GLIBCXX_3.4.21'
/home/yckj3844/signet_sdk_ubuntu1404/library/onnxruntime/lib/libonnxruntime.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_append(char const*, unsigned long)@GLIBCXX_3.4.21'
/home/yckj3844/signet_sdk_ubuntu1404/library/onnxruntime/lib/libonnxruntime.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::compare(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const@GLIBCXX_3.4.21'
/home/yckj3844/signet_sdk_ubuntu1404/library/onnxruntime/lib/libonnxruntime.so: undefined reference to `std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::_M_create(unsigned long&, unsigned long)@GLIBCXX_3.4.21'
/home/yckj3844/signet_sdk_ubuntu1404/library/onnxruntime/lib/libonnxruntime.so: undefined reference to `std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::~basic_stringstream()@GLIBCXX_3.4.21'
/home/yckj3844/signet_sdk_ubuntu1404/library/onnxruntime/lib/libonnxruntime.so: undefined reference to `std::runtime_error::runtime_error(char const*)@GLIBCXX_3.4.21'
/home/yckj3844/signet_sdk_ubuntu1404/library/onnxruntime/lib/libonnxruntime.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_construct(unsigned long, char)@GLIBCXX_3.4.21'
/home/yckj3844/signet_sdk_ubuntu1404/library/onnxruntime/lib/libonnxruntime.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::assign(char const*)@GLIBCXX_3.4.21'
/home/yckj3844/signet_sdk_ubuntu1404/library/onnxruntime/lib/libonnxruntime.so: undefined reference to `__cxa_throw_bad_array_new_length@CXXABI_1.3.8'
/home/yckj3844/signet_sdk_ubuntu1404/library/onnxruntime/lib/libonnxruntime.so: undefined reference to `std::runtime_error::runtime_error(std::runtime_error const&)@GLIBCXX_3.4.21'
/home/yckj3844/signet_sdk_ubuntu1404/library/onnxruntime/lib/libonnxruntime.so: undefined reference to `vtable for std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >@GLIBCXX_3.4.21'
/home/yckj3844/signet_sdk_ubuntu1404/library/onnxruntime/lib/libonnxruntime.so: undefined reference to `vtable for std::__cxx11::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >@GLIBCXX_3.4.21'
/home/yckj3844/signet_sdk_ubuntu1404/library/onnxruntime/lib/libonnxruntime.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_create(unsigned long&, unsigned long)@GLIBCXX_3.4.21'
/home/yckj3844/signet_sdk_ubuntu1404/library/onnxruntime/lib/libonnxruntime.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::compare(unsigned long, unsigned long, char const*) const@GLIBCXX_3.4.21'
/home/yckj3844/signet_sdk_ubuntu1404/library/onnxruntime/lib/libonnxruntime.so: undefined reference to `std::runtime_error::runtime_error(std::runtime_error const&)@GLIBCXX_3.4.21'
/home/yckj3844/signet_sdk_ubuntu1404/library/onnxruntime/lib/libonnxruntime.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_replace_aux(unsigned long, unsigned long, unsigned long, char)@GLIBCXX_3.4.21'
/home/yckj3844/signet_sdk_ubuntu1404/library/onnxruntime/lib/libonnxruntime.so: undefined reference to `std::basic_istream<char, std::char_traits<char> >& std::getline<char, std::char_traits<char>, std::allocator<char> >(std::basic_istream<char, std::char_traits<char> >&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, char)@GLIBCXX_3.4.21'
/home/yckj3844/signet_sdk_ubuntu1404/library/onnxruntime/lib/libonnxruntime.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::append(char const*)@GLIBCXX_3.4.21'
/home/yckj3844/signet_sdk_ubuntu1404/library/onnxruntime/lib/libonnxruntime.so: undefined reference to `std::__cxx11::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >::_M_sync(char*, unsigned long, unsigned long)@GLIBCXX_3.4.21'
/home/yckj3844/signet_sdk_ubuntu1404/library/onnxruntime/lib/libonnxruntime.so: undefined reference to `std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::basic_stringstream(std::_Ios_Openmode)@GLIBCXX_3.4.21'
/home/yckj3844/signet_sdk_ubuntu1404/library/onnxruntime/lib/libonnxruntime.so: undefined reference to `std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::_M_replace(unsigned long, unsigned long, wchar_t const*, unsigned long)@GLIBCXX_3.4.21'
/home/yckj3844/signet_sdk_ubuntu1404/library/onnxruntime/lib/libonnxruntime.so: undefined reference to `std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::_M_assign(std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&)@GLIBCXX_3.4.21'
/home/yckj3844/signet_sdk_ubuntu1404/library/onnxruntime/lib/libonnxruntime.so: undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::~basic_ostringstream()@GLIBCXX_3.4.21'
/home/yckj3844/signet_sdk_ubuntu1404/library/onnxruntime/lib/libonnxruntime.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::compare(char const*) const@GLIBCXX_3.4.21'
/home/yckj3844/signet_sdk_ubuntu1404/library/onnxruntime/lib/libonnxruntime.so: undefined reference to `std::__cxx11::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >::str() const@GLIBCXX_3.4.21'
/home/yckj3844/signet_sdk_ubuntu1404/library/onnxruntime/lib/libonnxruntime.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::swap(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&)@GLIBCXX_3.4.21'
/home/yckj3844/signet_sdk_ubuntu1404/library/onnxruntime/lib/libonnxruntime.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::find_first_of(char const*, unsigned long, unsigned long) const@GLIBCXX_3.4.21'
/home/yckj3844/signet_sdk_ubuntu1404/library/onnxruntime/lib/libonnxruntime.so: undefined reference to `VTT for std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >@GLIBCXX_3.4.21'
/home/yckj3844/signet_sdk_ubuntu1404/library/onnxruntime/lib/libonnxruntime.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator=(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&)@GLIBCXX_3.4.21'
/home/yckj3844/signet_sdk_ubuntu1404/library/onnxruntime/lib/libonnxruntime.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_mutate(unsigned long, unsigned long, char const*, unsigned long)@GLIBCXX_3.4.21'
/home/yckj3844/signet_sdk_ubuntu1404/library/onnxruntime/lib/libonnxruntime.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()@GLIBCXX_3.4.21'
/home/yckj3844/signet_sdk_ubuntu1404/library/onnxruntime/lib/libonnxruntime.so: undefined reference to `std::logic_error::logic_error(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@GLIBCXX_3.4.21'
/home/yckj3844/signet_sdk_ubuntu1404/library/onnxruntime/lib/libonnxruntime.so: undefined reference to `std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::~basic_string()@GLIBCXX_3.4.21'
/home/yckj3844/signet_sdk_ubuntu1404/library/onnxruntime/lib/libonnxruntime.so: undefined reference to `operator delete(void*, unsigned long)@CXXABI_1.3.9'
/home/yckj3844/signet_sdk_ubuntu1404/library/onnxruntime/lib/libonnxruntime.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_replace(unsigned long, unsigned long, char const*, unsigned long)@GLIBCXX_3.4.21'
/home/yckj3844/signet_sdk_ubuntu1404/library/onnxruntime/lib/libonnxruntime.so: undefined reference to `std::basic_ifstream<char, std::char_traits<char> >::basic_ifstream(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::_Ios_Openmode)@GLIBCXX_3.4.21'
/home/yckj3844/signet_sdk_ubuntu1404/library/onnxruntime/lib/libonnxruntime.so: undefined reference to `std::invalid_argument::invalid_argument(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@GLIBCXX_3.4.21'
/home/yckj3844/signet_sdk_ubuntu1404/library/onnxruntime/lib/libonnxruntime.so: undefined reference to `powf@GLIBC_2.27'
/home/yckj3844/signet_sdk_ubuntu1404/library/onnxruntime/lib/libonnxruntime.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::find(char const*, unsigned long, unsigned long) const@GLIBCXX_3.4.21'
/home/yckj3844/signet_sdk_ubuntu1404/library/onnxruntime/lib/libonnxruntime.so: undefined reference to `expf@GLIBC_2.27'
/home/yckj3844/signet_sdk_ubuntu1404/library/onnxruntime/lib/libonnxruntime.so: undefined reference to `std::runtime_error::runtime_error(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@GLIBCXX_3.4.21'
collect2: error: ld returned 1 exit status
make[2]: *** [run] Error 1
make[1]: *** [CMakeFiles/run.dir/all] Error 2
make: *** [all] Error 2

Here is the build error log via gcc4.8(the error log is begin at line600): build.log

the build command is:

python3 $DIR/tools/ci_build/build.py --build_dir $DIR/build/Linux  --config RelWithDebInfo --parallel --skip_tests --build_shared_lib

thanks for your reply

snnn commented 3 years ago

AFAIK, onnxruntime works well with gcc 4.8.5. I haven't tried gcc 4.8.4. It failed because it can't recognize the macro POPULATE_OP_DOC_STR @pranavsharma FYI.

pranavsharma commented 3 years ago

AFAIK, onnxruntime works well with gcc 4.8.5. I haven't tried gcc 4.8.4. It failed because it can't recognize the macro POPULATE_OP_DOC_STR @pranavsharma FYI.

The introduction of the POPULATE_OP_DOC_STR macro along with string literals surfaced a compiler bug that got fixed only in gcc 4.9.0 and after.

wnzhyee commented 3 years ago

AFAIK, onnxruntime works well with gcc 4.8.5. I haven't tried gcc 4.8.4. It failed because it can't recognize the macro POPULATE_OP_DOC_STR @pranavsharma FYI.

The introduction of the POPULATE_OP_DOC_STR macro along with string literals surfaced a compiler bug that got fixed only in gcc 4.9.0 and after.

thanks for ur reply! i tried centos7.6 with gcc4.8.5, and it compiles success. so is it only a compile bug on old ubuntu version with gcc 4.8? is there any advise to make this work?

pranavsharma commented 3 years ago

AFAIK, onnxruntime works well with gcc 4.8.5. I haven't tried gcc 4.8.4. It failed because it can't recognize the macro POPULATE_OP_DOC_STR @pranavsharma FYI.

The introduction of the POPULATE_OP_DOC_STR macro along with string literals surfaced a compiler bug that got fixed only in gcc 4.9.0 and after.

thanks for ur reply! i tried centos7.6 with gcc4.8.5, and it compiles success. so is it only a compile bug on old ubuntu version with gcc 4.8? is there any advise to make this work?

Well, we can try avoiding the usage of string literals. Contributions are welcome.

wnzhyee commented 3 years ago

AFAIK, onnxruntime works well with gcc 4.8.5. I haven't tried gcc 4.8.4. It failed because it can't recognize the macro POPULATE_OP_DOC_STR @pranavsharma FYI.

The introduction of the POPULATE_OP_DOC_STR macro along with string literals surfaced a compiler bug that got fixed only in gcc 4.9.0 and after.

thanks for ur reply! i tried centos7.6 with gcc4.8.5, and it compiles success. so is it only a compile bug on old ubuntu version with gcc 4.8? is there any advise to make this work?

Well, we can try avoiding the usage of string literals. Contributions are welcome.

well, i simply delete all the linefeed in the POPULATE_OP_DOC_STR doc definition and it works, just like this: old:

POPULATE_OP_DOC_STR(doc=R"aaa
bbb
ccc";);

new:

POPULATE_OP_DOC_STR(doc=R"aaa bbb ccc";);

it seems gcc4.8.4 can't handle multi line raw string lol

thanks for your help~