Json.hpp not found when compiling in MacOs

I am trying to compile GitHub - rest-for-physics/framework: The main project containing the core C++ classes defining framework behaviour and primordial analysis and helper tools. It centralises all other rest-for-physics repositories through submodules. in MacOs. Rest-for-Physics compilation is running smoothly in a Linux system.

I compiled ROOT 6.28 without issues on my MacOs.

ROOT Version: 6.28/02
Built for macosx64 on Mar 21 2023, 11:11:48
From tags/v6-28-02@v6-28-02
jgalan@MacBook-Pro-de-Javier build % root-config --cflags
-stdlib=libc++ -pthread -std=c++17 -m64 -I/Users/jgalan/apps/root-6.28.02/install/include

During the REST-for-Physics framework compilation I am getting the following error:

In file included from input_line_9:3:
In file included from /Users/jgalan/rest-framework/source/framework/core/inc/TRestDataSetPlot.h:29:
In file included from /Users/jgalan/rest-framework/source/framework/core/inc/TRestDataSet.h:28:
In file included from /Users/jgalan/apps/root-6.28.02/install/include/ROOT/RDataFrame.hxx:20:
In file included from /Users/jgalan/apps/root-6.28.02/install/include/ROOT/RDF/RDatasetSpec.hxx:19:
In file included from /Users/jgalan/apps/root-6.28.02/install/include/ROOT/RDF/RSample.hxx:14:
/Users/jgalan/apps/root-6.28.02/install/include/ROOT/RDF/RMetaData.hxx:14:10: fatal error: 'nlohmann/json.hpp' file not found
#include <nlohmann/json.hpp>

I am surprised the ROOT compilation could go through without that header, but I am not able to compile REST-for-Physics due to that header not found.

If I try to find this header inside ROOT sources and install directories I see the header exists only in the ROOT source directory, but not on the install one.

galan@MacBook-Pro-de-Javier install % cd ..
jgalan@MacBook-Pro-de-Javier root-6.28.02 % find . -name json.hpp

Perhaps the ROOT compilation used the builtin/json.hpp header but future compilations that use RDataFrame cannot if json.hpp is not installed in the system?

Any clue is welcome!

Hello Javier,

Thanks for the interesting post.
I think your Ansatz is correct.


I see, I had to add /usr/local/include to the cmake include directories, so that brew packages are identified.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.