Compilation error on macOS 15


ROOT Version: 6.36.04
Platform: macOS 15.6.1
Compiler: Apple clang version 17.0.0 (clang-1700.3.19.1)


I’m trying to compile the ROOT 6.36.04 with the following cmake configuration:

cmake -D roofit=ON -D Python3_ROOT_DIR=/Users/dinardo/Homebrew/Cellar/python@3.11/3.11.7/Frameworks/Python.framework/Versions/3.11/ -D CMAKE_CXX_STANDARD=17 -D CMAKE_INSTALL_PREFIX=/Users/dinardo/rootDir/myInstall/ ../

Here are the error messages:

/Users/dinardo/root_v6.36.04/main/src/hadd.cxx:814:14: error: no member named ‘SetErrorBehavior’ in ‘TFileMerger’814 |       merger.SetErrorBehavior(args.fSkipErrors ? TFileMerger::EErrorBehavior::kSkipOnError|       ~~~~~~ ^/Users/dinardo/root_v6.36.04/main/src/hadd.cxx:814:63: error: no member named ‘EErrorBehavior’ in ‘TFileMerger’814 |       merger.SetErrorBehavior(args.fSkipErrors ? TFileMerger::EErrorBehavior::kSkipOnError|                                                  ~~~~~~~~~~~~~^/Users/dinardo/root_v6.36.04/main/src/hadd.cxx:815:63: error: no member named ‘EErrorBehavior’ in ‘TFileMerger’815 |                                                : TFileMerger::EErrorBehavior::kFailOnError);|                                                  ~~~~~~~~~~~~~^

and

/Users/dinardo/root_v6.36.04/tree/treeplayer/src/TChainIndex.cxx:120:61: error: too many arguments to function call, expected at most 2, have 4
  120 |          chain->GetTree()->BuildIndex(majorname, minorname, long64major, long64minor);
      |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~                       ^~~~~~~~~~~~~~~~~~~~~~~~
/Users/dinardo/root/myBuild/include/TTree.h:432:28: note: 'BuildIndex' declared here
  432 |    virtual Int_t           BuildIndex(const char *majorname, const char *minorname = "0");
      |                            ^          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[

Let me know.

Kind regards,

  • Mauro.

Try completely erasing /Users/dinardo/root/myBuild/include
and restart the build.

Thanks for the suggestion, but I get the same errors.

Can you recheck that you really have 6.36.04 ?

If I download https://github.com/root-project/root/releases/download/v6-36-04/root_v6.36.04.source.tar.gz

I see in file TTree.h:432
virtual Int_t BuildIndex(const char *majorname, const char *minorname = “0”, bool long64major = false, bool long64minor = false);

The same with: https://root.cern/download/root_v6.36.04.source.tar.gz

In contrast, you seem to have an outdated file:

TTree.h:432:28:

432 | virtual Int_t BuildIndex(const char *majorname, const char *minorname = "0");

To Download the version I’m using use the command:

git clone --branch latest-stable --depth=1 https://github.com/root-project/root.git` rootDir`

Is there another way to do it “more” properly?

That’s also correct. If I do that on a clean folder, I see:

grep BuildIndex ./rootDir/tree/tree/inc/TTree.h | grep virtual
virtual Int_t BuildIndex(const char *majorname, const char *minorname = “0”, bool long64major = false, bool long64minor = false);

compare to the error log you were showing, which said

virtual Int_t           BuildIndex(const char *majorname, const char *minorname = "0");

Try removing everything (source, build and install folders) and starting a clean build.

I get the same error, also because when I download it from git the directory is brand new already.

Can you post here the result of:

sudo updatedb
locate TTree.h

And then:

grep BuildIndex /your/file1/TTree.h | grep virtual

etc for each found occurrence of locate.

Hello @mauroroot,

this looks like there might be an older root installed in a system directory, and the compiler is finding its headers first. Could this be the case?
I think the above post is looking in the same direction.

Dear All,
many thanks for your suggestions. Indeed that was the case, somehow CMake was looking into another ROOT installation.

I fixed that, and now it’s compiling like a charm.

Sorry for the noise.

Kind regards.

1 Like