sdma_dk: support sdma_tool

1. support function/performance test using sdma_tool
2. fix some cmc code review problems

Signed-off-by: zhangshuowen96 <zhangshuowen@hisilicon.com>
This commit is contained in:
zhangshuowen96 2024-10-09 10:50:43 +08:00
parent 7b09bcf8c1
commit 06ad812067
2 changed files with 28 additions and 16 deletions

Binary file not shown.

View File

@ -1,42 +1,54 @@
Name: sdma-dk
Version: 1.0.0
Release: 4%{?dist}
Release: 5%{?dist}
Summary: SDMA user-mode driver
License: Apache-2.0
Source0: %{name}-%{version}.tar.gz
BuildRoot: %{_buildrootdir}/%{name}-%{version}-build
BuildRequires: make gcc autoconf automake libtool
BuildRequires: cmake make gcc gcc-c++ chrpath memkind-devel numactl-devel
ExclusiveArch: aarch64
%define debug_package %{nil}
%description
This pakege contains dynamic link library of sdma module: libsdma_dk.so
and test tool: sdma_tool, which support base function test and performance
test.
%prep
%autosetup
aclocal
autoconf
autoheader
libtoolize --automake --copy --debug --force
automake --add-missing
%setup -c -n %{name}-%{version}
%build
%configure --prefix=${RPM_BUILD_ROOT}/%{_libdir} --disable-static LDFLAGS="-s"
cd %{name}-%{version}
cmake ./
make
%install
rm -rf %{buildroot}
mkdir -p %{buildroot}
make install DESTDIR=%{buildroot}
find ${RPM_BUILD_ROOT}/%{_libdir}/ -name '*.so*'
%{__rm} -rf %{buildroot}
install -d %{buildroot}
mkdir -p %{buildroot}%{_libdir}
mkdir -p %{buildroot}%{_includedir}
mkdir -p %{buildroot}%{_bindir}
cp ./%{name}-%{version}/lib/libsdma_dk.so %{buildroot}%{_libdir}
cp ./%{name}-%{version}/lib/mdk_sdma.h %{buildroot}%{_includedir}
cp ./%{name}-%{version}/tool/sdma_tool %{buildroot}%{_bindir}
chrpath -d %{buildroot}%{_bindir}/sdma_tool
%clean
%{__rm} -rf %{buildroot}
%files
%defattr(755,root,root)
%{_libdir}/libsdma_dk*
/usr/include/*
%defattr(-,root,root)
%{_libdir}/libsdma_dk*
%{_includedir}/mdk_sdma.h
%{_bindir}/sdma_tool
%changelog
* Tue Oct 8 2024 zhangshuowen <zhangshuowen@hisilicon.com> - 1.0.0-5
- Type:feature
- DESC: add sdma_tool to support function test and performance test of sdma
* Sun Sep 15 2024 zhangyuyang <zhangyuyang31@huawei.com> - 1.0.0-4
- Type:bugfix
- DESC:fix bug code by review