Gate @8.2_2+geant4105: error: "ROOT requires support for C++14 or higher."

I am a beginner and trying to install virtual gate on macOS M1 by using macports i.e. sudo port install gate. However I am getting following error

/opt/local/libexec/root6/include/root/ROOT/RConfig.hxx:48:4: error: “ROOT requires support for C++14 or higher.”

error “ROOT requires support for C++14 or higher.”

/opt/local/libexec/root6/include/root/ROOT/RConfig.hxx:50:5: error: “Pass -std=c++14 as compiler argument.”

error “Pass -std=c++14 as compiler argument.”

I have the latest compiler on macOS and it should be able to build C++17 but for some reason it is not working. I asked this question on macports forum as well but did’nt get any solution. I would appreciate it if somebody can please help me with this or if there is a way to install gate and root etc on Mac M1 please let me know.
_ROOT Version:_6
Platform: MacOs_13.0.1
_Compiler:_Clang 14

Hi @stabbass,

I guess it would help if you attach the whole log of the build. It seems that, for some reason, either it is not picking the right compiler, or your compiler defaults to C++ < 14 and it is not being overridden by a configuration option.

I guess that you get the same result if you only install the ROOT package via macports (see here)?


P.S. maybe you can also ask this question here:

Thank You @jalopezg. Is there a way to attach the file with message. I tried using “upload” button to share the complete log file but a message pops up on this forum saying “An error occurred: Sorry, new users can’t put links in posts”.

I haven’t tried to install root independently with ports but I can give it a try.

I cleaned the ports and reinstall the root 6 using sudo port install root6 and it worked. I have now root 6.26/10 available on my Mac but when I try to install Gate . It still returns the same error. Any help please

Could you try uploading the build log now?

Most probably it’s missing a -DCMAKE_CXX_STANDARD=14 somewhere. I guess someone could also help if you ask the question here:


Yes, Please find the attached building log
main_root.txt (333.3 KB)

Find and contact the “Gate” support line/forum and/or your colleagues (e.g., who are familiar with the “Gate”) and/or your supervisor.

You need to have both tools (ROOT and Geant4) built with the same compiler and using the same C++ standard (i.e., C++11 or C++14 or C++17):

ROOT Forum → Search → Geant4 C++ standard

Hi @stabbass,

The build log shows that -std=c++11 is part of the command line when compiling source file /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_science_gate/gate/work/Gate-8.2/source/arf/src/ This file indirectly includes some ROOT headers; however, by policy, minimum C++ standard to build ROOT is C++14.

This means that probably the most straightforward way of making it work is to build Gate using C++14. Follow-up on #65404 (gate @8.2_2+geant4105: error: "ROOT requires support for C++14 or higher.") – MacPorts.