Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • nptool nptool
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1
    • Issues 1
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • np
  • nptoolnptool
  • Issues
  • #65
Closed
Open
Issue created Jun 06, 2021 by Mehdi@sid-ahmed.megherbi

Errors during compilation, due to C++ standard ?

Hi

I'm using ubuntu 20.04. I compiled from source latest ROOT version and it was done (by default) with C++14 standard, so I forced compilation with C++14 also for GEANT4. How I can check/change the C++ standard used for nptool compilation ? here are the arguments I used :

sudo cmake -Dgdml=ON -Dminuit2=ON -DCMAKE_INSTALL_PREFIX=/home/dz/products/ROOT6.24.00/ /home/dz/products/root-6.24.00/

sudo cmake -DCMAKE_INSTALL_PREFIX=../GEANT4.10.07.p01 -DGEANT4_BUILD_MULTITHREADED=ON -DGEANT4_INSTALL_DATA=ON -DGEANT4_USE_QT=ON -DGEANT4_USE_RAYTRACER_X11=OFF -DGEANT4_USE_OPENGL_X11=ON -DGEANT4_USE_GDML=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo -DGEANT4_USE_XM=OFF -DGEANT4_ENABLE_TESTING=OFF -DGEANT4_BUILD_CXXSTD=14 -DGEANT4_USE_RAYTRACER_X11=OFF -DGEANT4_USE_SYSTEM_CLHEP=OFF -DGEANT4_USE_SYSTEM_ZLIB=OFF ../geant4.10.07.p01

When I execute "make -j8 install" I get these errors :

[ 0%] Building CXX object Core/CMakeFiles/NPCore.dir/NPRandom.cxx.o In file included from /home/dz/products/ROOT6.24.00/include/TString.h:29, from /home/dz/products/ROOT6.24.00/include/TNamed.h:26, from /home/dz/products/ROOT6.24.00/include/TRandom.h:25, from /home/dz/products/ROOT6.24.00/include/TRandom1.h:25, from /home/dz/products/nptool/NPLib/Core/NPRandom.h:29, from /home/dz/products/nptool/NPLib/Core/NPRandom.cxx:22: /home/dz/products/ROOT6.24.00/include/ROOT/RStringView.hxx:32:37: error: ‘experimental’ in namespace ‘std’ does not name a type 32 | using basic_string_view = ::std::experimental::basic_string_view<_CharT,_Traits>; | ^~~~~~~~~~~~ /home/dz/products/ROOT6.24.00/include/ROOT/RStringView.hxx:35:12: error: ‘basic_string_view’ does not name a type 35 | typedef basic_string_view string_view; | ^~~~~~~~~~~~~~~~~ /home/dz/products/ROOT6.24.00/include/ROOT/RStringView.hxx:36:12: error: ‘basic_string_view’ does not name a type 36 | typedef basic_string_view<char16_t> u16string_view; | ^~~~~~~~~~~~~~~~~ /home/dz/products/ROOT6.24.00/include/ROOT/RStringView.hxx:37:12: error: ‘basic_string_view’ does not name a type 37 | typedef basic_string_view<char32_t> u32string_view; | ^~~~~~~~~~~~~~~~~ /home/dz/products/ROOT6.24.00/include/ROOT/RStringView.hxx:38:12: error: ‘basic_string_view’ does not name a type 38 | typedef basic_string_view<wchar_t> wstring_view; | ^~~~~~~~~~~~~~~~~ /home/dz/products/ROOT6.24.00/include/ROOT/RStringView.hxx:48:28: error: ‘string_view’ is not a member of ‘std’ 48 | inline double stod(std::string_view str, size_t pos) | ^~~~~~~~~~~ /home/dz/products/ROOT6.24.00/include/ROOT/RStringView.hxx:48:28: note: ‘std::string_view’ is only available from C++17 onwards /home/dz/products/ROOT6.24.00/include/ROOT/RStringView.hxx:48:52: error: expected primary-expression before ‘’ token 48 | inline double stod(std::string_view str, size_t *pos) | ^ /home/dz/products/ROOT6.24.00/include/ROOT/RStringView.hxx:48:53: error: ‘pos’ was not declared in this scope; did you mean ‘pow’? 48 | inline double stod(std::string_view str, size_t *pos) | ^~~ | pow /home/dz/products/ROOT6.24.00/include/ROOT/RStringView.hxx:48:56: error: expression list treated as compound expression in initializer [-fpermissive] 48 | inline double stod(std::string_view str, size_t *pos) | ^ /home/dz/products/ROOT6.24.00/include/ROOT/RStringView.hxx:65:56: error: ‘std::string_view’ has not been declared 65 | inline std::string &operator+=(std::string &left, std::string_view right) | ^~~~~~~~~~~ /home/dz/products/ROOT6.24.00/include/ROOT/RStringView.hxx: In function ‘std::string& std::__ROOT::operator+=(std::string&, int)’: /home/dz/products/ROOT6.24.00/include/ROOT/RStringView.hxx:67:29: error: request for member ‘data’ in ‘right’, which is of non-class type ‘int’ 67 | return left.append(right.data(), right.size()); | ^~~~ /home/dz/products/ROOT6.24.00/include/ROOT/RStringView.hxx:67:43: error: request for member ‘size’ in ‘right’, which is of non-class type ‘int’ 67 | return left.append(right.data(), right.size()); | ^~~~ /home/dz/products/ROOT6.24.00/include/ROOT/RStringView.hxx: At global scope: /home/dz/products/ROOT6.24.00/include/ROOT/RStringView.hxx:84:17: error: expected type-specifier 84 | operator std::string_view() const { return std::string_view(fData,fLength); } | ^~~ In file included from /home/dz/products/ROOT6.24.00/include/TNamed.h:26, from /home/dz/products/ROOT6.24.00/include/TRandom.h:25, from /home/dz/products/ROOT6.24.00/include/TRandom1.h:25, from /home/dz/products/nptool/NPLib/Core/NPRandom.h:29, from /home/dz/products/nptool/NPLib/Core/NPRandom.cxx:22: /home/dz/products/ROOT6.24.00/include/TString.h:115:13: error: expected type-specifier 115 | operator std::string_view() const { return std::string_view(Data(),fExtent); } | ^~~ /home/dz/products/ROOT6.24.00/include/TString.h:280:32: error: ‘string_view’ in namespace ‘std’ does not name a type 280 | explicit TString(const std::string_view &sub); | ^~~~~~~~~~~ /home/dz/products/ROOT6.24.00/include/TString.h:280:27: note: ‘std::string_view’ is only available from C++17 onwards 280 | explicit TString(const std::string_view &sub); | ^~~ /home/dz/products/ROOT6.24.00/include/TString.h:317:37: error: ‘string_view’ in namespace ‘std’ does not name a type 317 | TString &operator=(const std::string_view &s); | ^~~~~~~~~~~ /home/dz/products/ROOT6.24.00/include/TString.h:317:32: note: ‘std::string_view’ is only available from C++17 onwards 317 | TString &operator=(const std::string_view &s); | ^~~ /home/dz/products/ROOT6.24.00/include/TString.h:444:9: error: ‘string_view’ in namespace ‘std’ does not name a type 444 | std::string_view View() const { return std::string_view(GetPointer(),Length()); } | ^~~~~~~~~~~ /home/dz/products/ROOT6.24.00/include/TString.h:444:4: note: ‘std::string_view’ is only available from C++17 onwards 444 | std::string_view View() const { return std::string_view(GetPointer(),Length()); } | ^~~ In file included from /home/dz/products/ROOT6.24.00/include/TNamed.h:26, from /home/dz/products/ROOT6.24.00/include/TRandom.h:25, from /home/dz/products/ROOT6.24.00/include/TRandom1.h:25, from /home/dz/products/nptool/NPLib/Core/NPRandom.h:29, from /home/dz/products/nptool/NPLib/Core/NPRandom.cxx:22: /home/dz/products/ROOT6.24.00/include/TString.h:839:53: error: ‘string_view’ in namespace ‘std’ does not name a type 839 | inline Bool_t operator==(const char *s1, const std::string_view &s2) | ^~~~~~~~~~~ /home/dz/products/ROOT6.24.00/include/TString.h:839:48: note: ‘std::string_view’ is only available from C++17 onwards 839 | inline Bool_t operator==(const char s1, const std::string_view &s2) | ^~~ /home/dz/products/ROOT6.24.00/include/TString.h:839:15: error: ‘Bool_t operator==(const char, const int&)’ must have an argument of class or enumerated type 839 | inline Bool_t operator==(const char *s1, const std::string_view &s2) | ^~~~~~~~ /home/dz/products/ROOT6.24.00/include/TString.h:844:37: error: ‘string_view’ in namespace ‘std’ does not name a type 844 | inline Bool_t operator==(const std::string_view &s1, const char s2) | ^~~~~~~~~~~ /home/dz/products/ROOT6.24.00/include/TString.h:844:32: note: ‘std::string_view’ is only available from C++17 onwards 844 | inline Bool_t operator==(const std::string_view &s1, const char s2) | ^~~ /home/dz/products/ROOT6.24.00/include/TString.h:844:15: error: ‘Bool_t operator==(const int&, const char)’ must have an argument of class or enumerated type 844 | inline Bool_t operator==(const std::string_view &s1, const char s2) | ^~~~~~~~ /home/dz/products/ROOT6.24.00/include/TString.h:857:37: error: ‘string_view’ in namespace ‘std’ does not name a type 857 | std::string printValue(const std::string_view val); | ^~~~~~~~~~~ /home/dz/products/ROOT6.24.00/include/TString.h:857:32: note: ‘std::string_view’ is only available from C++17 onwards 857 | std::string printValue(const std::string_view val); | ^~~ make[2]: *** [Core/CMakeFiles/NPCore.dir/build.make:88: Core/CMakeFiles/NPCore.dir/NPRandom.cxx.o] Error 1 make[1]: *** [CMakeFiles/Makefile2:3746: Core/CMakeFiles/NPCore.dir/all] Error 2 make: *** [Makefile:130: all] Error 2

Tell me if you need more informations on my system!

Regards Mehdi

Edited Jun 07, 2021 by Mehdi
Assignee
Assign to
Time tracking