Compare commits

3 Commits

Author SHA1 Message Date
bb95510603 Add rocsolver/test directory to test package
Signed-off-by: Egbert Eich <eich@suse.com>
2025-08-19 15:02:15 +02:00
9f20859e66 Fix buildinfo and compiler flags handling for SUSE
When building without debug support, remove `-g` flag
from compiler arguments.
Also make sure the %build_cxxflags macro is used. SUSE
doesn't use it by default.

Signed-off-by: Egbert Eich <eich@suse.com>
2025-08-11 16:18:11 +02:00
bfd8ee5f1b On SUSE use __builder flag to switch to Ninja
Signed-off-by: Egbert Eich <eich@suse.com>
2025-08-10 18:54:52 +02:00

View File

@@ -1,24 +1,3 @@
#
# Copyright Fedora Project Authors.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
%if 0%{?suse_version}
%global rocsolver_name librocsolver0
%else
@@ -36,11 +15,18 @@
%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/-mtls-dialect=gnu2//')
%bcond_with debug
%if 0%{?suse_version}
%if %{without debug}
%global build_type RELEASE
%global build_cxxflags %(echo %{optflags} | sed -e 's/-g\\( \\|$\\)/ /')
%endif
%else
%if %{with debug}
%global build_type DEBUG
%else
%global build_type RelWithDebInfo
%endif
%endif
%bcond_without compress
%if %{with compress}
@@ -77,9 +63,11 @@
%endif
%if %{with ninja}
%global cmake_generator -G Ninja
%if 0%{?suse_version}
%define __builder ninja
%else
%global cmake_generator %{nil}
%global cmake_generator -G Ninja
%endif
%endif
# export an llvm compilation database
@@ -261,13 +249,14 @@ if [ "$LINK_JOBS" -lt "$JOBS" ]; then
JOBS=$LINK_JOBS
fi
%cmake %{cmake_generator} \
%{?suse_version:%{?build_cxxflags:CXXFLAGS="%{build_cxxflags}"}}
%cmake %{?cmake_generator} \
-DCMAKE_CXX_COMPILER=hipcc \
-DCMAKE_C_COMPILER=hipcc \
-DCMAKE_LINKER=%rocmllvm_bindir/ld.lld \
-DCMAKE_AR=%rocmllvm_bindir/llvm-ar \
-DCMAKE_RANLIB=%rocmllvm_bindir/llvm-ranlib \
-DCMAKE_BUILD_TYPE=%{build_type} \
%{?build_type:-DCMAKE_BUILD_TYPE=%{build_type}} \
-DCMAKE_EXPORT_COMPILE_COMMANDS=%{build_compile_db} \
-DCMAKE_PREFIX_PATH=%{rocmllvm_cmakedir}/.. \
-DCMAKE_SKIP_RPATH=ON \
@@ -291,7 +280,9 @@ fi
%install
%cmake_install
rm -f %{buildroot}%{_prefix}/share/doc/rocsolver/LICENSE.md
if [ -f %{buildroot}%{_prefix}/share/doc/rocsolver/LICENSE.md ]; then
rm %{buildroot}%{_prefix}/share/doc/rocsolver/LICENSE.md
fi
%files
%license LICENSE.md
@@ -308,16 +299,18 @@ rm -f %{buildroot}%{_prefix}/share/doc/rocsolver/LICENSE.md
%if %{with test}
%files test
%dir %{_datadir}/rocsolver
%dir %{_datadir}/rocsolver/test
%{_datadir}/rocsolver/test/*
%{_bindir}/rocsolver*
%endif
%changelog
* Wed Aug 27 2025 Tom Rix <Tom.Rix@amd.com> - 6.4.2-5
- Add Fedora copyright
* Fri Aug 15 2025 Egbert Eich <eich@suse.com> - 6.4.2-5
- Add rocsolver/test directory to test package.
* Mon Aug 25 2025 Tom Rix <Tom.Rix@amd.com> - 6.4.2-4
- Simplify removal of files
* Sun Aug 10 2025 Egbert Eich <eich@suse.com> - 6.4.2-4
- On SUSE use __builder flag to switch to Ninja
- Fix buildinfo and compiler flags handling for SUSE.
* Wed Aug 6 2025 Tom Rix <Tom.Rix@amd.com> - 6.4.2-3
- Default build type RelWithDebInfo