Opened 5 years ago

Closed 5 years ago

#57735 closed defect (fixed)

Gate: fatal error: 'string_view' file not found

Reported by: mojca (Mojca Miklavec) Owned by: mojca (Mojca Miklavec)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: cjones051073 (Chris Jones), kencu (Ken)
Port: gate

Description

Gate build on the buildbot is currently failing:

/usr/bin/clang++  -DG4INTY_USE_QT -DG4UI_USE -DG4UI_USE_QT -DG4UI_USE_TCSH -DG4VERBOSE -DG4VIS_USE -DG4VIS_USE_OPENGL -DG4VIS_USE_OPENGLQT -DG4_STORE_TRAJECTORY -F//System/Library/Frameworks -I/opt/local/libexec/root6/include/root -I/opt/local/include/libxml2 -I/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_science_gate/gate/work/build -I/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_science_gate/gate/work/Gate-8.1.p01/source/arf/include -I/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_science_gate/gate/work/Gate-8.1.p01/source/geometry/include -I/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_science_gate/gate/work/Gate-8.1.p01/source/physics/include -I/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_science_gate/gate/work/Gate-8.1.p01/source/digits_hits/include -I/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_science_gate/gate/work/Gate-8.1.p01/source/general/include -I/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_science_gate/gate/work/Gate-8.1.p01/source/externals/clhep/include -I/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_science_gate/gate/work/Gate-8.1.p01/source/externals/itk-mhd -I/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_science_gate/gate/work/Gate-8.1.p01/source/externals/itk-mhd/itkzlib -I/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_science_gate/gate/work/Gate-8.1.p01/source/externals/itk-mhd/src -I/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_science_gate/gate/work/build/itk-mhd -isystem /opt/local/include/Geant4/Geant4.10.4/Geant4 -isystem /opt/local/include -isystem /opt/local/libexec/qt4/include -isystem /opt/local/libexec/qt4/include/QtCore -isystem /opt/local/libexec/qt4/include/QtGui -isystem /opt/local/libexec/qt4/include/QtOpenGL  -pipe -Os -stdlib=libc++ -W -Wall -pedantic -Wno-non-virtual-dtor -Wno-long-long -Wwrite-strings -Wpointer-arith -Woverloaded-virtual -Wno-variadic-macros -Wshadow -pipe -Qunused-arguments -stdlib=libc++ -DG4USE_STD11 -std=c++11 -Wno-shadow -std=c++11 -arch x86_64 -mmacosx-version-min=10.9   -std=c++11 -o CMakeFiles/Gate.dir/source/arf/src/GateARFSD.cc.o -c /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_science_gate/gate/work/Gate-8.1.p01/source/arf/src/GateARFSD.cc
In file included from /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_science_gate/gate/work/Gate-8.1.p01/source/arf/src/GateARFTableMgr.cc:15:
In file included from /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_science_gate/gate/work/Gate-8.1.p01/source/arf/include/GateARFTable.hh:17:
In file included from /opt/local/libexec/root6/include/root/TROOT.h:28:
In file included from /opt/local/libexec/root6/include/root/TDirectory.h:25:
In file included from /opt/local/libexec/root6/include/root/TNamed.h:26:
In file included from /opt/local/libexec/root6/include/root/TString.h:28:
/opt/local/libexec/root6/include/root/ROOT/RStringView.hxx:19:10: fatal error: 'string_view' file not found
#include <string_view>
         ^

The builds on older systems are broken because root6 doesn't compile there.

Change History (10)

comment:2 Changed 5 years ago by mojca (Mojca Miklavec)

I assume that's because C++17 is needed. 10.13 seems to compile this fine, while it fails on 10.11 and earlier. I assume I need to include the cxx17 PortGroup :)

comment:3 Changed 5 years ago by kencu (Ken)

It's a big piece of software, so exploring all the workable combinations could be a large project. However, on 10.9, you can have success:

$ port -v installed gate
The following ports are currently installed:
  gate @8.1.p01_0+geant4104+qt4 (active) platform='darwin 13' archs='x86_64' date='2018-12-06T17:28:13-0800'

if you force the compiler to be macports-clang-7.0, and if you change -std=c++11 to -std=c++17 in the top-level CMakeLists.txt.

Still, a -std=c++11 still slips into the build line from somewhere (some portgroup?), but it doesn't seem to cause the build to fail.

/opt/local/bin/clang++-mp-7.0  -DG4INTY_USE_QT -DG4UI_USE -DG4UI_USE_QT -DG4UI_USE_TCSH -DG4VERBOSE -DG4VIS_USE -DG4VIS_USE_OPENGL -DG4VIS_USE_OPENGLQT -DG4_STORE_TRAJECTORY -F//System/Library/Frameworks -I/opt/local/libexec/root6/include/root -I/opt/local/include/libxml2 -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_science_gate/gate/work/build -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_science_gate/gate/work/Gate-8.1.p01/source/arf/include -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_science_gate/gate/work/Gate-8.1.p01/source/geometry/include -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_science_gate/gate/work/Gate-8.1.p01/source/physics/include -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_science_gate/gate/work/Gate-8.1.p01/source/digits_hits/include -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_science_gate/gate/work/Gate-8.1.p01/source/general/include -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_science_gate/gate/work/Gate-8.1.p01/source/externals/clhep/include -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_science_gate/gate/work/Gate-8.1.p01/source/externals/itk-mhd -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_science_gate/gate/work/Gate-8.1.p01/source/externals/itk-mhd/itkzlib -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_science_gate/gate/work/Gate-8.1.p01/source/externals/itk-mhd/src -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_science_gate/gate/work/build/itk-mhd -isystem /opt/local/include/Geant4/Geant4.10.4/Geant4 -isystem /opt/local/include -isystem /opt/local/libexec/qt4/include -isystem /opt/local/libexec/qt4/include/QtCore -isystem /opt/local/libexec/qt4/include/QtGui -isystem /opt/local/libexec/qt4/include/QtOpenGL  -pipe -Os -stdlib=libc++ -W -Wall -pedantic -Wno-non-virtual-dtor -Wno-long-long -Wwrite-strings -Wpointer-arith -Woverloaded-virtual -Wno-variadic-macros -Wshadow -pipe -Qunused-arguments -stdlib=libc++ -DG4USE_STD11 -std=c++11 -Wno-shadow -std=c++17 -arch x86_64 -mmacosx-version-min=10.9   -std=c++11 -o CMakeFiles/Gate.dir/source/physics/src/GateeMultipleScatteringPB.cc.o -c /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_science_gate/gate/work/Gate-8.1.p01/source/physics/src/GateeMultipleScatteringPB.cc

Other macports-clang compilers may work as well; haven't tested them as yet.

Last edited 5 years ago by kencu (Ken) (previous) (diff)

comment:4 Changed 5 years ago by kencu (Ken)

I think that other -std=c++11 is getting in there from this config call:

$ /opt/local/libexec/Geant4/Geant4.10.4/geant4-config --cflags
-DG4VIS_USE_OPENGL -DG4UI_USE_TCSH -DG4INTY_USE_QT -DG4UI_USE_QT -DG4VIS_USE_OPENGLQT -I/opt/local/libexec/qt4/include/QtCore -I/opt/local/libexec/qt4/include/QtGui -I/opt/local/libexec/qt4/include/QtOpenGL -pipe -Os -stdlib=libc++ -W -Wall -pedantic -Wno-non-virtual-dtor -Wno-long-long -Wwrite-strings -Wpointer-arith -Woverloaded-virtual -Wno-variadic-macros -Wshadow -pipe -Qunused-arguments -stdlib=libc++ -DG4USE_STD11 -std=c++11 -I/opt/local/include/Geant4/Geant4.10.4/Geant4

at this moment I'm not sure how you can get that out of there -- although it seems to work if there a previous -std=c++17 in the build line anyway.

comment:5 Changed 5 years ago by kencu (Ken)

geant4-config is just a shell script. You can change it as you wish to, with a text editor. Perhaps there is a way to process it's output on the fly as well -- you'd know about that better than I do.

comment:6 Changed 5 years ago by cjones051073 (Chris Jones)

Hacking geant4-config after the fact is I think not the way to go. Instead I would first look to updating the geant4 build to enable cxx17 there. Then, geant4-config should automatically reflect this.

Aslo, take a look at the compiler settings in root6. There I believe I already force the use of MPs clang 7 on 10.12 and older, for essentially the same reason as here.

comment:7 Changed 5 years ago by cjones051073 (Chris Jones)

Btw Is there a cxx17 portgroup now ?

comment:8 Changed 5 years ago by kencu (Ken)

BTW, you actually don't have to hack geant4-config, in the end -- it works as is.

Seems like the root6, geant4, and gate ports might all need to decide on the c++ standard they want to share, more or less together, so they'll be in sync.

comment:9 Changed 5 years ago by mojca (Mojca Miklavec)

If I install root6 -cxx17, Gate compiles out of the box and works correctly.

I need to figure out how to properly supply the standard to Gate configuration. I believe that hardcoding CXXFLAGS to a particular standard is considered a bad idea.

comment:10 Changed 5 years ago by mojca (Mojca Miklavec)

Resolution: fixed
Status: assignedclosed

In 4cefa9951959e4aa00ce7f3fb12a2c608e414fe3/macports-ports (master):

gate: hardcode C++17 standard

Ugly solution, but well ...

Closes: #57735

Note: See TracTickets for help on using tickets.