Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.

Bug 1442048

Summary: enable s390x support
Product: [Fedora] Fedora Reporter: Dan Horák <dan>
Component: openblasAssignee: Susi Lehtola <susi.lehtola>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: hannsj_uhl, orion, susi.lehtola
Target Milestone: ---   
Target Release: ---   
Hardware: s390x   
OS: Unspecified   
Whiteboard:
Fixed In Version: openblas-0.2.19-11.fc27 openblas-srpm-macros-2-1.fc27 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-05-29 16:02:01 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 467765    
Attachments:
Description Flags
patch adding s390x support none

Description Dan Horák 2017-04-13 12:05:03 UTC
Created attachment 1271416 [details]
patch adding s390x support

There is an upstream branch with s390x support [1] and the first commit [2] adds a generic kernel for s390x. With a small fix on top of that I was able to build openblas package on s390x [3] (fails in the %install section in spec that needs updating).

[1] https://github.com/xianyi/OpenBLAS/commits/z13
[2] https://github.com/xianyi/OpenBLAS/commit/dd43661cfd5d3de6e9fe804587b89f1094c85e41
[3] https://s390.koji.fedoraproject.org/koji/taskinfo?taskID=2549380

Comment 1 Dan Horák 2017-04-13 14:21:42 UTC
successful scratch build = https://s390.koji.fedoraproject.org/koji/taskinfo?taskID=2549408

required spec file changes

diff --git a/openblas.spec b/openblas.spec
index 83b3da8..dac23ef 100644
--- a/openblas.spec
+++ b/openblas.spec
@@ -31,6 +31,8 @@ Patch2:         openblas-0.2.15-constructor.patch
 Patch3:         openblas-0.2.19-tests.patch
 # From https://github.com/xianyi/OpenBLAS/issues/1078#issuecomment-279527810
 Patch4:         openblas-0.2.19-fix_register_clobbers.patch
+#
+Patch5:         openblas-0.2.19-s390x.patch
 
 BuildRoot:      %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
 
@@ -91,7 +93,7 @@ BuildRequires:  lapack64-static
 
 # Upstream supports the package only on these architectures.
 # Runtime processor detection is not available on other archs.
-ExclusiveArch:  %{openblas_arches}
+ExclusiveArch:  %{openblas_arches} s390x
 
 %global base_description \
 OpenBLAS is an optimized BLAS library based on GotoBLAS2 1.13 BSD \
@@ -237,6 +239,7 @@ cd OpenBLAS-%{version}
 %endif
 %patch3 -p1 -b .tests
 %patch4 -p1 -b .register_clobbers
+%patch5 -p1 -b .s390x
 
 # Fix source permissions
 find -name \*.f -exec chmod 644 {} \;
@@ -426,6 +429,9 @@ suffix="_power8"
 %ifarch aarch64
 suffix="_armv8"
 %endif
+%ifarch s390x
+suffix="_zarch_generic"
+%endif
 slibname=`basename %{buildroot}%{_libdir}/libopenblas${suffix}-*.so .so`
 mv %{buildroot}%{_libdir}/${slibname}.a %{buildroot}%{_libdir}/lib%{name}.a
 if [[ "$suffix" != "" ]]; then


I've already reported the missing piece in https://github.com/xianyi/OpenBLAS/pull/1154

The upstream "develop" branch will need small adjustment for allowing the generic backend on machines older than z13.

Comment 2 Dan Horák 2017-05-26 08:03:04 UTC
Ping, it became more important now when s390x is part of the primary koji instance. All needed fixes are now in upstream, let me know if I can update the openblas package in Rawhide.

Comment 3 Susi Lehtola 2017-05-26 18:36:32 UTC
Sure, go ahead.