diff --git a/rocsolver.spec b/rocsolver.spec index 4bd2da4..11ae822 100644 --- a/rocsolver.spec +++ b/rocsolver.spec @@ -8,18 +8,23 @@ # build_cxxflags does not honor CMAKE_BUILD_TYPE, strip out -g %global build_cxxflags %(echo %{optflags} | sed -e 's/-fstack-protector-strong/-Xarch_host -fstack-protector-strong/' -e 's/-fcf-protection/-Xarch_host -fcf-protection/' -e 's/-g / /') -# Do not build the debug package -# building with CMAKE_BUILD_TYPE=RelWithDebInfo causes link overflows -# So instead of breaking building into gpu specific libs, disable debug info -%global debug_package %{nil} - # $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 + %bcond_with test +%if %{with test} +%global build_test ON +%global __brp_check_rpaths %{nil} +%else +%global build_test OFF +%endif # may run out of memory for both compile and link # Use fine tuned cmake ROCSOLVER_PARALLEL_COMPILE|LINK_JOBS switches @@ -70,33 +75,9 @@ BuildRequires: lapack-static rocSOLVER is a work-in-progress implementation of a subset of LAPACK functionality on the ROCm platform. -%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} @@ -136,13 +117,18 @@ LINK_JOBS=`eval "expr 1 + ${MEM_GB} / ${LINK_MEM}"` for gpu in %{rocm_gpu_list} do module load rocm/$gpu - %cmake %rocm_cmake_options \ + %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 \ -DROCSOLVER_PARALLEL_COMPILE_JOBS=$COMPILE_JOBS \ -DROCSOLVER_PARALLEL_LINK_JOBS=$LINK_JOBS \ - -DCMAKE_BUILD_TYPE=RELEASE \ -%if %{with test} - -DBUILD_CLIENTS_TESTS=ON -%endif + -DBUILD_CLIENTS_TESTS=%{build_test} %cmake_build module purge @@ -154,71 +140,27 @@ do %cmake_install done -# strip *.so -strip %{buildroot}%{_libdir}/librocsolver.so.0.* -strip %{buildroot}%{_libdir}/rocm/gfx*/lib/librocsolver.so.0.* +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 'mat_*' | sed -f br.sed >> %{name}.test +find %{buildroot} -name 'posmat_*' | sed -f br.sed >> %{name}.test +%endif -%files +%files -f %{name}.files %license LICENSE.md %exclude %{_docdir}/%{name}/LICENSE.md -%{_libdir}/lib%{name}.so.* -%{_libdir}/rocm/gfx{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 -%dir %{_includedir}/%{name} -%dir %{_libdir}/cmake/%{name} -%dir %{_libdir}/rocm/gfx{9,10,11}/lib/cmake/%{name} +%files devel -f %{name}.devel %doc README.md %{_includedir}/%{name}/*.h -%{_libdir}/cmake/%{name}/*.cmake -%{_libdir}/lib%{name}.so -%{_libdir}/rocm/gfx*/lib/lib%{name}.so -%{_libdir}/rocm/gfx*/lib/cmake/%{name}/*.cmake %if %{with test} -%files test -%dir %{_datadir}/%{name} -%dir %{_datadir}/%{name}/test -%dir %{_datadir}/%{name}/test/mat_20_60 -%dir %{_datadir}/%{name}/test/mat_20_100 -%dir %{_datadir}/%{name}/test/mat_20_140 -%dir %{_datadir}/%{name}/test/mat_50_60 -%dir %{_datadir}/%{name}/test/mat_50_100 -%dir %{_datadir}/%{name}/test/mat_50_140 -%dir %{_datadir}/%{name}/test/mat_100_300 -%dir %{_datadir}/%{name}/test/mat_100_500 -%dir %{_datadir}/%{name}/test/mat_100_700 -%dir %{_datadir}/%{name}/test/mat_250_300 -%dir %{_datadir}/%{name}/test/mat_250_500 -%dir %{_datadir}/%{name}/test/mat_250_700 - -%{_datadir}/%{name}/test/mat_20_60/* -%{_datadir}/%{name}/test/mat_20_100/* -%{_datadir}/%{name}/test/mat_20_140/* -%{_datadir}/%{name}/test/mat_50_60/* -%{_datadir}/%{name}/test/mat_50_100/* -%{_datadir}/%{name}/test/mat_50_140/* -%{_datadir}/%{name}/test/mat_100_300/* -%{_datadir}/%{name}/test/mat_100_500/* -%{_datadir}/%{name}/test/mat_100_700/* -%{_datadir}/%{name}/test/mat_250_300/* -%{_datadir}/%{name}/test/mat_250_500/* -%{_datadir}/%{name}/test/mat_250_700/* -%{_bindir}/%{name}* -%{_libdir}/rocm/gfx*/bin/%{name}* +%files test -f %{name}.test %endif %changelog