Skip to content

ROOT doesn't compile with new nlohmann-json version 3.11.0 #11130

@kgizdov

Description

@kgizdov

from #11130 (comment)

[ 91%] Building CXX object roofit/roofitcore/CMakeFiles/RooFitCore.dir/src/TestStatistics/RooSumL.cxx.o
In file included from /build/root/src/root-6.26.06/graf3d/eve7/src/REveBoxSet.cxx:20:
/usr/include/nlohmann/json.hpp:5085:8: error: reference to ‘json’ is ambiguous
 5085 | inline nlohmann::json operator "" _json(const char* s, std::size_t n)
      |        ^~~~~~~~
In file included from /usr/include/nlohmann/detail/meta/type_traits.hpp:22,
                 from /usr/include/nlohmann/detail/exceptions.hpp:22,
                 from /usr/include/nlohmann/detail/conversions/from_json.hpp:23,
                 from /usr/include/nlohmann/adl_serializer.hpp:14,
                 from /usr/include/nlohmann/json.hpp:35:
/usr/include/nlohmann/json_fwd.hpp:61:7: note: candidates are: ‘using json = class nlohmann::json_v3_11_1::basic_json<>’
   61 | using json = basic_json<>;
      |       ^~~~
.....

Original bug report regarding glibc 2.36

Describe the bug

ArchLinux recently upgraded to glibc 2.36, and that resulted in ROOT not compiling with either GCC 11.3.0 or GCC 12.1.1

Expected behaviour

ROOT should compile with glibc 2.36.

To Reproduce

  1. Install glibc 2.36 and relevant compilers
  2. Try to build ROOT
  3. Error during build

Setup

  1. ROOT version: 6.26/06 (or any other version)
  2. Operating system: Arch Linux x86
  3. Build from source with GCC 11.3.0 / 12.1.1

Additional context

An interesting caveat is that it seems ROOT also requires 32-bit specific headers (gnu/stubs-32.h) as well.
Error log:

...
[ 73%] Built target Thread
[ 73%] Generating G__RIO.cxx, ../../lib/libRIO.rootmap
In file included from <built-in>:400:
<command line>:1:9: error: macro name must be an identifier
#define -compilerI/usr/include/c++/12.1.1 1
^
In file included from input_line_3:1:
In file included from /build/root/src/build/etc/cling/lib/clang/9.0.1/include/assert.h:8:
In file included from /usr/include/assert.h:35:
In file included from /usr/include/features.h:514:
/usr/include/gnu/stubs.h:7:11: fatal error: 'gnu/stubs-32.h' file not found
# include <gnu/stubs-32.h>
^~~~~~~~~~~~~~~~
Error: Error loading the default rootcling header files.   

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions