Changes between Initial Version and Version 2 of Ticket #65404


Ignore:
Timestamp:
Jul 14, 2022, 10:15:39 PM (22 months ago)
Author:
ryandesign (Ryan Carsten Schmidt)
Comment:

Has duplicate #65486.

The simple solution I was envisioning was

  • using compiler.cxx_standard 2014 to get MacPorts to pick a C++14-capable compiler, and
  • using configure.cxxflags-append -std=c++14 to tell the compiler to use C++14 mode.

But I envisioned that before looking at the Portfile, and I now see that it

  • uses compiler.blacklist and compiler.whitelist to, according to a comment, force the same compiler as root6, yet this code does not match what is currently in the root6 portfile, and
  • uses a patch and reinplace to replace the -std=c++11 flag hardcoded in the CMakeLists.txt with -std=c++17.

Usually the use of compiler.whitelist is not desired because it overrides anything in compiler.blacklist, and compiler.blacklist should usually be avoided in favor of compiler.cxx_standard if all you're doing is requesting a compiler supporting a particular C++ standard.

It's unclear to me why the -std=c++17 flag isn't actually being used then since the CMakeLists.txt says to use it. In fact it is being used, but two -std=c++11 flags are also being used, one before and one after -std=c++17, and the last one wins. I'm not sure where those -std=c++11 flags are coming from. Possibly from geant4.10.5.

The root6 portfile currently contains code that uses C++17 on macOS 10.14 and later and C++14 otherwise. If that distinction is necessary, then maybe the gate port should do the same, but it's not ideal for the gate port (and any other ports that use root6) to have to duplicate this compiler-selection-and-flag-setting code and keep it in sync with the root6 portfile.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #65404

    • Property Owner set to mojca
    • Property Cc mojca removed
    • Property Status changed from new to assigned
    • Property Summary changed from gate-8.2_2+geant4105- Failed to build gate: command execution failed to gate @8.2_2+geant4105: error: "ROOT requires support for C++14 or higher."
  • Ticket #65404 – Description

    initial v2  
    11Following the command {{{port install gate}}} I receive a build error.
    22
    3 {{{--->  Building gate }}}                                     
    4 {{{Error: Failed to build gate: command execution failed}}}
     3{{{
     4--->  Building gate
     5Error: Failed to build gate: command execution failed
     6}}}
    57
    68The main.log file is attached. I'm using osx monterey 12.4.