Skip to content

Commit

Permalink
Merge pull request #8922 from cms-sw/cpp20-changes
Browse files Browse the repository at this point in the history
Backport cpp20 changes to master branch
  • Loading branch information
smuzaffar authored Jan 9, 2024
2 parents 88a76c7 + 712ae01 commit 4139e40
Show file tree
Hide file tree
Showing 5 changed files with 77 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pythia8.spec
Original file line number Diff line number Diff line change
@@ -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

Expand Down
31 changes: 31 additions & 0 deletions pythia8_309-289.patch
Original file line number Diff line number Diff line change
@@ -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<T>() : 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 <int size> class LHmatrixBlock {
public:
//Constructor. Set uninitialized and explicitly zero.
- LHmatrixBlock<size>() : 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 <int size> class LHtensor3Block {
public:
//Constructor. Set uninitialized and explicitly zero.
- LHtensor3Block<size>() : entry(), qDRbar(), val() {
+ LHtensor3Block() : entry(), qDRbar(), val() {
initialized=false;
for (i=1;i<=size;i++) {
for (j=1;j<=size;j++) {
35 changes: 35 additions & 0 deletions sherpa-cpp20.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
From 1de52ee230891277370fc4f787fc8cb4b7626ef2 Mon Sep 17 00:00:00 2001
From: iarspider <[email protected]>
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 &parameters) const; \
public: \
- Getter<OBJECT,PARAMETER,NAME,SORT>(const bool &d=true): \
+ Getter(const bool &d=true): \
Getter_Function<OBJECT,PARAMETER,SORT>(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 &parameters) const; \
public: \
- Getter<OBJECT,PARAMETER,NAME,SORT> \
- (const std::string &name,const bool d=true): \
+ Getter(const std::string &name,const bool d=true): \
Getter_Function<OBJECT,PARAMETER,SORT>(name) \
{ SetDisplay(d); } \
}; \
--
GitLab

2 changes: 2 additions & 0 deletions sherpa.spec
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down
6 changes: 6 additions & 0 deletions tensorflow-sources.file
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 4139e40

Please sign in to comment.