The package rpms/HepMC3.git has added or updated architecture specific content in its
spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s):
https://src.fedoraproject.org/cgit/rpms/HepMC3.git/commit/?id=f875d5c8a8d....
Change:
-%ifarch ppc64le
Thanks.
Full change:
============
commit f875d5c8a8d5ba9d304444b0e3c893530b3c4a84
Author: Mattias Ellert <mattias.ellert(a)physics.uu.se>
Date: Sun Mar 29 09:29:03 2020 +0200
Initialize ROOT in rootIO python bindings - avoids problem on EPEL 7 ppc64le
Use upstream's fix for parallel python tests
diff --git a/HepMC3-initialize-root.patch b/HepMC3-initialize-root.patch
new file mode 100644
index 0000000..841c125
--- /dev/null
+++ b/HepMC3-initialize-root.patch
@@ -0,0 +1,10 @@
+diff --git a/python/src/rootIO/__init__.py b/python/src/rootIO/__init__.py
+index 709d8bd..461aa10 100644
+--- a/python/src/rootIO/__init__.py
++++ b/python/src/rootIO/__init__.py
+@@ -1 +1,5 @@
++# Preload libCore to initialize ROOT
++from ctypes import cdll
++libCore = cdll.LoadLibrary("libCore.so")
++
+ from .pyHepMC3rootIO import *
diff --git a/HepMC3-python-tests.patch b/HepMC3-python-tests.patch
index b9ad0e2..b8f00f1 100644
--- a/HepMC3-python-tests.patch
+++ b/HepMC3-python-tests.patch
@@ -1,38 +1,203 @@
-From da9c200e22c63e28159d37cd30846e1097b07f43 Mon Sep 17 00:00:00 2001
-From: Mattias Ellert <mattias.ellert(a)physics.uu.se>
-Date: Thu, 26 Mar 2020 10:09:18 +0100
-Subject: [PATCH] The same test for different python versions must not
- overwrite eachother's files
+From ee942bb35bb1735e0a91e61564e7eaf50a78a519 Mon Sep 17 00:00:00 2001
+From: Andrii Verbytskyi <andriish(a)hermes.mpp.mpg.de>
+Date: Thu, 26 Mar 2020 10:50:36 +0100
+Subject: [PATCH] Attempt to fix the python tests
---
- python/CMakeLists.txt | 7 +++++++
- 1 file changed, 7 insertions(+)
+ python/test/pyHepMC3TestUtils.py | 5 +++++
+ python/test/test_IO1.py | 10 +++++-----
+ python/test/test_IO2.py | 10 +++++-----
+ python/test/test_Polarization.py | 12 ++++++------
+ python/test/test_Print.py | 8 ++++----
+ python/test/test_Pythia8.py | 4 ++--
+ 6 files changed, 27 insertions(+), 22 deletions(-)
-diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt
-index 95d1b1f..a538aac 100644
---- a/python/CMakeLists.txt
-+++ b/python/CMakeLists.txt
-@@ -137,6 +137,8 @@ endif()
- endif()
-
- macro(bindings ver verminor)
-+SET(Last_Python_VERSION ${Python_VERSION})
+diff --git a/python/test/pyHepMC3TestUtils.py b/python/test/pyHepMC3TestUtils.py
+index 3ea8061..fe0d246 100644
+--- a/python/test/pyHepMC3TestUtils.py
++++ b/python/test/pyHepMC3TestUtils.py
+@@ -4,7 +4,12 @@ import sys,os
+ def update_path():
+ v=sys.version_info
+ return
[os.path.abspath(os.path.join(os.pardir,str(v[0])+"."+str(v[1])+"."+str(v[2])))]+[os.getcwd()]+sys.path
+
- SET( Python_VERSION_MAJOR "0")
- SET( Python_VERSION_MINOR "0")
-
-@@ -374,6 +376,11 @@ ENABLE_TESTING()
- endif()
- foreach ( ptest ${HepMC_python_tests} )
- add_test(NAME python${Python_VERSION}_${ptest} COMMAND ${Python_EXECUTABLE}
${ptest}.py WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/test")
-+ # The same test for different python versions must not overwrite
-+ # eachother's files
-+ if(NOT ${Last_Python_VERSION} STREQUAL "")
-+ set_tests_properties(python${Python_VERSION}_${ptest} PROPERTIES DEPENDS
python${Last_Python_VERSION}_${ptest})
-+ endif()
- endforeach ( ptest ${HepMC_python_tests} )
- endif()
++def python_label():
++ v=sys.version_info
++ return str(v[0])+"."+str(v[1])+"."+str(v[2])
+
++
+ def COMPARE_ASCII_FILES(f1,f2):
+ file1=open(f1)
+ file2=open(f2)
+diff --git a/python/test/test_IO1.py b/python/test/test_IO1.py
+index e80a5af..aba6762 100644
+--- a/python/test/test_IO1.py
++++ b/python/test/test_IO1.py
+@@ -1,4 +1,4 @@
+-from pyHepMC3TestUtils import update_path
++from pyHepMC3TestUtils import update_path,python_label
+ import sys,os
+ sys.path=update_path()
+
+@@ -8,7 +8,7 @@ from pyHepMC3 import HepMC3 as hm
+ def test_IO1():
+ inputA=hm.ReaderAsciiHepMC2("inputIO1.hepmc")
+ if inputA.failed(): sys.exit(1)
+- outputA=hm.WriterAscii ("frominputIO1.hepmc")
++ outputA=hm.WriterAscii (python_label()+"frominputIO1.hepmc")
+ if outputA.failed(): sys.exit(2)
+ while not inputA.failed():
+ evt=hm.GenEvent()
+@@ -21,9 +21,9 @@ def test_IO1():
+ inputA.close()
+ outputA.close()
+
+- inputB=hm.ReaderAscii ("frominputIO1.hepmc")
++ inputB=hm.ReaderAscii (python_label()+"frominputIO1.hepmc")
+ if inputB.failed(): sys.exit(3)
+- outputB=hm.WriterAsciiHepMC2("fromfrominputIO1.hepmc")
++ outputB=hm.WriterAsciiHepMC2(python_label()+"fromfrominputIO1.hepmc")
+ if outputB.failed(): sys.exit(4)
+ while not inputB.failed():
+ evt=hm.GenEvent()
+@@ -35,7 +35,7 @@ def test_IO1():
+ evt.clear()
+ inputB.close()
+ outputB.close()
+- assert(0 ==
COMPARE_ASCII_FILES("fromfrominputIO1.hepmc","inputIO1.hepmc"))
++ assert(0 ==
COMPARE_ASCII_FILES(python_label()+"fromfrominputIO1.hepmc","inputIO1.hepmc"))
+ return 0
+ if __name__ == "__main__":
+ result=1
+diff --git a/python/test/test_IO2.py b/python/test/test_IO2.py
+index 938830f..b838fa6 100644
+--- a/python/test/test_IO2.py
++++ b/python/test/test_IO2.py
+@@ -1,4 +1,4 @@
+-from pyHepMC3TestUtils import update_path
++from pyHepMC3TestUtils import update_path,python_label
+ import sys,os
+ sys.path=update_path()
+
+@@ -10,7 +10,7 @@ print(dir(hmrootIO))
+ def test_IO2():
+ inputA=hm.ReaderAsciiHepMC2("inputIO2.hepmc")
+ if inputA.failed(): sys.exit(1)
+- outputA=hmrootIO.WriterRootTree ("frominputIO2.root")
++ outputA=hmrootIO.WriterRootTree (python_label()+"frominputIO2.root")
+ if outputA.failed(): sys.exit(2)
+ while not inputA.failed():
+ evt=hm.GenEvent()
+@@ -23,9 +23,9 @@ def test_IO2():
+ inputA.close()
+ outputA.close()
+
+- inputB=hmrootIO.ReaderRootTree ("frominputIO2.root")
++ inputB=hmrootIO.ReaderRootTree (python_label()+"frominputIO2.root")
+ if inputB.failed(): sys.exit(3)
+- outputB=hm.WriterAsciiHepMC2("fromfrominputIO2.hepmc")
++ outputB=hm.WriterAsciiHepMC2(python_label()+"fromfrominputIO2.hepmc")
+ if outputB.failed(): sys.exit(4)
+ while not inputB.failed():
+ evt=hm.GenEvent()
+@@ -37,7 +37,7 @@ def test_IO2():
+ evt.clear()
+ inputB.close()
+ outputB.close()
+- assert(0 ==
COMPARE_ASCII_FILES("fromfrominputIO2.hepmc","inputIO2.hepmc"))
++ assert(0 ==
COMPARE_ASCII_FILES(python_label()+"fromfrominputIO2.hepmc","inputIO2.hepmc"))
+ return 0
+ if __name__ == "__main__":
+ result=1
+diff --git a/python/test/test_Polarization.py b/python/test/test_Polarization.py
+index b7d4ad1..b80a02d 100644
+--- a/python/test/test_Polarization.py
++++ b/python/test/test_Polarization.py
+@@ -15,7 +15,7 @@
+ # 7 !d! 1 1 5,5 -2.445 28.816 6.082 29.552 0.010
+ # 8 !u~! 1 -2 5,5 3.962 -49.498 -26.687 56.373 0.006
+
+-from pyHepMC3TestUtils import update_path
++from pyHepMC3TestUtils import update_path,python_label
+ import sys,os
+ sys.path=update_path()
+
+@@ -24,10 +24,10 @@ from pyHepMC3TestUtils import COMPARE_ASCII_FILES
+ from pyHepMC3 import HepMC3 as hm
+
+ def test_Polarization():
+- xout1=hm.WriterAscii ("testPolarization1.dat")
+- xout2=hm.WriterAscii("testPolarization2.dat")
+- xout4=hm.WriterAsciiHepMC2( "testPolarization4.out" )
+- xout5=hm.WriterAscii( "testPolarization5.out" )
++ xout1=hm.WriterAscii (python_label()+"testPolarization1.dat")
++ xout2=hm.WriterAscii(python_label()+"testPolarization2.dat")
++ xout4=hm.WriterAsciiHepMC2( python_label()+"testPolarization4.out" )
++ xout5=hm.WriterAscii( python_label()+"testPolarization5.out" )
+
+ # build the graph, which will look like
+ # p7 #
+@@ -138,7 +138,7 @@ def test_Polarization():
+ # contained in those vertices
+ evt.clear()
+
+-
assert((COMPARE_ASCII_FILES("testPolarization1.dat","testPolarization5.out")==0)
and
(COMPARE_ASCII_FILES("testPolarization1.dat","testPolarization2.dat")!=0))
++
assert((COMPARE_ASCII_FILES(python_label()+"testPolarization1.dat",python_label()+"testPolarization5.out")==0)
and
(COMPARE_ASCII_FILES(python_label()+"testPolarization1.dat",python_label()+"testPolarization2.dat")!=0))
+ return 0
+ if __name__ == "__main__":
+ result=1
+diff --git a/python/test/test_Print.py b/python/test/test_Print.py
+index 64a5c08..833ef36 100644
+--- a/python/test/test_Print.py
++++ b/python/test/test_Print.py
+@@ -1,4 +1,4 @@
+-from pyHepMC3TestUtils import update_path
++from pyHepMC3TestUtils import update_path,python_label
+ import sys,os
+ sys.path=update_path()
+
+@@ -83,7 +83,7 @@ def test_Print():
+ for ip in evt.particles():
+ print ( hm.Print.line(ip,True))
+
+- xout1=hm.WriterAscii("testBoost1.out")
++ xout1=hm.WriterAscii(python_label()+"testBoost1.out")
+ xout1.set_precision(6)
+ xout1.write_event(evt)
+ xout1.close()
+@@ -96,11 +96,11 @@ def test_Print():
+ print ( hm.Print.line(ip,True))
+ for ip in evt.particles():
+ print ( hm.Print.line(ip,True))
+- xout2=hm.WriterAscii("testBoost2.out")
++ xout2=hm.WriterAscii(python_label()+"testBoost2.out")
+ xout2.set_precision(6)
+ xout2.write_event(evt)
+ xout2.close()
+- assert
(COMPARE_ASCII_FILES("testBoost1.out","testBoost2.out")==0)
++ assert
(COMPARE_ASCII_FILES(python_label()+"testBoost1.out",python_label()+"testBoost2.out")==0)
+ evt.clear()
+ return 0
+ if __name__ == "__main__":
+diff --git a/python/test/test_Pythia8.py b/python/test/test_Pythia8.py
+index 541358a..b693ea5 100644
+--- a/python/test/test_Pythia8.py
++++ b/python/test/test_Pythia8.py
+@@ -1,4 +1,4 @@
+-from pyHepMC3TestUtils import update_path
++from pyHepMC3TestUtils import update_path,python_label
+ import sys,os
+ sys.path=update_path()
+@@ -17,7 +17,7 @@ def test_Pythia8():
+ pythia.init()
+ p8tohm=Pythia8ToHepMC3 ()
+ p8tohm.m_store_pdf=True
+- out=hm.WriterAscii("test_Pythia.hepmc")
++ out=hm.WriterAscii(python_label()+"test_Pythia.hepmc")
+ for iEvent in range(0, 100):
+ if not pythia.next(): continue
+ nCharged = 0
--
2.25.1
diff --git a/HepMC3-root-bug-workaround.patch b/HepMC3-root-bug-workaround.patch
deleted file mode 100644
index 9108af9..0000000
--- a/HepMC3-root-bug-workaround.patch
+++ /dev/null
@@ -1,11 +0,0 @@
-diff -ur HepMC3-3.2.1.orig/python/test/test_IO2.py HepMC3-3.2.1/python/test/test_IO2.py
---- HepMC3-3.2.1.orig/python/test/test_IO2.py 2020-03-17 11:38:25.000000000 +0100
-+++ HepMC3-3.2.1/python/test/test_IO2.py 2020-03-25 13:06:33.448541775 +0100
-@@ -2,6 +2,7 @@
- import sys,os
- sys.path=update_path()
-
-+import ROOT
-
- from pyHepMC3TestUtils import COMPARE_ASCII_FILES
- from pyHepMC3 import HepMC3 as hm
diff --git a/HepMC3.spec b/HepMC3.spec
index 1009c1f..68b3ffd 100644
--- a/HepMC3.spec
+++ b/HepMC3.spec
@@ -1,6 +1,6 @@
Name: HepMC3
Version: 3.2.1
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: C++ Event Record for Monte Carlo Generators
License: GPLv3+
@@ -13,11 +13,11 @@ Patch0: %{name}-config.patch
Patch1: %{name}-arm-memory.patch
# The same test for different python versions must not
# overwrite eachother's files
-#
https://gitlab.cern.ch/hepmc/HepMC3/merge_requests/56
+#
https://gitlab.cern.ch/hepmc/HepMC3/merge_requests/57
Patch2: %{name}-python-tests.patch
-# Workaround for root problem on EPEL 7 ppc64le
-#
https://sft.its.cern.ch/jira/browse/ROOT-10622
-Patch3: %{name}-root-bug-workaround.patch
+# Initialize ROOT in rootIO python bindings
+# Avoids a problem on EPEL 7 ppc64le
+Patch3: %{name}-initialize-root.patch
# The ROOT cmake file used by this project requires cmake 3.9
%if %{?fedora}%{!?fedora:0} || %{?rhel}%{!?rhel:0} >= 8
@@ -43,15 +43,6 @@ BuildRequires: python%{python3_other_pkgversion}-devel
%endif
BuildRequires: python%{python3_pkgversion}-devel
-%if %{?rhel}%{!?rhel:0} == 7
-%ifarch ppc64le
-# Workaround for root problem on EPEL 7 ppc64le
-BuildRequires: python2-root
-BuildRequires: python%{python3_other_pkgversion}-root
-BuildRequires: python%{python3_pkgversion}-root
-%endif
-%endif
-
%description
The HepMC3 package is an object oriented, C++ event record for
High Energy Physics Monte Carlo generators and simulation.
@@ -206,12 +197,7 @@ This package provides HepMC manuals and examples.
%patch0 -p1
%patch1 -p1
%patch2 -p1
-%if %{?rhel}%{!?rhel:0} == 7
-%ifarch ppc64le
-# Workaround for root problem on EPEL 7 ppc64le
%patch3 -p1
-%endif
-%endif
%build
%if %{?fedora}%{!?fedora:0} || %{?rhel}%{!?rhel:0} >= 8
@@ -415,6 +401,10 @@ ctest3 %{?_smp_mflags} --output-on-failure
%license COPYING
%changelog
+* Sun Mar 29 2020 Mattias Ellert <mattias.ellert(a)physics.uu.se> - 3.2.1-2
+- Initialize ROOT in rootIO python bindings - avoids problem on EPEL 7 ppc64le
+- Use upstream's fix for parallel python tests
+
* Sun Mar 22 2020 Mattias Ellert <mattias.ellert(a)physics.uu.se> - 3.2.1-1
- Update to version 3.2.1
- Drop patches accepted upstream or previously backported