From 0e6d80f779626ca28ec9a9dd2553337a611d29df Mon Sep 17 00:00:00 2001
From: Ivan Razumov <ivan.razumov@cern.ch>
Date: Thu, 13 Feb 2020 12:58:51 +0100
Subject: [PATCH 1/5] Try building powhegbox-v2 with -fautomatic

---
 generators/CMakeLists.txt | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/generators/CMakeLists.txt b/generators/CMakeLists.txt
index c2f4f9aa59..73f102c31c 100644
--- a/generators/CMakeLists.txt
+++ b/generators/CMakeLists.txt
@@ -2122,6 +2122,8 @@ if(NOT APPLE)    #  (installation fails on MacOSX)
   BUILD_COMMAND ${MAKE} -j1
   IF <VERSION> MATCHES "rdynamic" THEN
     "OPT=-rdynamic -fPIE -fPIC -pie -O2" "DEBUG=-rdynamic -fPIE -fPIC -pie -O2"
+  ELSE
+    "OPT=-fautomatic -O2" "DEBUG=-fautomatic -O2"
   ENDIF
   INSTALL_COMMAND ${MAKE} install
   IF NOT CMAKE_BUILD_TYPE MATCHES Deb THEN
-- 
GitLab


From 99e91cee523e6c6bd33d887fe42e26e89ce9028c Mon Sep 17 00:00:00 2001
From: Ivan Razumov <ivan.razumov@cern.ch>
Date: Thu, 13 Feb 2020 13:06:08 +0100
Subject: [PATCH 2/5] Bump revision to force rebuild

---
 generators/CMakeLists.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/generators/CMakeLists.txt b/generators/CMakeLists.txt
index 73f102c31c..e233d6928f 100644
--- a/generators/CMakeLists.txt
+++ b/generators/CMakeLists.txt
@@ -2131,6 +2131,7 @@ if(NOT APPLE)    #  (installation fails on MacOSX)
   ENDIF
   BUILD_IN_SOURCE 1
   DEPENDS fastjet lhapdf-<powheg-box-v2_<NATIVE_VERSION>_lhapdf> chaplin feynhiggs
+  REVISION 1
  )
 
 foreach(v ${powheg-box-v2_native_version})
-- 
GitLab


From 5af640577c8ef12fe6b8bae0c47f376631537be5 Mon Sep 17 00:00:00 2001
From: Ivan Razumov <ivan.razumov@cern.ch>
Date: Thu, 13 Feb 2020 13:07:36 +0100
Subject: [PATCH 3/5] Remove old setup script target for powheg-box-v2

---
 generators/powheg-box-v2/files/Makefile | 23 +----------------------
 1 file changed, 1 insertion(+), 22 deletions(-)

diff --git a/generators/powheg-box-v2/files/Makefile b/generators/powheg-box-v2/files/Makefile
index 84e6956730..08dd0876f5 100644
--- a/generators/powheg-box-v2/files/Makefile
+++ b/generators/powheg-box-v2/files/Makefile
@@ -38,7 +38,7 @@ HJ HWJ VBF_H W W_ew-BMNNP WW Z_ew-BMNNPV HJJ HZ trijet W2jet Wgamma WZ Zj gg_H_2
 # dislepton-jet - takes ages to compile...(?)
 #
 
-all: mksetup mkbinaries
+all: mkbinaries
 
 mkbinaries: $(PROCESSES)
 
@@ -46,26 +46,6 @@ $(PROCESSES):
 	export PATH=${FASTJET}/bin:${LHAPDF}/bin:$${PATH} && \
 	cd $@ && $(MAKE) pwhg_main COMPILER=$(MYFC) CHAPLIN=$(CHAPLIN) FEYNHIGGS=$(FEYNHIGGS)
 
-mksetup:
-	( echo "#!/bin/sh" ; \
-	  echo "" ; \
-	  echo "# Source this script to setup environment (bash shell):" ; \
-	  echo "#   \$$ source $(PREFIX)/$(BINDIR)/setup.sh" ; \
-	  echo "" ; \
-	  echo "export PATH=$(PREFIX)/$(BINDIR):\$${PATH}" ; \
-	  echo "export LD_LIBRARY_PATH=$(FASTJET)/lib:$(shell $(LHAPDF)/bin/lhapdf-config --libdir):\$${LD_LIBRARY_PATH}" ; \
-	  echo "export LHAPATH=$(shell $(LHAPDF)/bin/lhapdf-config --pdfsets-path)" ; \
-	) > setup.sh
-	( echo "#!/bin/csh" ; \
-	  echo "" ; \
-	  echo "# Source this script to setup environment (csh shell):" ; \
-	  echo "#   \$$ source $(PREFIX)/$(BINDIR)/setup.csh" ; \
-	  echo "" ; \
-	  echo "setenv PATH $(PREFIX)/$(BINDIR):\$${PATH}" ; \
-	  echo "setenv LD_LIBRARY_PATH $(FASTJET)/lib:$(shell $(LHAPDF)/bin/lhapdf-config --libdir):\$${LD_LIBRARY_PATH}" ; \
-	  echo "setenv LHAPATH $(shell $(LHAPDF)/bin/lhapdf-config --pdfsets-path)" ; \
-	) > setup.csh
-
 # to copy documentation we use more complicated `find ... | xargs ...` way
 # instead of simple `cp` to avoid error
 #   "cp: will not overwrite just-created ..."
@@ -82,4 +62,3 @@ clean:
 	for i in $(PROCESSES) ; do \
 	  make -C $$i clean ; \
 	done
-	rm -f setup.sh setup.csh
-- 
GitLab


From c81f689123dda4a44f5c4308da0e4d2287653e84 Mon Sep 17 00:00:00 2001
From: Ivan Razumov <ivan.razumov@cern.ch>
Date: Thu, 13 Feb 2020 13:34:59 +0100
Subject: [PATCH 4/5] Unblacklist

---
 cmake/toolchain/heptools-dev-generators.cmake | 2 --
 1 file changed, 2 deletions(-)

diff --git a/cmake/toolchain/heptools-dev-generators.cmake b/cmake/toolchain/heptools-dev-generators.cmake
index e66b31af42..cd41ffdd46 100644
--- a/cmake/toolchain/heptools-dev-generators.cmake
+++ b/cmake/toolchain/heptools-dev-generators.cmake
@@ -40,11 +40,9 @@ LCG_external_package(madgraph5amc      2.6.7          ${MCGENPATH}/madgraph5amc
 #LCG_external_package(lhapdf            6.1.6.cxxstd   ${MCGENPATH}/lhapdf author=6.1.6 usecxxstd=1 )
 LCG_external_package(lhapdf            6.2.3          ${MCGENPATH}/lhapdf       )
 
-if(((${LCG_COMP} MATCHES gcc) AND (${LCG_COMPVERS} LESS 9)) OR (${LCG_COMP} MATCHES clang))
 LCG_external_package(powheg-box-v2     r3043.lhcb    ${MCGENPATH}/powheg-box-v2 author=r3043  )
 #LCG_external_package(powheg-box-v2     r3043.lhcb.rdynamic    ${MCGENPATH}/powheg-box-v2 author=r3043  )
 #LCG_external_package(powheg-box        r2092         ${MCGENPATH}/powheg-box       )
-endif()
 
 LCG_external_package(feynhiggs         2.10.2         ${MCGENPATH}/feynhiggs	)
 LCG_external_package(chaplin           1.2            ${MCGENPATH}/chaplin      )
-- 
GitLab


From f66a7e8137cb184ecbb10dcba877ed71746890d0 Mon Sep 17 00:00:00 2001
From: Ivan Razumov <ivan.razumov@cern.ch>
Date: Thu, 13 Feb 2020 15:28:14 +0100
Subject: [PATCH 5/5] Fix makefile

---
 generators/powheg-box-v2/files/Makefile | 1 -
 1 file changed, 1 deletion(-)

diff --git a/generators/powheg-box-v2/files/Makefile b/generators/powheg-box-v2/files/Makefile
index 08dd0876f5..198c5f7e61 100644
--- a/generators/powheg-box-v2/files/Makefile
+++ b/generators/powheg-box-v2/files/Makefile
@@ -54,7 +54,6 @@ install:
 	for i in $(PROCESSES) ; do \
 	  cp -vf $$i/pwhg_main $(PREFIX)/$(BINDIR)/$$i || exit 1 ; \
 	done
-	cp -vf setup.sh setup.csh $(PREFIX)/$(BINDIR)/
 	mkdir -p $(DATADIR)/$(DOCDIR)
 	find . -name "*.pdf" -o -name "*.ps.gz" | xargs -I "{}" cp {} $(DATADIR)/$(DOCDIR)/
 
-- 
GitLab