Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when building onnxruntime on Fedora 32 for aarch64 #7520

Closed
shortcipher3 opened this issue Apr 30, 2021 · 6 comments · Fixed by #7616
Closed

Error when building onnxruntime on Fedora 32 for aarch64 #7520

shortcipher3 opened this issue Apr 30, 2021 · 6 comments · Fixed by #7616

Comments

@shortcipher3
Copy link

Describe the bug
Error when building onnxruntime on Fedora 32 for aarch64
onnxruntime/cmake/external/protobuf/src/google/protobuf/stubs/logging.h:188:50: error: comparison of unsigned expression in ‘>= 0’ is always true [-Werror=type-limits]

My build process is here:

# ./build.sh --config RelWithDebInfo --build_shared_lib --parallel
...
In file included from /data/onnxruntime/cmake/external/protobuf/src/google/protobuf/io/coded_stream.h:146,
                 from /data/onnxruntime/build/Linux/RelWithDebInfo/external/onnx/onnx/onnx-ml.pb.h:23,
                 from /data/onnxruntime/cmake/external/onnx/onnx/onnx_pb.h:52,
                 from /data/onnxruntime/cmake/external/onnx/onnx/defs/data_type_utils.h:13,
                 from /data/onnxruntime/cmake/external/onnx/onnx/defs/schema.h:23,
                 from /data/onnxruntime/include/onnxruntime/core/graph/onnx_protobuf.h:38,
                 from /data/onnxruntime/include/onnxruntime/core/framework/data_types.h:17,
                 from /data/onnxruntime/onnxruntime/core/framework/sequential_execution_plan.h:8,
                 from /data/onnxruntime/onnxruntime/core/framework/allocation_planner.h:9,
                 from /data/onnxruntime/onnxruntime/core/framework/allocation_planner.cc:4:
/data/onnxruntime/cmake/external/protobuf/src/google/protobuf/parse_context.h: In instantiation of ‘const char* google::protobuf::internal::EpsCopyInputStream::AppendUntilEnd(const char*, const A&) [with A = google::protobuf::internal::EpsCopyInputStream::AppendString(const char*, std::string*)::<lambda(const char*, ptrdiff_t)>]’:
/data/onnxruntime/cmake/external/protobuf/src/google/protobuf/parse_context.h:366:70:   required from here
/data/onnxruntime/cmake/external/protobuf/src/google/protobuf/stubs/logging.h:188:50: error: comparison of unsigned expression in ‘>= 0’ is always true [-Werror=type-limits]
  188 | #define GOOGLE_DCHECK_GE(A, B) GOOGLE_DCHECK((A) >= (B))
      |                                                  ^
/data/onnxruntime/cmake/external/protobuf/src/google/protobuf/stubs/logging.h:151:5: note: in definition of macro ‘GOOGLE_LOG_IF’
  151 |   !(CONDITION) ? (void)0 : GOOGLE_LOG(LEVEL)
      |     ^~~~~~~~~
/data/onnxruntime/cmake/external/protobuf/src/google/protobuf/stubs/logging.h:181:48: note: in expansion of macro ‘GOOGLE_CHECK’
  181 | #define GOOGLE_DCHECK(EXPRESSION) while(false) GOOGLE_CHECK(EXPRESSION)
      |                                                ^~~~~~~~~~~~
/data/onnxruntime/cmake/external/protobuf/src/google/protobuf/stubs/logging.h:188:32: note: in expansion of macro ‘GOOGLE_DCHECK’
  188 | #define GOOGLE_DCHECK_GE(A, B) GOOGLE_DCHECK((A) >= (B))
      |                                ^~~~~~~~~~~~~
/data/onnxruntime/cmake/external/protobuf/src/google/protobuf/parse_context.h:351:7: note: in expansion of macro ‘GOOGLE_DCHECK_GE’
  351 |       GOOGLE_DCHECK_GE(chunk_size, static_cast<size_t>(0));
      |       ^~~~~~~~~~~~~~~~
[ 32%] Building CXX object CMakeFiles/onnxruntime_common.dir/data/onnxruntime/onnxruntime/core/common/logging/sinks/ostream_sink.cc.o
In file included from /data/onnxruntime/cmake/external/protobuf/src/google/protobuf/io/coded_stream.h:146,
                 from /data/onnxruntime/build/Linux/RelWithDebInfo/external/onnx/onnx/onnx-ml.pb.h:23,
                 from /data/onnxruntime/cmake/external/onnx/onnx/onnx_pb.h:52,
                 from /data/onnxruntime/cmake/external/onnx/onnx/defs/data_type_utils.h:13,
                 from /data/onnxruntime/cmake/external/onnx/onnx/defs/schema.h:23,
                 from /data/onnxruntime/include/onnxruntime/core/graph/onnx_protobuf.h:38,
                 from /data/onnxruntime/include/onnxruntime/core/framework/data_types.h:17,
                 from /data/onnxruntime/include/onnxruntime/core/framework/ml_value.h:10,
                 from /data/onnxruntime/onnxruntime/core/framework/tensorprotoutils.h:14,
                 from /data/onnxruntime/onnxruntime/core/optimizer/initializer.h:12,
                 from /data/onnxruntime/onnxruntime/core/optimizer/bias_dropout_fusion.cc:4:
/data/onnxruntime/cmake/external/protobuf/src/google/protobuf/parse_context.h: In instantiation of ‘const char* google::protobuf::internal::EpsCopyInputStream::AppendUntilEnd(const char*, const A&) [with A = google::protobuf::internal::EpsCopyInputStream::AppendString(const char*, std::string*)::<lambda(const char*, ptrdiff_t)>]’:
/data/onnxruntime/cmake/external/protobuf/src/google/protobuf/parse_context.h:366:70:   required from here
/data/onnxruntime/cmake/external/protobuf/src/google/protobuf/stubs/logging.h:188:50: error: comparison of unsigned expression in ‘>= 0’ is always true [-Werror=type-limits]
  188 | #define GOOGLE_DCHECK_GE(A, B) GOOGLE_DCHECK((A) >= (B))
      |                                                  ^
/data/onnxruntime/cmake/external/protobuf/src/google/protobuf/stubs/logging.h:151:5: note: in definition of macro ‘GOOGLE_LOG_IF’
  151 |   !(CONDITION) ? (void)0 : GOOGLE_LOG(LEVEL)
      |     ^~~~~~~~~
/data/onnxruntime/cmake/external/protobuf/src/google/protobuf/stubs/logging.h:181:48: note: in expansion of macro ‘GOOGLE_CHECK’
  181 | #define GOOGLE_DCHECK(EXPRESSION) while(false) GOOGLE_CHECK(EXPRESSION)
      |                                                ^~~~~~~~~~~~
/data/onnxruntime/cmake/external/protobuf/src/google/protobuf/stubs/logging.h:188:32: note: in expansion of macro ‘GOOGLE_DCHECK’
  188 | #define GOOGLE_DCHECK_GE(A, B) GOOGLE_DCHECK((A) >= (B))
      |                                ^~~~~~~~~~~~~
/data/onnxruntime/cmake/external/protobuf/src/google/protobuf/parse_context.h:351:7: note: in expansion of macro ‘GOOGLE_DCHECK_GE’
  351 |       GOOGLE_DCHECK_GE(chunk_size, static_cast<size_t>(0));
      |       ^~~~~~~~~~~~~~~~
[ 32%] Building CXX object CMakeFiles/onnxruntime_common.dir/data/onnxruntime/onnxruntime/core/common/path.cc.o
cc1plus: all warnings being treated as errors
gmake[2]: *** [CMakeFiles/onnxruntime_optimizer.dir/build.make:96: CMakeFiles/onnxruntime_optimizer.dir/data/onnxruntime/onnxruntime/core/optimizer/bias_dropout_fusion.cc.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....
[ 34%] Building CXX object CMakeFiles/onnxruntime_common.dir/data/onnxruntime/onnxruntime/core/common/profiler.cc.o
cc1plus: all warnings being treated as errors
gmake[2]: *** [CMakeFiles/onnxruntime_framework.dir/build.make:83: CMakeFiles/onnxruntime_framework.dir/data/onnxruntime/onnxruntime/core/framework/allocation_planner.cc.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:816: CMakeFiles/onnxruntime_framework.dir/all] Error 2
[ 34%] Building CXX object CMakeFiles/onnxruntime_common.dir/data/onnxruntime/onnxruntime/core/common/status.cc.o
[ 34%] Building CXX object CMakeFiles/onnxruntime_common.dir/data/onnxruntime/onnxruntime/core/common/str_helper.cc.o
[ 34%] Building CXX object CMakeFiles/onnxruntime_common.dir/data/onnxruntime/onnxruntime/core/common/threadpool.cc.o
cc1plus: all warnings being treated as errors
gmake[2]: *** [CMakeFiles/onnxruntime_optimizer.dir/build.make:83: CMakeFiles/onnxruntime_optimizer.dir/data/onnxruntime/onnxruntime/core/optimizer/attention_fusion.cc.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:1007: CMakeFiles/onnxruntime_optimizer.dir/all] Error 2
[ 34%] Building CXX object CMakeFiles/onnxruntime_common.dir/data/onnxruntime/onnxruntime/core/platform/env_time.cc.o
[ 34%] Building CXX object CMakeFiles/onnxruntime_common.dir/data/onnxruntime/onnxruntime/core/platform/env.cc.o
[ 34%] Building CXX object CMakeFiles/onnxruntime_common.dir/data/onnxruntime/onnxruntime/core/platform/path_lib.cc.o
[ 34%] Building CXX object CMakeFiles/onnxruntime_common.dir/data/onnxruntime/onnxruntime/core/platform/posix/env.cc.o
[ 34%] Building CXX object CMakeFiles/onnxruntime_common.dir/data/onnxruntime/onnxruntime/core/platform/posix/env_time.cc.o
[ 34%] Building CXX object CMakeFiles/onnxruntime_common.dir/data/onnxruntime/onnxruntime/core/platform/posix/ort_mutex.cc.o
[ 34%] Building CXX object CMakeFiles/onnxruntime_common.dir/data/onnxruntime/onnxruntime/core/platform/posix/stacktrace.cc.o
[ 35%] Building CXX object CMakeFiles/onnxruntime_common.dir/data/onnxruntime/onnxruntime/core/platform/telemetry.cc.o
[ 35%] Linking CXX static library libonnxruntime_common.a
[ 35%] Built target onnxruntime_common
gmake: *** [Makefile:183: all] Error 2
Traceback (most recent call last):
  File "/data/onnxruntime/tools/ci_build/build.py", line 2106, in <module>
    sys.exit(main())
  File "/data/onnxruntime/tools/ci_build/build.py", line 2032, in main
    build_targets(args, cmake_path, build_dir, configs, num_parallel_jobs, args.target)
  File "/data/onnxruntime/tools/ci_build/build.py", line 1054, in build_targets
    run_subprocess(cmd_args, env=env)
  File "/data/onnxruntime/tools/ci_build/build.py", line 572, in run_subprocess
    return run(*args, cwd=cwd, capture_stdout=capture_stdout, shell=shell, env=my_env)
  File "/data/onnxruntime/tools/python/util/run.py", line 41, in run
    completed_process = subprocess.run(
  File "/usr/lib64/python3.8/subprocess.py", line 516, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/usr/bin/cmake', '--build', '/data/onnxruntime/build/Linux/RelWithDebInfo', '--config', 'RelWithDebInfo', '--', '-j4']' returned non-zero exit status 2.

Full output is available here:
https://pastebin.com/UpSKi4M7

Urgency
Ideally resolved in a couple of weeks

System information

  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Linux Fedora 32 Aarch64
  • ONNX Runtime installed from (source or binary): source (build)
  • ONNX Runtime version: master
  • Python version: python 3.8.9
  • Visual Studio version (if applicable): n/a
  • GCC/Compiler version (if compiling from source): gcc 10.2.1
  • CUDA/cuDNN version: n/a
  • GPU model and memory: n/a

To Reproduce
Can reproduce in a docker image with QEMU emulator, use FROM arm64v8/fedora:32, add dependencies and call:

git clone --recursive https://github.com/Microsoft/onnxruntime
cd onnxruntime
./build.sh --config RelWithDebInfo --build_shared_lib --parallel

Expected behavior
It should compile

@snnn
Copy link
Member

snnn commented Apr 30, 2021

Which source code version? Could you please give me a commit id? I just updated the protobuf submodule.

Does the same problem also exist in x86_64 build?

@shortcipher3
Copy link
Author

That was on master earlier today, I finished rerunning after running. I didn't keep track of the commit id, but I'll look into it.

However I reran as follows:

git checkout v1.7.2
./build.sh --config RelWithDebInfo --build_shared_lib

This time it got to 61% before throwing an error:

Scanning dependencies of target onnxruntime_session
[ 60%] Building CXX object CMakeFiles/onnxruntime_session.dir/data/onnxruntime/onnxruntime/core/session/IOBinding.cc.o
[ 60%] Building CXX object CMakeFiles/onnxruntime_session.dir/data/onnxruntime/onnxruntime/core/session/abi_session_options.cc.o
[ 60%] Building CXX object CMakeFiles/onnxruntime_session.dir/data/onnxruntime/onnxruntime/core/session/custom_ops.cc.o
[ 60%] Building CXX object CMakeFiles/onnxruntime_session.dir/data/onnxruntime/onnxruntime/core/session/default_cpu_allocator_c_api.cc.o
[ 60%] Building CXX object CMakeFiles/onnxruntime_session.dir/data/onnxruntime/onnxruntime/core/session/device_allocator.cc.o
[ 61%] Building CXX object CMakeFiles/onnxruntime_session.dir/data/onnxruntime/onnxruntime/core/session/environment.cc.o
[ 61%] Building CXX object CMakeFiles/onnxruntime_session.dir/data/onnxruntime/onnxruntime/core/session/inference_session.cc.o
In file included from /data/onnxruntime/onnxruntime/core/session/inference_session_utils.h:21,
                 from /data/onnxruntime/onnxruntime/core/session/inference_session.cc:48:
/data/onnxruntime/cmake/external/json/single_include/nlohmann/json.hpp: In instantiation of ‘std::string nlohmann::detail::lexer<BasicJsonType>::get_token_string() const [with BasicJsonType = nlohmann::basic_json<>; std::string = std::__cxx11::basic_string<char>]’:
/data/onnxruntime/cmake/external/json/single_include/nlohmann/json.hpp:8745:57:   required from ‘void nlohmann::detail::parser<BasicJsonType>::parse(bool, BasicJsonType&) [with BasicJsonType = nlohmann::basic_json<>]’
/data/onnxruntime/cmake/external/json/single_include/nlohmann/json.hpp:20835:79:   required from ‘static nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer> nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer>::parse(IteratorType, IteratorType, nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer>::parser_callback_t, bool) [with IteratorType = const char*; typename std::enable_if<std::is_base_of<std::random_access_iterator_tag, typename std::iterator_traits<_InputIterator>::iterator_category>::value, int>::type <anonymous> = 0; ObjectType = std::map; ArrayType = std::vector; StringType = std::__cxx11::basic_string<char>; BooleanType = bool; NumberIntegerType = long int; NumberUnsignedType = long unsigned int; NumberFloatType = double; AllocatorType = std::allocator; JSONSerializer = nlohmann::adl_serializer; nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer>::parser_callback_t = std::function<bool(int, nlohmann::detail::parser<nlohmann::basic_json<> >::parse_event_t, nlohmann::basic_json<>&)>]’
/data/onnxruntime/cmake/external/json/single_include/nlohmann/json.hpp:22653:42:   required from here
/data/onnxruntime/cmake/external/json/single_include/nlohmann/json.hpp:8494:24: error: comparison is always true due to limited range of data type [-Werror=type-limits]
 8494 |             if ('\x00' <= c and c <= '\x1F')
      |                 ~~~~~~~^~~~
cc1plus: all warnings being treated as errors
gmake[2]: *** [CMakeFiles/onnxruntime_session.dir/build.make:161: CMakeFiles/onnxruntime_session.dir/data/onnxruntime/onnxruntime/core/session/inference_session.cc.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:1557: CMakeFiles/onnxruntime_session.dir/all] Error 2
gmake: *** [Makefile:183: all] Error 2
Traceback (most recent call last):
  File "/data/onnxruntime/tools/ci_build/build.py", line 1986, in <module>
    sys.exit(main())
  File "/data/onnxruntime/tools/ci_build/build.py", line 1921, in main
    build_targets(args, cmake_path, build_dir, configs, num_parallel_jobs, args.target)
  File "/data/onnxruntime/tools/ci_build/build.py", line 1007, in build_targets
    run_subprocess(cmd_args, env=env)
  File "/data/onnxruntime/tools/ci_build/build.py", line 528, in run_subprocess
    return run(*args, cwd=cwd, capture_stdout=capture_stdout, shell=shell, env=my_env)
  File "/data/onnxruntime/tools/python/util/run.py", line 41, in run
    completed_process = subprocess.run(
  File "/usr/lib64/python3.8/subprocess.py", line 516, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/usr/bin/cmake', '--build', '/data/onnxruntime/build/Linux/RelWithDebInfo', '--config', 'RelWithDebInfo']' returned non-zero exit status 2.

I have not yet tested in x86_64 build.

@snnn
Copy link
Member

snnn commented Apr 30, 2021

Your gcc version is gcc 10.2.1 but we only tested our code with GCC 8.x. I guess that's the reason. I will add some tests in CI build to catch such errors. Meantime, you can open build.py and remove this line:
https://github.com/microsoft/onnxruntime/blob/master/tools/ci_build/build.py#L658

@snnn
Copy link
Member

snnn commented May 1, 2021

See protocolbuffers/protobuf#7514

The fix has been checked in. Later on I will bring it in our code base.

@snnn snnn closed this as completed May 1, 2021
@shortcipher3
Copy link
Author

I ran into another problem compiling:

[ 71%] Building CXX object CMakeFiles/onnxruntime_providers.dir/data/plugins/onnxruntime/onnxruntime/contrib_ops/cpu/qlinear_lookup_table.cc.o
[ 71%] Building CXX object CMakeFiles/onnxruntime_providers.dir/data/plugins/onnxruntime/onnxruntime/contrib_ops/cpu/qlinear_pool.cc.o
In file included from /data/plugins/onnxruntime/cmake/external/protobuf/src/google/protobuf/io/coded_stream.h:146,
                 from /data/plugins/onnxruntime/build/Linux/RelWithDebInfo/external/onnx/onnx/onnx-ml.pb.h:23,
                 from /data/plugins/onnxruntime/cmake/external/onnx/onnx/onnx_pb.h:52,
                 from /data/plugins/onnxruntime/cmake/external/onnx/onnx/defs/data_type_utils.h:13,
                 from /data/plugins/onnxruntime/cmake/external/onnx/onnx/defs/schema.h:23,
                 from /data/plugins/onnxruntime/include/onnxruntime/core/graph/onnx_protobuf.h:38,
                 from /data/plugins/onnxruntime/include/onnxruntime/core/framework/data_types.h:17,
                 from /data/plugins/onnxruntime/include/onnxruntime/core/framework/tensor.h:16,
                 from /data/plugins/onnxruntime/include/onnxruntime/core/framework/execution_provider.h:12,
                 from /data/plugins/onnxruntime/include/onnxruntime/core/framework/op_kernel.h:13,
                 from /data/plugins/onnxruntime/onnxruntime/contrib_ops/cpu/qlinear_lookup_table.h:7,
                 from /data/plugins/onnxruntime/onnxruntime/contrib_ops/cpu/qlinear_lookup_table.cc:4:
/data/plugins/onnxruntime/cmake/external/protobuf/src/google/protobuf/parse_context.h: In instantiation of ‘const char* google::protobuf::internal::EpsCopyInputStream::AppendUntilEnd(const char*, const A&) [with A = google::protobuf::internal::EpsCopyInputStream::AppendString(const char*, std::string*)::<lambda(const char*, ptrdiff_t)>]’:
/data/plugins/onnxruntime/cmake/external/protobuf/src/google/protobuf/parse_context.h:366:70:   required from here
/data/plugins/onnxruntime/cmake/external/protobuf/src/google/protobuf/stubs/logging.h:188:50: warning: comparison of unsigned expression in ‘>= 0’ is always true [-Wtype-limits]
  188 | #define GOOGLE_DCHECK_GE(A, B) GOOGLE_DCHECK((A) >= (B))
      |                                                  ^
/data/plugins/onnxruntime/cmake/external/protobuf/src/google/protobuf/stubs/logging.h:151:5: note: in definition of macro ‘GOOGLE_LOG_IF’
  151 |   !(CONDITION) ? (void)0 : GOOGLE_LOG(LEVEL)
      |     ^~~~~~~~~
/data/plugins/onnxruntime/cmake/external/protobuf/src/google/protobuf/stubs/logging.h:181:48: note: in expansion of macro ‘GOOGLE_CHECK’
  181 | #define GOOGLE_DCHECK(EXPRESSION) while(false) GOOGLE_CHECK(EXPRESSION)
      |                                                ^~~~~~~~~~~~
/data/plugins/onnxruntime/cmake/external/protobuf/src/google/protobuf/stubs/logging.h:188:32: note: in expansion of macro ‘GOOGLE_DCHECK’
  188 | #define GOOGLE_DCHECK_GE(A, B) GOOGLE_DCHECK((A) >= (B))
      |                                ^~~~~~~~~~~~~
/data/plugins/onnxruntime/cmake/external/protobuf/src/google/protobuf/parse_context.h:351:7: note: in expansion of macro ‘GOOGLE_DCHECK_GE’
  351 |       GOOGLE_DCHECK_GE(chunk_size, static_cast<size_t>(0));
      |       ^~~~~~~~~~~~~~~~
[ 71%] Building CXX object CMakeFiles/onnxruntime_providers.dir/data/plugins/onnxruntime/onnxruntime/contrib_ops/cpu/quantization/attention_quant.cc.o
In file included from /data/plugins/onnxruntime/cmake/external/protobuf/src/google/protobuf/io/coded_stream.h:146,
                 from /data/plugins/onnxruntime/build/Linux/RelWithDebInfo/external/onnx/onnx/onnx-ml.pb.h:23,
                 from /data/plugins/onnxruntime/cmake/external/onnx/onnx/onnx_pb.h:52,
                 from /data/plugins/onnxruntime/cmake/external/onnx/onnx/defs/data_type_utils.h:13,
                 from /data/plugins/onnxruntime/cmake/external/onnx/onnx/defs/schema.h:23,
                 from /data/plugins/onnxruntime/include/onnxruntime/core/graph/onnx_protobuf.h:38,
                 from /data/plugins/onnxruntime/include/onnxruntime/core/framework/data_types.h:17,
                 from /data/plugins/onnxruntime/include/onnxruntime/core/framework/tensor.h:16,
                 from /data/plugins/onnxruntime/include/onnxruntime/core/framework/execution_provider.h:12,
                 from /data/plugins/onnxruntime/include/onnxruntime/core/framework/op_kernel.h:13,
                 from /data/plugins/onnxruntime/onnxruntime/contrib_ops/cpu/qlinear_pool.h:7,
                 from /data/plugins/onnxruntime/onnxruntime/contrib_ops/cpu/qlinear_pool.cc:4:
/data/plugins/onnxruntime/cmake/external/protobuf/src/google/protobuf/parse_context.h: In instantiation of ‘const char* google::protobuf::internal::EpsCopyInputStream::AppendUntilEnd(const char*, const A&) [with A = google::protobuf::internal::EpsCopyInputStream::AppendString(const char*, std::string*)::<lambda(const char*, ptrdiff_t)>]’:
/data/plugins/onnxruntime/cmake/external/protobuf/src/google/protobuf/parse_context.h:366:70:   required from here
/data/plugins/onnxruntime/cmake/external/protobuf/src/google/protobuf/stubs/logging.h:188:50: warning: comparison of unsigned expression in ‘>= 0’ is always true [-Wtype-limits]
  188 | #define GOOGLE_DCHECK_GE(A, B) GOOGLE_DCHECK((A) >= (B))
      |                                                  ^
/data/plugins/onnxruntime/cmake/external/protobuf/src/google/protobuf/stubs/logging.h:151:5: note: in definition of macro ‘GOOGLE_LOG_IF’
  151 |   !(CONDITION) ? (void)0 : GOOGLE_LOG(LEVEL)
      |     ^~~~~~~~~
/data/plugins/onnxruntime/cmake/external/protobuf/src/google/protobuf/stubs/logging.h:181:48: note: in expansion of macro ‘GOOGLE_CHECK’
  181 | #define GOOGLE_DCHECK(EXPRESSION) while(false) GOOGLE_CHECK(EXPRESSION)
      |                                                ^~~~~~~~~~~~
/data/plugins/onnxruntime/cmake/external/protobuf/src/google/protobuf/stubs/logging.h:188:32: note: in expansion of macro ‘GOOGLE_DCHECK’
  188 | #define GOOGLE_DCHECK_GE(A, B) GOOGLE_DCHECK((A) >= (B))
      |                                ^~~~~~~~~~~~~
/data/plugins/onnxruntime/cmake/external/protobuf/src/google/protobuf/parse_context.h:351:7: note: in expansion of macro ‘GOOGLE_DCHECK_GE’
  351 |       GOOGLE_DCHECK_GE(chunk_size, static_cast<size_t>(0));
      |       ^~~~~~~~~~~~~~~~
The bug is not reproducible, so it is likely a hardware or OS problem.
gmake[2]: *** [CMakeFiles/onnxruntime_providers.dir/build.make:1851: CMakeFiles/onnxruntime_providers.dir/data/plugins/onnxruntime/onnxruntime/contrib_ops/cpu/inverse.cc.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....
In file included from /data/plugins/onnxruntime/cmake/external/protobuf/src/google/protobuf/io/coded_stream.h:146,
                 from /data/plugins/onnxruntime/build/Linux/RelWithDebInfo/external/onnx/onnx/onnx-ml.pb.h:23,
                 from /data/plugins/onnxruntime/cmake/external/onnx/onnx/onnx_pb.h:52,
                 from /data/plugins/onnxruntime/cmake/external/onnx/onnx/defs/data_type_utils.h:13,
                 from /data/plugins/onnxruntime/cmake/external/onnx/onnx/defs/schema.h:23,
                 from /data/plugins/onnxruntime/include/onnxruntime/core/graph/onnx_protobuf.h:38,
                 from /data/plugins/onnxruntime/include/onnxruntime/core/framework/data_types.h:17,
                 from /data/plugins/onnxruntime/include/onnxruntime/core/framework/tensor.h:16,
                 from /data/plugins/onnxruntime/include/onnxruntime/core/framework/execution_provider.h:12,
                 from /data/plugins/onnxruntime/include/onnxruntime/core/framework/op_kernel.h:13,
                 from /data/plugins/onnxruntime/onnxruntime/contrib_ops/cpu/quantization/attention_quant.cc:4:
/data/plugins/onnxruntime/cmake/external/protobuf/src/google/protobuf/parse_context.h: In instantiation of ‘const char* google::protobuf::internal::EpsCopyInputStream::AppendUntilEnd(const char*, const A&) [with A = google::protobuf::internal::EpsCopyInputStream::AppendString(const char*, std::string*)::<lambda(const char*, ptrdiff_t)>]’:
/data/plugins/onnxruntime/cmake/external/protobuf/src/google/protobuf/parse_context.h:366:70:   required from here
/data/plugins/onnxruntime/cmake/external/protobuf/src/google/protobuf/stubs/logging.h:188:50: warning: comparison of unsigned expression in ‘>= 0’ is always true [-Wtype-limits]
  188 | #define GOOGLE_DCHECK_GE(A, B) GOOGLE_DCHECK((A) >= (B))
      |                                                  ^
/data/plugins/onnxruntime/cmake/external/protobuf/src/google/protobuf/stubs/logging.h:151:5: note: in definition of macro ‘GOOGLE_LOG_IF’
  151 |   !(CONDITION) ? (void)0 : GOOGLE_LOG(LEVEL)
      |     ^~~~~~~~~
/data/plugins/onnxruntime/cmake/external/protobuf/src/google/protobuf/stubs/logging.h:181:48: note: in expansion of macro ‘GOOGLE_CHECK’
  181 | #define GOOGLE_DCHECK(EXPRESSION) while(false) GOOGLE_CHECK(EXPRESSION)
      |                                                ^~~~~~~~~~~~
/data/plugins/onnxruntime/cmake/external/protobuf/src/google/protobuf/stubs/logging.h:188:32: note: in expansion of macro ‘GOOGLE_DCHECK’
  188 | #define GOOGLE_DCHECK_GE(A, B) GOOGLE_DCHECK((A) >= (B))
      |                                ^~~~~~~~~~~~~
/data/plugins/onnxruntime/cmake/external/protobuf/src/google/protobuf/parse_context.h:351:7: note: in expansion of macro ‘GOOGLE_DCHECK_GE’
  351 |       GOOGLE_DCHECK_GE(chunk_size, static_cast<size_t>(0));
      |       ^~~~~~~~~~~~~~~~
gmake[1]: *** [CMakeFiles/Makefile2:1498: CMakeFiles/onnxruntime_providers.dir/all] Error 2
gmake: *** [Makefile:183: all] Error 2
Traceback (most recent call last):
  File "/data/plugins/onnxruntime/tools/ci_build/build.py", line 2118, in <module>
    sys.exit(main())
  File "/data/plugins/onnxruntime/tools/ci_build/build.py", line 2044, in main
    build_targets(args, cmake_path, build_dir, configs, num_parallel_jobs, args.target)
  File "/data/plugins/onnxruntime/tools/ci_build/build.py", line 1066, in build_targets
    run_subprocess(cmd_args, env=env)
  File "/data/plugins/onnxruntime/tools/ci_build/build.py", line 582, in run_subprocess
    return run(*args, cwd=cwd, capture_stdout=capture_stdout, shell=shell, env=my_env)
  File "/data/plugins/onnxruntime/tools/python/util/run.py", line 41, in run
    completed_process = subprocess.run(
  File "/usr/lib64/python3.8/subprocess.py", line 516, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/usr/bin/cmake', '--build', '/data/plugins/onnxruntime/build/Linux/RelWithDebInfo', '--config', 'RelWithDebInfo', '--', '-j4']' returned non-zero exit status 2.

@snnn
Copy link
Member

snnn commented May 1, 2021

I tried the latest master branch code with gcc 10.2, it's all good except the google protobuf issue you mentioned above.

https://dev.azure.com/onnxruntime/onnxruntime/_build/results?buildId=375345&view=logs&j=7536d2cd-87d4-54fe-4891-bfbbf2741d83&t=14ed71ea-dac1-51ae-e9ca-3f24cf8795d8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants