From 2b895f64a1bf3b7c9e3d03d1b542533a41e14667 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C4=8Cajka?= Date: Fri, 25 Mar 2022 18:06:51 +0100 Subject: [PATCH] Initial package import Resolves: RHBZ#2070957 --- .gitignore | 1 + gating.yaml | 6 ++++ libzdnn.spec | 81 ++++++++++++++++++++++++++++++++++++++++++++++++++++ sources | 1 + 4 files changed, 89 insertions(+) create mode 100644 gating.yaml create mode 100644 libzdnn.spec create mode 100644 sources diff --git a/.gitignore b/.gitignore index e69de29..d2d2535 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/libzdnn-0.4.0.tar.gz diff --git a/gating.yaml b/gating.yaml new file mode 100644 index 0000000..c190bde --- /dev/null +++ b/gating.yaml @@ -0,0 +1,6 @@ +--- !Policy +product_versions: + - rhel-9 +decision_context: osci_compose_gate +rules: + - !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.tier1.functional} diff --git a/libzdnn.spec b/libzdnn.spec new file mode 100644 index 0000000..fc6b668 --- /dev/null +++ b/libzdnn.spec @@ -0,0 +1,81 @@ +Name: libzdnn +Version: 0.4.0 +Release: 1%{?dist} +Summary: Driver library for the IBM Z Neural Network Processing Assist Facility + +License: ASL 2.0 +Url: https://github.com/IBM/zDNN +Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz + +ExclusiveArch: s390x +BuildRequires: gcc +BuildRequires: g++ +BuildRequires: make +BuildRequires: gawk +BuildRequires: automake +BuildRequires: autoconf + +# Be explicit about the soversion in order to avoid unintentional changes. +%global soversion 0 + +%description +The zDNN library provide a user space API for exploitation of the +Neural Network Processing Assist Facility. All application which +intend to use that facility on IBM Z are supposed to do this via this +library. + + +%package devel +Summary: Development files for %{name} +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description devel +The %{name}-devel package contains libraries and header files for +developing applications that use %{name}. + + +%package static +Summary: Static library version %{name} +Requires: %{name}-devel%{?_isa} = %{version}-%{release} + +%description static +The %{name}-static package contains the static library of %{name}. + + +%prep +%autosetup -p1 -n zDNN-%{version} +autoreconf -i + +%build +# libzdnn needs to be built with z14 support so override the distro wide options to append -march=z14. +# cflags for the init routines in e.g. zdnn_init.c should just use the distro options. +# export CFLAGS_INIT explicitely since it is not handled by configure +CFLAGS_INIT="%{build_cflags}"; export CFLAGS_INIT; CFLAGS="%{build_cflags} -march=z14 -mtune=z14" CXXFLAGS="%{build_cxxflags} -march=z14 -mtune=z14" %configure +%make_build build + +%install +%make_install +mv $RPM_BUILD_ROOT%{_libdir}/libzdnn.so.%{soversion} $RPM_BUILD_ROOT%{_libdir}/libzdnn.so.%{version} +ln -s -r $RPM_BUILD_ROOT%{_libdir}/libzdnn.so.%{version} $RPM_BUILD_ROOT%{_libdir}/libzdnn.so.%{soversion} + +rm -f $RPM_BUILD_ROOT%{_libdir}/libzdnn.so +ln -s -r $RPM_BUILD_ROOT%{_libdir}/libzdnn.so.%{version} $RPM_BUILD_ROOT%{_libdir}/libzdnn.so + + +%files +%{_libdir}/libzdnn.so.%{version} +%{_libdir}/libzdnn.so.%{soversion} +%doc README.md +%license LICENSE + +%files devel +%{_includedir}/zdnn.h +%{_libdir}/*.so + +%files static +%{_libdir}/libzdnn.a + +%changelog +* Fri Mar 25 2022 Jakub - 0.4.0-1 +- Initial package import +- Resolves: RHBZ#2070957 diff --git a/sources b/sources new file mode 100644 index 0000000..30922e9 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (libzdnn-0.4.0.tar.gz) = 89a49a46732f1a1af1832d5584305259620cc2acb9bbca9f8aab6b57b22f316c979c8f6d77aee301589b80ee9a42a72e67fe2f196b4dcae240fc5fdfda09b10d