Bug 1442048 - enable s390x support
Summary: enable s390x support
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: openblas
Version: rawhide
Hardware: s390x
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Susi Lehtola
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: ZedoraTracker
TreeView+ depends on / blocked
 
Reported: 2017-04-13 12:05 UTC by Dan Horák
Modified: 2017-05-29 16:02 UTC (History)
3 users (show)

Fixed In Version: openblas-0.2.19-11.fc27 openblas-srpm-macros-2-1.fc27
Clone Of:
Environment:
Last Closed: 2017-05-29 16:02:01 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
patch adding s390x support (18.08 KB, patch)
2017-04-13 12:05 UTC, Dan Horák
no flags Details | Diff

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.


Note You need to log in before you can comment on or make changes to this bug.