Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 8c68de1a48 |
2
.gitignore
vendored
2
.gitignore
vendored
@ -1 +1 @@
|
||||
/qat-zstd-plugin-*.tar.gz
|
||||
SOURCES/qat-zstd-plugin-0.2.0.tar.gz
|
||||
|
||||
1
.qat-zstd-plugin.metadata
Normal file
1
.qat-zstd-plugin.metadata
Normal file
@ -0,0 +1 @@
|
||||
902e29b525f2bc950e6feed73a68cd9753912134 SOURCES/qat-zstd-plugin-0.2.0.tar.gz
|
||||
46
SOURCES/lib-version.patch
Normal file
46
SOURCES/lib-version.patch
Normal file
@ -0,0 +1,46 @@
|
||||
--- a/src/Makefile 2024-10-09 18:14:19.453675299 +0300
|
||||
+++ b/src/Makefile 2024-10-09 18:25:13.601675269 +0300
|
||||
@@ -79,18 +79,27 @@
|
||||
QATFLAGS += -O3
|
||||
endif
|
||||
|
||||
+VERSION_MAJOR=0
|
||||
+VERSION_MINOR=2
|
||||
+VERSION_PATCH=0
|
||||
+VERSION=$(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_PATCH)
|
||||
+
|
||||
qatseqprod.o: qatseqprod.c
|
||||
$(CC) -c $(CFLAGS) $(QATFLAGS) $(DEBUGFLAGS) $^ -o $@
|
||||
|
||||
lib: qatseqprod.o
|
||||
$(AR) rc libqatseqprod.a $^
|
||||
- $(CC) -shared $^ $(LDFLAGS) -o libqatseqprod.so
|
||||
+ $(CC) -shared $^ $(LDFLAGS) -Wl,-soname,libqatseqprod.so.$(VERSION_MAJOR) -o libqatseqprod.so.$(VERSION)
|
||||
+ ln -sf libqatseqprod.so.$(VERSION) libqatseqprod.so.$(VERSION_MAJOR)
|
||||
+ ln -sf libqatseqprod.so.$(VERSION_MAJOR) libqatseqprod.so
|
||||
|
||||
.PHONY: install
|
||||
install: lib
|
||||
[ -e $(DESTDIR)$(LIBDIR) ] || $(INSTALL) -d -m 755 $(DESTDIR)$(LIBDIR)/
|
||||
[ -e $(DESTDIR)$(INCLUDEDIR) ] || $(INSTALL) -d -m 755 $(DESTDIR)$(INCLUDEDIR)/
|
||||
- $(INSTALL_PROGRAM) libqatseqprod.so $(DESTDIR)$(LIBDIR)
|
||||
+ $(INSTALL_PROGRAM) libqatseqprod.so.$(VERSION) $(DESTDIR)$(LIBDIR)
|
||||
+ ln -sf libqatseqprod.so.$(VERSION) $(DESTDIR)$(LIBDIR)/libqatseqprod.so.$(VERSION_MAJOR)
|
||||
+ ln -sf libqatseqprod.so.$(VERSION_MAJOR) $(DESTDIR)$(LIBDIR)/libqatseqprod.so
|
||||
$(INSTALL_DATA) libqatseqprod.a $(DESTDIR)$(LIBDIR)
|
||||
$(INSTALL_DATA) qatseqprod.h $(DESTDIR)$(INCLUDEDIR)
|
||||
@echo qatseqprod library successfully installed
|
||||
@@ -98,10 +107,12 @@
|
||||
.PHONY: uninstall
|
||||
uninstall:
|
||||
$(RM) $(LIBDIR)/libqatseqprod.a
|
||||
+ $(RM) $(LIBDIR)/libqatseqprod.so.$(VERSION)
|
||||
+ $(RM) $(LIBDIR)/libqatseqprod.so.$(VERSION_MAJOR)
|
||||
$(RM) $(LIBDIR)/libqatseqprod.so
|
||||
$(RM) $(INCLUDEDIR)/qatseqprod.h
|
||||
@echo qatseqprod library successfully uninstalled
|
||||
|
||||
clean:
|
||||
$(RM) *.o
|
||||
- $(RM) libqatseqprod.a libqatseqprod.so
|
||||
+ $(RM) libqatseqprod.a libqatseqprod.so libqatseqprod.so.$(VERSION) libqatseqprod.so.$(VERSION_MAJOR)
|
||||
@ -1,20 +1,16 @@
|
||||
--- a/src/Makefile 2024-10-30 22:20:03.296178391 +0100
|
||||
+++ b/src/Makefile 2024-10-30 22:21:43.915301707 +0100
|
||||
@@ -53,7 +53,7 @@ ifneq ($(ICP_ROOT), )
|
||||
@@ -52,11 +52,11 @@ ifneq ($(ICP_ROOT), )
|
||||
-I$(ICP_ROOT)/quickassist/include/dc \
|
||||
-I$(ICP_ROOT)/quickassist/lookaside/access_layer/include \
|
||||
-I$(ICP_ROOT)/quickassist/utilities/libusdm_drv
|
||||
- LDFLAGS = -Wl,-rpath,$(ICP_ROOT)/build -L$(ICP_ROOT)/build -lqat_s \
|
||||
+ LDFLAGS += -Wl,-rpath,$(ICP_ROOT)/build -L$(ICP_ROOT)/build -lqat_s \
|
||||
-lusdm_drv_s -lnuma
|
||||
-lusdm_drv_s
|
||||
else
|
||||
# In-tree - look for headers in standard locations
|
||||
@@ -63,7 +63,7 @@ else
|
||||
else
|
||||
$(error QAT headers not found in Standard path, Please install QATLib development package or set ICP_ROOT for out-of-tree driver)
|
||||
endif
|
||||
- LDFLAGS = -lqat -lusdm -lnuma
|
||||
+ LDFLAGS += -lqat -lusdm -lnuma
|
||||
QATFLAGS = -DINTREE
|
||||
- LDFLAGS = -lqat -lusdm
|
||||
+ LDFLAGS += -lqat -lusdm
|
||||
endif
|
||||
|
||||
ifdef ZSTDLIB
|
||||
@ -28,4 +24,15 @@
|
||||
+LDFLAGS += -L$(LIB) -I$(LIB)
|
||||
|
||||
ifneq ($(ICP_ROOT), )
|
||||
LDFLAGS += -lqat_s -lusdm_drv_s -lnuma -Wl,-rpath,$(ICP_ROOT)/build -L$(ICP_ROOT)/build
|
||||
LDFLAGS += -lqat_s -lusdm_drv_s -Wl,-rpath,$(ICP_ROOT)/build -L$(ICP_ROOT)/build
|
||||
--- a/src/Makefile 2024-10-30 22:20:03.296178391 +0100
|
||||
+++ b/src/Makefile 2024-10-30 22:21:43.915301707 +0100
|
||||
@@ -76,7 +76,7 @@ DEBUGFLAGS += -DDEBUGLEVEL=$(DEBUGLEVEL)
|
||||
ifneq ($(DEBUGLEVEL), 0)
|
||||
QATFLAGS += -g -O0
|
||||
else
|
||||
- QATFLAGS += -O3
|
||||
+ QATFLAGS += -g -O2
|
||||
endif
|
||||
|
||||
VERSION_MAJOR=0
|
||||
48
SOURCES/test.patch
Normal file
48
SOURCES/test.patch
Normal file
@ -0,0 +1,48 @@
|
||||
--- a/test/Makefile
|
||||
+++ b/test/Makefile
|
||||
@@ -34,24 +34,12 @@
|
||||
# #######################################################################
|
||||
LIB = ../src
|
||||
|
||||
-LDFLAGS = $(LIB)/libqatseqprod.a -I$(LIB)
|
||||
+LDFLAGS = -L$(LIB) -I$(LIB)
|
||||
|
||||
ifneq ($(ICP_ROOT), )
|
||||
LDFLAGS += -lqat_s -lusdm_drv_s -Wl,-rpath,$(ICP_ROOT)/build -L$(ICP_ROOT)/build
|
||||
else
|
||||
- LDFLAGS += -lqat -lusdm
|
||||
-endif
|
||||
-
|
||||
-ifdef ZSTDLIB
|
||||
-LDFLAGS += $(ZSTDLIB)/libzstd.a
|
||||
-else
|
||||
-ZSTDLIB := $(shell find /usr /lib /local -name 'libzstd.a' 2>/dev/null | head -n 1)
|
||||
-ZSTDLIB ?= /usr/local/lib/libzstd.a
|
||||
-ifneq ("$(wildcard $(ZSTDLIB))","")
|
||||
- LDFLAGS += $(ZSTDLIB)
|
||||
-else
|
||||
- $(error libzstd.a not found, please install libzstd or specify the path manually)
|
||||
-endif
|
||||
+ LDFLAGS += -lzstd -lqatseqprod -lqat -lusdm
|
||||
endif
|
||||
|
||||
default: test benchmark
|
||||
--- a/test/test.c
|
||||
+++ b/test/test.c
|
||||
@@ -44,9 +44,6 @@
|
||||
|
||||
#include "qatseqprod.h"
|
||||
|
||||
-#ifndef ZSTD_STATIC_LINKING_ONLY
|
||||
-#define ZSTD_STATIC_LINKING_ONLY
|
||||
-#endif
|
||||
#include "zstd.h"
|
||||
#include "zstd_errors.h"
|
||||
|
||||
@@ -143,4 +140,4 @@
|
||||
free(dstBuffer);
|
||||
free(decompBuffer);
|
||||
return 0;
|
||||
-}
|
||||
\ No newline at end of file
|
||||
+}
|
||||
@ -1,7 +1,15 @@
|
||||
# SPDX-License-Identifier: MIT
|
||||
## START: Set by rpmautospec
|
||||
## (rpmautospec version 0.6.5)
|
||||
## RPMAUTOSPEC: autorelease, autochangelog
|
||||
%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
|
||||
release_number = 3;
|
||||
base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}"));
|
||||
print(release_number + base_release_number - 1);
|
||||
}%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}}
|
||||
## END: Set by rpmautospec
|
||||
|
||||
Name: qat-zstd-plugin
|
||||
Version: 1.0.0
|
||||
Version: 0.2.0
|
||||
Release: %autorelease
|
||||
Summary: Intel QuickAssist Technology ZSTD Plugin
|
||||
|
||||
@ -9,14 +17,14 @@ License: BSD-3-Clause
|
||||
URL: https://github.com/intel/QAT-ZSTD-Plugin
|
||||
Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
|
||||
|
||||
Patch0: test.patch
|
||||
Patch1: rh-makefile.patch
|
||||
Patch0: lib-version.patch
|
||||
Patch1: test.patch
|
||||
Patch2: rh-makefile.patch
|
||||
|
||||
BuildRequires: automake
|
||||
BuildRequires: gcc
|
||||
BuildRequires: libzstd-devel
|
||||
BuildRequires: qatlib-devel
|
||||
BuildRequires: numactl-devel
|
||||
|
||||
# Upstream only supports x86_64
|
||||
ExclusiveArch: x86_64
|
||||
@ -61,7 +69,7 @@ LD_LIBRARY_PATH=%{buildroot}%{_libdir} ./test/test README.md
|
||||
|
||||
%files
|
||||
%license LICENSE
|
||||
%{_libdir}/libqatseqprod.so.1
|
||||
%{_libdir}/libqatseqprod.so.0
|
||||
%{_libdir}/libqatseqprod.so.%{version}
|
||||
|
||||
%files devel
|
||||
@ -73,4 +81,7 @@ LD_LIBRARY_PATH=%{buildroot}%{_libdir} ./test/test README.md
|
||||
%{_libdir}/libqatseqprod.a
|
||||
|
||||
%changelog
|
||||
%autochangelog
|
||||
## START: Generated by rpmautospec
|
||||
* Tue Oct 29 2024 Vladis Dronov <vdronov@redhat.com> - 0.2.0-1
|
||||
- Initial commit on c9s (RHEL-46072)
|
||||
## END: Generated by rpmautospec
|
||||
1
sources
1
sources
@ -1 +0,0 @@
|
||||
SHA512 (qat-zstd-plugin-1.0.0.tar.gz) = 6ee92f0631d4b66f250db7b55a84f2c6fe37ca70d72ad30c6d7559034ac74f24511963ebd877dfd323e9f66bccf3f311ba215167cb60338f4181cf060fb81286
|
||||
62
test.patch
62
test.patch
@ -1,62 +0,0 @@
|
||||
--- a/test/Makefile
|
||||
+++ b/test/Makefile
|
||||
@@ -34,42 +34,27 @@
|
||||
# #######################################################################
|
||||
LIB = ../src
|
||||
|
||||
-LDFLAGS = $(LIB)/libqatseqprod.a -I$(LIB)
|
||||
+LDFLAGS = -L$(LIB) -I$(LIB)
|
||||
|
||||
ifneq ($(ICP_ROOT), )
|
||||
LDFLAGS += -lqat_s -lusdm_drv_s -lnuma -Wl,-rpath,$(ICP_ROOT)/build -L$(ICP_ROOT)/build
|
||||
else
|
||||
- LDFLAGS += -lqat -lusdm -lnuma
|
||||
-endif
|
||||
-
|
||||
-ifdef ZSTDLIB
|
||||
-CFLAGS += -I$(ZSTDLIB)
|
||||
-LDFLAGS += $(ZSTDLIB)/libzstd.a
|
||||
-else
|
||||
-ZSTDLIB := $(shell find /usr /lib /local -name 'libzstd.a' 2>/dev/null | head -n 1| xargs dirname)
|
||||
-LDFLAGS += $(ZSTDLIB)/libzstd.a
|
||||
+ LDFLAGS += -lzstd -lqatseqprod -lqat -lusdm
|
||||
endif
|
||||
|
||||
default: test benchmark
|
||||
|
||||
all: test benchmark
|
||||
|
||||
-check_zstdlib:
|
||||
- @echo checking zstd static libaray '$(ZSTDLIB)/libzstd.a'
|
||||
- @if [ ! -e $(ZSTDLIB)/libzstd.a ]; then \
|
||||
- echo libzstd.a is not found, please install libzstd or specify the path manually; \
|
||||
- exit 1; \
|
||||
- fi
|
||||
-
|
||||
-test: test.c check_zstdlib
|
||||
+test: test.c
|
||||
$(Q)$(MAKE) -C $(LIB)
|
||||
$(CC) $< $(CFLAGS) $(LDFLAGS) -o $@
|
||||
|
||||
-benchmark: benchmark.c check_zstdlib
|
||||
+benchmark: benchmark.c
|
||||
$(Q)$(MAKE) -C $(LIB)
|
||||
$(CC) $(CFLAGS) $< $(LDFLAGS) -o $@ -lpthread
|
||||
|
||||
clean:
|
||||
$(Q)$(MAKE) -C $(LIB) $@
|
||||
$(RM) test benchmark
|
||||
-.PHONY: clean check_zstdlib
|
||||
+.PHONY: clean
|
||||
--- a/test/test.c
|
||||
+++ b/test/test.c
|
||||
@@ -44,9 +44,6 @@
|
||||
|
||||
#include "qatseqprod.h"
|
||||
|
||||
-#ifndef ZSTD_STATIC_LINKING_ONLY
|
||||
-#define ZSTD_STATIC_LINKING_ONLY
|
||||
-#endif
|
||||
#include "zstd.h"
|
||||
#include "zstd_errors.h"
|
||||
|
||||
@ -1,7 +0,0 @@
|
||||
A test should be configured as BaseOS CI test (not an OSCI one), as it require
|
||||
an x86_64 machine with QAT_4XXX (or later) hardware, so it should be run in Beaker.
|
||||
|
||||
see: https://one.redhat.com/rhel-development-guide/#proc_enable-gating_assembly_enabling-gating
|
||||
and: https://docs.engineering.redhat.com/display/RTT/Onboarding+gating+tests
|
||||
and: https://docs.engineering.redhat.com/pages/viewpage.action?pageId=53110084
|
||||
and: https://docs.engineering.redhat.com/display/RTT/Creating+and+Updating+beaker+test
|
||||
@ -1,5 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# There is a test binary and %check rpm target for testing
|
||||
echo QAT-ZSTD-Plugin nulltest is PASS
|
||||
exit 0
|
||||
@ -1,10 +0,0 @@
|
||||
---
|
||||
- hosts: localhost
|
||||
roles:
|
||||
- role: standard-test-basic
|
||||
tags:
|
||||
- classic
|
||||
tests:
|
||||
- nulltest:
|
||||
dir: .
|
||||
run: nulltest.sh
|
||||
Loading…
Reference in New Issue
Block a user