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

Build failure with gcc 11 on CentOS 7. #12393

Closed
xkszltl opened this issue Jul 30, 2022 · 1 comment · Fixed by #12394
Closed

Build failure with gcc 11 on CentOS 7. #12393

xkszltl opened this issue Jul 30, 2022 · 1 comment · Fixed by #12394

Comments

@xkszltl
Copy link
Contributor

xkszltl commented Jul 30, 2022

Describe the bug

This is specific to gcc-11 on CentOS 7 (devtoolset-11).
Works on Debian 11 with gcc-10 and Ubuntu 18.04 with gcc-8.

Seems to be a new regression on v1.12.0 as we were able to build v1.11 before.

[1/8] ccache /opt/rh/devtoolset-11/root/usr/bin/g++ -DCPUINFO_SUPPORTED_PLATFORM=1 -DEIGEN_MPL2_ONLY -DEIGEN_USE_THREADS -DENABLE_CPU_FP16_TRAINING_OPS -DENABLE_LANGUAGE_INTEROP_OPS -DNSYNC_ATOMIC_CPP11 -DONNX_ML=1 -DONNX_NAMESPACE=onnx -DORT_RUN_EXTERNAL_ONNX_TESTS -DPLATFORM_POSIX -DUSE_CUDA=1 -DUSE_DNNL=1 -I/tmp/scratch/onnxruntime/include/onnxruntime -I/tmp/scratch/onnxruntime/include/onnxruntime/core/session -I/tmp/scratch/onnxruntime/cmake/external/nsync/public -I/tmp/scratch/onnxruntime/build -I/tmp/scratch/onnxruntime/onnxruntime -I/tmp/scratch/onnxruntime/build/_deps/abseil_cpp-src -I/tmp/scratch/onnxruntime/onnxruntime/test/util/include -I/tmp/scratch/onnxruntime/cmake/external/eigen -I/tmp/scratch/onnxruntime/cmake/external/SafeInt -I/tmp/scratch/onnxruntime/cmake/external/pytorch_cpuinfo/include -I/tmp/scratch/onnxruntime/cmake/external/onnx -I/tmp/scratch/onnxruntime/build/external/onnx -I/tmp/scratch/onnxruntime/cmake/external/flatbuffers/include -I/tmp/scratch/onnxruntime/cmake/external/pytorch_cpuinfo/deps/clog/include -fdebug-prefix-map='/tmp/scratch'='/usr/local/src' -g -march=haswell -mtune=generic -ffunction-sections -fdata-sections -DCPUINFO_SUPPORTED -O3 -DNDEBUG -DGSL_UNENFORCED_ON_CONTRACT_VIOLATION -flto -fno-fat-lto-objects -fPIE -Wall -Wextra -Wno-deprecated-copy -Wno-nonnull-compare -Wno-error=comment -std=gnu++17 -MD -MT CMakeFiles/onnx_test_runner.dir/tmp/scratch/onnxruntime/onnxruntime/test/onnx/main.cc.o -MF CMakeFiles/onnx_test_runner.dir/tmp/scratch/onnxruntime/onnxruntime/test/onnx/main.cc.o.d -o CMakeFiles/onnx_test_runner.dir/tmp/scratch/onnxruntime/onnxruntime/test/onnx/main.cc.o -c /tmp/scratch/onnxruntime/onnxruntime/test/onnx/main.cc
FAILED: CMakeFiles/onnx_test_runner.dir/tmp/scratch/onnxruntime/onnxruntime/test/onnx/main.cc.o 
ccache /opt/rh/devtoolset-11/root/usr/bin/g++ -DCPUINFO_SUPPORTED_PLATFORM=1 -DEIGEN_MPL2_ONLY -DEIGEN_USE_THREADS -DENABLE_CPU_FP16_TRAINING_OPS -DENABLE_LANGUAGE_INTEROP_OPS -DNSYNC_ATOMIC_CPP11 -DONNX_ML=1 -DONNX_NAMESPACE=onnx -DORT_RUN_EXTERNAL_ONNX_TESTS -DPLATFORM_POSIX -DUSE_CUDA=1 -DUSE_DNNL=1 -I/tmp/scratch/onnxruntime/include/onnxruntime -I/tmp/scratch/onnxruntime/include/onnxruntime/core/session -I/tmp/scratch/onnxruntime/cmake/external/nsync/public -I/tmp/scratch/onnxruntime/build -I/tmp/scratch/onnxruntime/onnxruntime -I/tmp/scratch/onnxruntime/build/_deps/abseil_cpp-src -I/tmp/scratch/onnxruntime/onnxruntime/test/util/include -I/tmp/scratch/onnxruntime/cmake/external/eigen -I/tmp/scratch/onnxruntime/cmake/external/SafeInt -I/tmp/scratch/onnxruntime/cmake/external/pytorch_cpuinfo/include -I/tmp/scratch/onnxruntime/cmake/external/onnx -I/tmp/scratch/onnxruntime/build/external/onnx -I/tmp/scratch/onnxruntime/cmake/external/flatbuffers/include -I/tmp/scratch/onnxruntime/cmake/external/pytorch_cpuinfo/deps/clog/include -fdebug-prefix-map='/tmp/scratch'='/usr/local/src' -g -march=haswell -mtune=generic -ffunction-sections -fdata-sections -DCPUINFO_SUPPORTED -O3 -DNDEBUG -DGSL_UNENFORCED_ON_CONTRACT_VIOLATION -flto -fno-fat-lto-objects -fPIE -Wall -Wextra -Wno-deprecated-copy -Wno-nonnull-compare -Wno-error=comment -std=gnu++17 -MD -MT CMakeFiles/onnx_test_runner.dir/tmp/scratch/onnxruntime/onnxruntime/test/onnx/main.cc.o -MF CMakeFiles/onnx_test_runner.dir/tmp/scratch/onnxruntime/onnxruntime/test/onnx/main.cc.o.d -o CMakeFiles/onnx_test_runner.dir/tmp/scratch/onnxruntime/onnxruntime/test/onnx/main.cc.o -c /tmp/scratch/onnxruntime/onnxruntime/test/onnx/main.cc
/tmp/scratch/onnxruntime/onnxruntime/test/onnx/main.cc: In function ‘TestTolerances {anonymous}::LoadTestTolerances(bool, bool)’:
/tmp/scratch/onnxruntime/onnxruntime/test/onnx/main.cc:76:52: error: no matching function for call to ‘nlohmann::basic_json<>::parse(std::ifstream&, std::nullptr_t, bool, bool)’
   76 |   const auto overrides_json = nlohmann::json::parse(
      |                               ~~~~~~~~~~~~~~~~~~~~~^
   77 |       overrides_ifstream,
      |       ~~~~~~~~~~~~~~~~~~~                           
   78 |       /*cb=*/nullptr, /*allow_exceptions=*/true, /*ignore_comments=*/true);
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /tmp/scratch/onnxruntime/onnxruntime/test/onnx/main.cc:26:
/usr/include/nlohmann/json.hpp:18990:23: note: candidate: ‘template<class IteratorType, typename std::enable_if<std::is_base_of<std::random_access_iterator_tag, typename std::iterator_traits<_Iter>::iterator_category>::value, int>::type <anonymous> > 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 = IteratorType; typename std::enable_if<std::is_base_of<std::random_access_iterator_tag, typename std::iterator_traits<_Iter>::iterator_category>::value, int>::type <anonymous> = <anonymous>; ObjectType = std::map; ArrayType = std::vector; StringType = std::basic_string<char>; BooleanType = bool; NumberIntegerType = long int; NumberUnsignedType = long unsigned int; NumberFloatType = double; AllocatorType = std::allocator; JSONSerializer = nlohmann::adl_serializer]’
18990 |     static basic_json parse(IteratorType first, IteratorType last,
      |                       ^~~~~
/usr/include/nlohmann/json.hpp:18990:23: note:   template argument deduction/substitution failed:
/tmp/scratch/onnxruntime/onnxruntime/test/onnx/main.cc:76:52: note:   deduced conflicting types for parameter ‘IteratorType’ (‘std::basic_ifstream<char>’ and ‘std::nullptr_t’)
   76 |   const auto overrides_json = nlohmann::json::parse(
      |                               ~~~~~~~~~~~~~~~~~~~~~^
   77 |       overrides_ifstream,
      |       ~~~~~~~~~~~~~~~~~~~                           
   78 |       /*cb=*/nullptr, /*allow_exceptions=*/true, /*ignore_comments=*/true);
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /tmp/scratch/onnxruntime/onnxruntime/test/onnx/main.cc:26:
/usr/include/nlohmann/json.hpp:18859:23: note: candidate: ‘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(nlohmann::detail::input_adapter&&, nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer>::parser_callback_t, bool) [with ObjectType = std::map; ArrayType = std::vector; StringType = std::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<>&)>]’
18859 |     static basic_json parse(detail::input_adapter&& i,
      |                       ^~~~~
/usr/include/nlohmann/json.hpp:18859:23: note:   candidate expects 3 arguments, 4 provided
ninja: build stopped: subcommand failed.

Urgency

We're asked for a build refresh to include ort 1.12 for new feature (large data loading), this is one of the blocker.

System information

  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): CentOS 7
  • ONNX Runtime installed from (source or binary): source
  • ONNX Runtime version: v1.12
  • Python version: 3.6/3.8
  • GCC/Compiler version (if compiling from source): gcc 11
  • CUDA/cuDNN version: 11.7

To Reproduce

Build arg:

@xkszltl
Copy link
Contributor Author

xkszltl commented Jul 30, 2022

@garymm for awareness.
This is introduced in:

Somehow the build system picked up the /usr/include/nlohmann/json.hpp (from json-devel-3.6.1-2.el7.x86_64) installed in system, probably because of onnxruntime_PREFER_SYSTEM_LIB, but the code is too tight on version compatibility.

@xkszltl xkszltl changed the title Build failure with gcc 11. Build failure with gcc 11 on CentOS 7. Jul 30, 2022
xkszltl added a commit to xkszltl/onnxruntime that referenced this issue Jul 30, 2022
This is required on CentOS 7 if using distro-provided json-devel 3.6.1.

Regression introduced in:
- microsoft#11775

Related upstream commit:
- nlohmann/json@74520d8

Fixed microsoft#12393
xkszltl added a commit to xkszltl/onnxruntime that referenced this issue Aug 8, 2022
This is required on CentOS 7 if using distro-provided json-devel 3.6.1.

Regression introduced in:
- microsoft#11775

Related upstream commit:
- nlohmann/json@74520d8

Fixed microsoft#12393
skottmckay pushed a commit that referenced this issue Jan 17, 2023
This is required on CentOS 7 if using distro-provided json-devel 3.6.1.

Regression introduced in:
- #11775

Related upstream commit:
-
nlohmann/json@74520d8

Fixed #12393
xkszltl added a commit to xkszltl/onnxruntime that referenced this issue Feb 28, 2023
This is required on CentOS 7 if using distro-provided json-devel 3.6.1.

Regression introduced in:
- microsoft#11775

Related upstream commit:
- nlohmann/json@74520d8

Fixed microsoft#12393
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.

1 participant