Closed ThomasRuf closed 8 months ago
trying with env: CXXFLAGS: "-fPIC -g -O2 -std=c++11"
does not work. still uses -std=c++17
++ make 'CXXFLAGS=-Wall -fPIC -g -O2 -std=c++17' 'CFLAGS=-Wall -fPIC -g -O2' awk: line 1: syntax error at or near >
hardcoding works:
export CXXFLAGS="-fPIC -g -O2 -std=c++11"
trying with env: CXXFLAGS: "-fPIC -g -O2 -std=c++11"
does not work. still uses -std=c++17
++ make 'CXXFLAGS=-Wall -fPIC -g -O2 -std=c++17' 'CFLAGS=-Wall -fPIC -g -O2' awk: line 1: syntax error at or near >
I think if default_fairship.sh
defines variables in env
, it will overwrite the same variable defined in e.g. genie.sh
, so hard-coding is probably the only solution.
Note sure whether the general env
can be overwritten per recipe in the defaults, as we do with e.g. versions etc.
Are the errors below due to the change to -std=c++17?
g++ -c -Wall -fPIC -g -O2 -std=c++17 -I/home/truf/SHiPBuild/sw/ubuntu2004_x86-64/ROOT/9680bccb30_FAIRSHIP-1/include -I/usr/include/libxml2 -I/home/truf/SHiPBuild/sw/ubuntu2004_x86-64/log4cpp/REL_1_1_1_Nov_26_2013-1/include/ -I/home/truf/SHiPBuild/sw/ubuntu2004_x86-64/lhapdf5/v5.9.1-ship3-1/include/ -I/home/truf/SHiPBuild/sw/BUILD/87cd1447d861e32c17d26955ef2adfedc6906c36/GENIE/src/ AlgId.cxx In file included from /home/truf/SHiPBuild/sw/ubuntu2004_x86-64/ROOT/9680bccb30_FAIRSHIP-1/include/TString.h:28, from /home/truf/SHiPBuild/sw/ubuntu2004_x86-64/ROOT/9680bccb30_FAIRSHIP-1/include/TNamed.h:26, from /home/truf/SHiPBuild/sw/ubuntu2004_x86-64/ROOT/9680bccb30_FAIRSHIP-1/include/TAxis.h:24, from /home/truf/SHiPBuild/sw/ubuntu2004_x86-64/ROOT/9680bccb30_FAIRSHIP-1/include/TH1.h:24, from /home/truf/SHiPBuild/sw/ubuntu2004_x86-64/ROOT/9680bccb30_FAIRSHIP-1/include/TH1F.h:24, from /home/truf/SHiPBuild/sw/BUILD/87cd1447d861e32c17d26955ef2adfedc6906c36/GENIE/src/Registry/RegistryItemTypeDef.h:26, from /home/truf/SHiPBuild/sw/BUILD/87cd1447d861e32c17d26955ef2adfedc6906c36/GENIE/src/Algorithm/AlgId.h:25, from AlgId.cxx:19: /home/truf/SHiPBuild/sw/ubuntu2004_x86-64/ROOT/9680bccb30_FAIRSHIP-1/include/ROOT/RStringView.hxx:32:10: error: conflicting declaration of template 'template<class _CharT, class _Traits> using basic_string_view = std::experimental::__ROOT::basic_string_view<_CharT, _Traits>' 32 | using basic_string_view = ::std::experimental::basic_string_view<_CharT,_Traits>;
This looks like it's some inconsistency between ROOT and GENIE maybe. Do you also set CMAKE_CXX_STANDARD for ROOT to 17?
don't know about CMAKE_CXX_STANDARD. What should I do?
Cf. #45, you can set CMAKE_CXX_STANDARD=17 in defaults_fairship.sh (or per recipe).
mmh. Does it mean all these lines: soversion ${CXX11:+cxx11} ${CXX14:+cxx14} mysql xml"
need to be changed to: soversion ${CXX11:+cxx11} ${CXX14:+cxx14} ${CXX17:+cxx17} mysql xml" ?
not to forget [[ "$CMAKE_CXX_STANDARD" == '11' ]] && CXX11=1 || true
Those aren't strictly necessary. It's a way to check which version of C++ ROOT was compiled with. I modified them to follow what was done previously in the recipe, but it does seem a bit redundant.
what does it mean? Will it cause a problem with CMAKE_CXX_STANDARD=17 or not?
If you don't add the CXX1X variable for c++17, the only difference is that it won't be checked for "cxx17" in the features after building ROOT. So it won't cause any problems.
with all the changes, back to Genie, left with this error: make[1]: Entering directory '/home/truf/SHiPBuild/sw/BUILD/ed44af67d3fdf02ad5847fa71ee79fba3e5409f3/GENIE/src/BaryonResonance' awk: line 1: syntax error at or near > g++ -c -Wall -fPIC -g -O2 -std=c++17 -I/home/truf/SHiPBuild/sw/ubuntu2004_x86-64/ROOT/9680bccb30_FAIRSHIP-1/include -I/usr/include/libxml2 -I/home/truf/SHiPBuild/sw/ubuntu2004_x86-64/log4cpp/RE L_1_1_1_Nov_26_2013-1/include/ -I/home/truf/SHiPBuild/sw/ubuntu2004_x86-64/lhapdf5/v5.9.1-ship3-1/include/ -I/home/truf/SHiPBuild/sw/BUILD/ed44af67d3fdf02ad5847fa71ee79fba3e5409f3/GENIE/src/ Ba ryonResUtils.cxx In file included from /home/truf/SHiPBuild/sw/ubuntu2004_x86-64/log4cpp/REL_1_1_1_Nov_26_2013-1/include/log4cpp/Appender.hh:21, from /home/truf/SHiPBuild/sw/ubuntu2004_x86-64/log4cpp/REL_1_1_1_Nov_26_2013-1/include/log4cpp/Category.hh:14, from /home/truf/SHiPBuild/sw/BUILD/ed44af67d3fdf02ad5847fa71ee79fba3e5409f3/GENIE/src/Messenger/Messenger.h:27, from BaryonResUtils.cxx:38: /home/truf/SHiPBuild/sw/ubuntu2004_x86-64/log4cpp/REL_1_1_1_Nov_26_2013-1/include/log4cpp/Priority.hh:107:2: error: ISO C++17 does not allow dynamic exception specifications 107 | throw(std::invalid_argument); | ^~~~~ In file included from /home/truf/SHiPBuild/sw/BUILD/ed44af67d3fdf02ad5847fa71ee79fba3e5409f3/GENIE/src/Messenger/Messenger.h:27, from BaryonResUtils.cxx:38: /home/truf/SHiPBuild/sw/ubuntu2004_x86-64/log4cpp/REL_1_1_1_Nov_26_2013-1/include/log4cpp/Category.hh:116:9: error: ISO C++17 does not allow dynamic exception specifications 116 | throw(std::invalid_argument); | ^~~~~ /home/truf/SHiPBuild/sw/ubuntu2004_x86-64/log4cpp/REL_1_1_1_Nov_26_2013-1/include/log4cpp/Category.hh:150:9: error: ISO C++17 does not allow dynamic exception specifications 150 | throw(std::invalid_argument); | ^~~~~
back to C++14: Fails back to C++11: Fails now too. /home/truf/SHiPBuild/sw/ubuntu2004_x86-64/ROOT/9680bccb30_FAIRSHIP-1/include/TString.h:439:4: note: 'std::string_view' is only available from C++17 onwards 439 | std::string_view View() const { return std::string_view(GetPointer(),Length()); } ....
Now, it seems using CMAKE_CXX_STANDARD=17, produces different ROOT header files than without. So, completely stuck.
back to C++17 error: /home/truf/SHiPBuild/sw/ubuntu2004_x86-64/log4cpp/REL_1_1_1_Nov_26_2013-1/include/log4cpp/Priority.hh:107:2: error: ISO C++17 does not allow dynamic exception specifications
what is log4cpp? It is not supported by alibuild. Do we need to move to newer version?
this seems to help: git clone https://git.code.sf.net/p/log4cpp/codegit log4cpp-codegit mv log4cpp-codegit log4cpp
back to C++14: Fails back to C++11: Fails now too. /home/truf/SHiPBuild/sw/ubuntu2004_x86-64/ROOT/9680bccb30_FAIRSHIP-1/include/TString.h:439:4: note: 'std::string_view' is only available from C++17 onwards 439 | std::string_view View() const { return std::string_view(GetPointer(),Length()); } ....
Now, it seems using CMAKE_CXX_STANDARD=17, produces different ROOT header files than without. So, completely stuck.
Do you adjust CMAKE_CXX_STANDARD to match -e.g. -std=c++11?
Not sure how to best keep them in sync automatically...
this seems to help: git clone https://git.code.sf.net/p/log4cpp/codegit log4cpp-codegit mv log4cpp-codegit log4cpp
We should then probably use this as the source repository in log4cpp.sh
(and not overwrite the repository in defaults-fairship{,2018}.sh
.
back to C++17 error: /home/truf/SHiPBuild/sw/ubuntu2004_x86-64/log4cpp/REL_1_1_1_Nov_26_2013-1/include/log4cpp/Priority.hh:107:2: error: ISO C++17 does not allow dynamic exception specifications
what is log4cpp? It is not supported by alibuild. Do we need to move to newer version?
No idea what it is, but it's in our shipdist repo. So far I never had to touch it, but switching to the upstream repository (https://git.code.sf.net/p/log4cpp/codegit) is probably the best way to go.
yes, in principle. Only problem, there is no recent version tag as far as I can see. I am using the master branch, everything else looks very ancient. But we need some fix point.
We can use the master branch in alibuild or maybe even pin individual commits.
I'll update the log4cpp recipe and make a pull request. I'll also check whether the compilation options are correct there, as the flags used seem a bit suspect.
Assuming that this is now obsolete.
Are the errors below due to the change to -std=c++17?
g++ -c -Wall -fPIC -g -O2 -std=c++17 -I/home/truf/SHiPBuild/sw/ubuntu2004_x86-64/ROOT/9680bccb30_FAIRSHIP-1/include -I/usr/include/libxml2 -I/home/truf/SHiPBuild/sw/ubuntu2004_x86-64/log4cpp/REL_1_1_1_Nov_26_2013-1/include/ -I/home/truf/SHiPBuild/sw/ubuntu2004_x86-64/lhapdf5/v5.9.1-ship3-1/include/ -I/home/truf/SHiPBuild/sw/BUILD/87cd1447d861e32c17d26955ef2adfedc6906c36/GENIE/src/ AlgId.cxx In file included from /home/truf/SHiPBuild/sw/ubuntu2004_x86-64/ROOT/9680bccb30_FAIRSHIP-1/include/TString.h:28, from /home/truf/SHiPBuild/sw/ubuntu2004_x86-64/ROOT/9680bccb30_FAIRSHIP-1/include/TNamed.h:26, from /home/truf/SHiPBuild/sw/ubuntu2004_x86-64/ROOT/9680bccb30_FAIRSHIP-1/include/TAxis.h:24, from /home/truf/SHiPBuild/sw/ubuntu2004_x86-64/ROOT/9680bccb30_FAIRSHIP-1/include/TH1.h:24, from /home/truf/SHiPBuild/sw/ubuntu2004_x86-64/ROOT/9680bccb30_FAIRSHIP-1/include/TH1F.h:24, from /home/truf/SHiPBuild/sw/BUILD/87cd1447d861e32c17d26955ef2adfedc6906c36/GENIE/src/Registry/RegistryItemTypeDef.h:26, from /home/truf/SHiPBuild/sw/BUILD/87cd1447d861e32c17d26955ef2adfedc6906c36/GENIE/src/Algorithm/AlgId.h:25, from AlgId.cxx:19: /home/truf/SHiPBuild/sw/ubuntu2004_x86-64/ROOT/9680bccb30_FAIRSHIP-1/include/ROOT/RStringView.hxx:32:10: error: conflicting declaration of template 'template<class _CharT, class _Traits> using basic_string_view = std::experimental::__ROOT::basic_string_view<_CharT, _Traits>' 32 | using basic_string_view = ::std::experimental::basic_string_view<_CharT,_Traits>;