Generate files lists

Signed-off-by: Tom Rix <Tom.Rix@amd.com>
This commit is contained in:
2024-09-14 07:01:18 -07:00
parent 8e644e5c25
commit b75ca98a5e

View File

@@ -10,10 +10,21 @@
# $gpu will be evaluated in the loops below
%global _vpath_builddir %{_vendor}-%{_target_os}-build-${gpu}
# Tests are downloaded so this option is only good for local building
# Also need to
# export QA_RPATHS=0xff
%bcond_with debug
%if %{with debug}
%global build_type DEBUG
%else
%global build_type RelWithDebInfo
%endif
# downloads tests, use mock --enable-network
%bcond_with test
%if %{with test}
%global build_test ON
%global __brp_check_rpaths %{nil}
%else
%global build_test OFF
%endif
Name: rocsparse
Version: %{rocm_version}
@@ -38,8 +49,10 @@ BuildRequires: rocm-rpm-macros-modules
BuildRequires: rocprim-static
%if %{with test}
BuildRequires: gcc-gfortran
BuildRequires: gtest-devel
BuildRequires: libomp-devel
BuildRequires: python3-pyyaml
BuildRequires: rocblas-devel
%endif
@@ -53,33 +66,9 @@ ROCm runtime and toolchains. rocSPARSE is created using
the HIP programming language and optimized for AMD's
latest discrete GPUs.
%package gfx90a
Summary: %{name} for MI200
%description gfx90a
%{summary}
%package gfx942
Summary: %{name} for MI300
%description gfx942
%{summary}
%package gfx1100
Summary: %{name} for W7900
%description gfx1100
%{summary}
%package gfx1103
Summary: %{name} for gfx1103 (experimental)
%description gfx1103
%{summary}
%package devel
Summary: Libraries and headers for %{name}
Requires: %{name}%{?_isa} = %{version}-%{release}
Requires: %{name}-gfx90a%{?_isa} = %{version}-%{release}
Requires: %{name}-gfx942%{?_isa} = %{version}-%{release}
Requires: %{name}-gfx1100%{?_isa} = %{version}-%{release}
Requires: %{name}-gfx1103%{?_isa} = %{version}-%{release}
%description devel
%{summary}
@@ -100,10 +89,19 @@ Requires: %{name}%{?_isa} = %{version}-%{release}
for gpu in %{rocm_gpu_list}
do
module load rocm/$gpu
%cmake %rocm_cmake_options \
%if %{with test}
%rocm_cmake_test_options
%endif
%cmake -G Ninja \
-DCMAKE_BUILD_TYPE=%build_type \
-DCMAKE_SKIP_RPATH=ON \
-DBUILD_FILE_REORG_BACKWARD_COMPATIBILITY=OFF \
-DROCM_SYMLINK_LIBS=OFF \
-DHIP_PLATFORM=amd \
-DAMDGPU_TARGETS=$ROCM_GPUS \
-DCMAKE_INSTALL_LIBDIR=$ROCM_LIB \
-DCMAKE_INSTALL_BINDIR=$ROCM_BIN \
-DBUILD_CLIENTS_BENCHMARKS=%{build_test} \
-DBUILD_CLIENTS_TESTS=%{build_test} \
-DBUILD_CLIENTS_TESTS_OPENMP=OFF \
-DBUILD_FORTRAN_CLIENTS=OFF
%cmake_build
module purge
@@ -117,36 +115,27 @@ do
%cmake_install
done
%files
echo s@%{buildroot}@@ > br.sed
find %{buildroot}%{_libdir} -name '*.so.*.[0-9]' | sed -f br.sed > %{name}.files
find %{buildroot}%{_libdir} -name '*.so.[0-9]' | sed -f br.sed >> %{name}.files
find %{buildroot}%{_libdir} -name '*.so' | sed -f br.sed > %{name}.devel
find %{buildroot}%{_libdir} -name '*.cmake' | sed -f br.sed >> %{name}.devel
%if %{with test}
find %{buildroot} -name '%{name}-*' | sed -f br.sed > %{name}.test
find %{buildroot} -name '%{name}io-*' | sed -f br.sed >> %{name}.test
find %{buildroot} -name '%{name}_*' | sed -f br.sed >> %{name}.test
%endif
%files -f %{name}.files
%license LICENSE.md
%exclude %{_docdir}/%{name}/LICENSE.md
%{_libdir}/lib%{name}.so.*
%{_libdir}/rocm/gfx{8,9,10,11}/lib/lib%{name}.so.*
%files gfx90a
%{_libdir}/rocm/gfx90a/lib/lib%{name}.so.*
%files gfx942
%{_libdir}/rocm/gfx942/lib/lib%{name}.so.*
%files gfx1100
%{_libdir}/rocm/gfx1100/lib/lib%{name}.so.*
%files gfx1103
%{_libdir}/rocm/gfx1103/lib/lib%{name}.so.*
%files devel
%files devel -f %{name}.devel
%doc README.md
%{_includedir}/%{name}
%{_libdir}/cmake/%{name}/
%{_libdir}/lib%{name}.so
%{_libdir}/rocm/gfx*/lib/lib%{name}.so
%{_libdir}/rocm/gfx*/lib/cmake/%{name}/
%if %{with test}
%files test
%{_bindir}/%{name}*
%{_libdir}/rocm/gfx*/bin/%{name}*
%files test -f %{name}.test
%endif
%changelog