diff --git a/pythia8.spec b/pythia8.spec index 51d40e956dd..c6500fc95f4 100644 --- a/pythia8.spec +++ b/pythia8.spec @@ -1,11 +1,14 @@ ### RPM external pythia8 309 Source: https://pythia.org/download/pythia83/%{n}%{realversion}.tgz +# https://gitlab.com/Pythia8/releases/-/issues/289: fix compilation of C++20 code with pythia8 +Patch0: pythia8_309-289 Requires: hepmc hepmc3 lhapdf %prep %setup -q -n %{n}%{realversion} +%patch0 -p1 ./configure --prefix=%i --enable-shared --with-hepmc2=${HEPMC_ROOT} --with-hepmc3=${HEPMC3_ROOT} --with-lhapdf6=${LHAPDF_ROOT} --enable-mg5mes diff --git a/pythia8_309-289.patch b/pythia8_309-289.patch new file mode 100644 index 00000000000..ec5ba6655bc --- /dev/null +++ b/pythia8_309-289.patch @@ -0,0 +1,31 @@ +diff --git a/include/Pythia8/SusyLesHouches.h b/include/Pythia8/SusyLesHouches.h +index 43d6d621..5a57a968 100644 +--- a/include/Pythia8/SusyLesHouches.h ++++ b/include/Pythia8/SusyLesHouches.h +@@ -28,7 +28,7 @@ namespace Pythia8 { + public: + + //Constructor. +- LHblock() : idnow(0), qDRbar(), i(), val() {} ; ++ LHblock() : idnow(0), qDRbar(), i(), val() {} ; + + //Does block exist? + bool exists() { return int(entry.size()) == 0 ? false : true ; }; +@@ -129,7 +129,7 @@ namespace Pythia8 { + template class LHmatrixBlock { + public: + //Constructor. Set uninitialized and explicitly zero. +- LHmatrixBlock() : entry(), qDRbar(), val() { ++ LHmatrixBlock() : entry(), qDRbar(), val() { + initialized=false; + for (i=1;i<=size;i++) { + for (j=1;j<=size;j++) { +@@ -208,7 +208,7 @@ namespace Pythia8 { + template class LHtensor3Block { + public: + //Constructor. Set uninitialized and explicitly zero. +- LHtensor3Block() : entry(), qDRbar(), val() { ++ LHtensor3Block() : entry(), qDRbar(), val() { + initialized=false; + for (i=1;i<=size;i++) { + for (j=1;j<=size;j++) { diff --git a/sherpa-cpp20.patch b/sherpa-cpp20.patch new file mode 100644 index 00000000000..b76c3ace7a5 --- /dev/null +++ b/sherpa-cpp20.patch @@ -0,0 +1,35 @@ +From 1de52ee230891277370fc4f787fc8cb4b7626ef2 Mon Sep 17 00:00:00 2001 +From: iarspider +Date: Wed, 28 Jun 2023 07:35:10 +0000 +Subject: [PATCH] [ATOOLS] Fix C++20 compilation errors + +--- + ATOOLS/Org/Getter_Function.H | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +diff --git a/ATOOLS/Org/Getter_Function.H b/ATOOLS/Org/Getter_Function.H +index f68d190ca2..09340da390 100644 +--- a/ATOOLS/Org/Getter_Function.H ++++ b/ATOOLS/Org/Getter_Function.H +@@ -84,7 +84,7 @@ namespace ATOOLS { + void PrintInfo(std::ostream &str,const size_t width) const; \ + Object_Type *operator()(const Parameter_Type ¶meters) const; \ + public: \ +- Getter(const bool &d=true): \ ++ Getter(const bool &d=true): \ + Getter_Function(TAG) \ + { SetDisplay(d); } \ + }; \ +@@ -107,8 +107,7 @@ namespace ATOOLS { + void PrintInfo(std::ostream &str,const size_t width) const; \ + Object_Type *operator()(const Parameter_Type ¶meters) const; \ + public: \ +- Getter \ +- (const std::string &name,const bool d=true): \ ++ Getter(const std::string &name,const bool d=true): \ + Getter_Function(name) \ + { SetDisplay(d); } \ + }; \ +-- +GitLab + diff --git a/sherpa.spec b/sherpa.spec index 31ad30dad9b..5809ddd88df 100644 --- a/sherpa.spec +++ b/sherpa.spec @@ -3,6 +3,7 @@ Source: http://www.hepforge.org/archive/sherpa/SHERPA-MC-%{realversion}.tar.gz Requires: hepmc lhapdf blackhat sqlite python3 fastjet openmpi BuildRequires: mcfm swig autotools Patch0: sherpa-2.2.10-hepmcshort +Patch1: sherpa-cpp20 %ifos linux %ifnarch ppc64le @@ -25,6 +26,7 @@ perl -p -i -e 's|-rdynamic||g' configure AddOns/Analysis/Scripts/Makefile.in %endif %patch0 -p1 +%patch1 -p1 %build export PYTHON=$(which python3) diff --git a/tensorflow-sources.file b/tensorflow-sources.file index e21ee248f79..853ec1ff5b1 100644 --- a/tensorflow-sources.file +++ b/tensorflow-sources.file @@ -5,6 +5,12 @@ BuildRequires: bazel java-env git ## INCLUDE tensorflow-requires ## INCLUDE compilation_flags +#Set cms_cxx_standard to 17 as LLVM downloaded by TF does not build with c++20 +%if "%{cms_cxx_standard}" == "20" +%undefine cms_cxx_standard +%define cms_cxx_standard 17 +%endif + Source: git+https://github.com/%{github_user}/tensorflow.git?obj=%{branch}/%{tag}&export=tensorflow-%{realversion}&output=/tensorflow-%{realversion}.tgz %if "%{?build_type:set}" != "set"