public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/oidn] rawhide: Split hip backend as recommended subpackage
@ 2026-11-14  4:07 Luya Tshimbalanga
  0 siblings, 0 replies; only message in thread
From: Luya Tshimbalanga @ 2026-11-14  4:07 UTC (permalink / raw)
  To: git-commits

A new commit has been pushed.

Repo   : rpms/oidn
Branch : rawhide
Commit : baa5b70fa46935a17d3332417bb6c3e586cda388
Author : Luya Tshimbalanga <luya@fedoraproject.org>
Date   : 2026-11-13T21:06:26-07:00
Stats  : +63/-28 in 1 file(s)
URL    : https://src.fedoraproject.org/rpms/oidn/c/baa5b70fa46935a17d3332417bb6c3e586cda388?branch=rawhide

Log:
Split hip backend as recommended subpackage

---
diff --git a/oidn.spec b/oidn.spec
index 554d29f..437f978 100644
--- a/oidn.spec
+++ b/oidn.spec
@@ -1,28 +1,30 @@
-%bcond          gcc 0 #Use clang by default
-# Temporaritly disable hip
-%bcond          hip 0 #%%{undefined flatpak}
+# Use clang by default.
+%bcond          gcc 0
+%bcond          hip %{undefined flatpak}
 %bcond          ninja 1
-#%%global	        prerelease beta
+#%%global               prerelease beta
 Name:           oidn
 Version:        2.5.1
 Release:        %autorelease %{?prerelease: -p -e %{prerelease}}
-Summary:        Library of denoising filters for images rendered with ray tracing
+Summary:        Library of noise reduction filters for images rendered with ray tracing
 License:        Apache-2.0
 URL:            https://openimagedenoise.github.io/
 
 Source0:        https://github.com/OpenImageDenoise/%{name}/releases/download/v%{version}%{?prerelease:-%{prerelease}}/%{name}-%{version}%{?prerelease:-%{prerelease}}.src.tar.gz
 
-%if %{with hip}
-# hipcc is clang based and the extra rpm induced gcc args confuse it
+%if %{without gcc}
 %global toolchain clang
+%endif
+
+%if %{with hip}
 # hipcc does not support some clang flags
 %global build_cxxflags %(echo %{optflags} | sed -e 's/-fstack-protector-strong//' -e 's/-fcf-protection//' -e 's/-mtls-dialect=gnu2//' )
 %endif
 
-# Library only available on x86_64
+# This package currently enables only x86_64 builds.
 ExclusiveArch:  x86_64
 
-BuildRequires:  cmake >= 3.13.0
+BuildRequires:  cmake >= 3.21
 # Enable HIP support
 %if %{with hip}
 BuildRequires:  hipcc
@@ -31,6 +33,7 @@ BuildRequires:  rocm-runtime
 %endif
 # Needed to remove rpath from apps
 BuildRequires:  chrpath
+BuildRequires:  binutils
 %if %{with gcc}
 BuildRequires:  gcc-c++
 %else
@@ -38,7 +41,8 @@ BuildRequires:  clang
 %endif
 BuildRequires:  help2man
 BuildRequires:  cmake(ispcrt)
-Recommends:     ispc-gpu
+BuildRequires:  ispc >= 1.30.0
+BuildRequires:  python3
 %if %{with ninja}
 BuildRequires:  ninja-build
 %endif
@@ -47,15 +51,28 @@ BuildRequires:  pkgconfig(python3)
 BuildRequires:  pkgconfig(tbb)
 
 %description
-Intel Open Image Denoise is an open source library of high-performance, 
-high-quality denoising filters for images rendered with ray tracing.
+Intel Open Image Denoise is an open source library of high-performance,
+high-quality noise reduction filters for images rendered with ray tracing.
 
 %package        libs
 Summary:        Libraries for %{name}
+%if %{with hip}
+Recommends:     %{name}-libs-hip%{?_isa} = %{version}-%{release}
+%endif
 
 %description    libs
 The %{name}-libs package contains shared library for %{name}.
 
+# Enable HIP support
+%if %{with hip}
+%package        libs-hip
+Summary:        HIP backend for %{name}
+Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
+
+%description    libs-hip
+The %{name}-libs-hip package provides the AMD GPU noise reduction backend.
+%endif
+
 %package        devel
 Summary:        Development files for %{name}
 Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
@@ -66,7 +83,6 @@ applications that use %{name}.
 
 %package        docs
 Summary:        Documentation for %{name}
-Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
 BuildArch:      noarch
 
 %description docs
@@ -80,12 +96,17 @@ The %{name}-docs package contains documentation for %{name}.
 %if %{with ninja}
     -G Ninja \
 %endif
-    -DCMAKE_VERBOSE_MAKEFILE:BOOL=TRUE \
+    -DOIDN_DEVICE_CPU=ON \
+    -DOIDN_DEVICE_HIP=%{?with_hip:ON}%{!?with_hip:OFF} \
 %if %{with hip}
-    -DOIDN_DEVICE_HIP=ON \
+    -DROCM_PATH=%{_libdir} \
     -DOIDN_DEVICE_HIP_COMPILER=%{_bindir}/hipcc \
-    -DROCM_PATH=%{_libdir}
 %endif
+    -DOIDN_APPS=ON \
+    -DOIDN_APPS_OPENIMAGEIO=ON \
+    -DOIDN_INSTALL_DEPENDENCIES=OFF \
+    %{nil}
+
 %cmake_build
 
 %install
@@ -93,8 +114,9 @@ The %{name}-docs package contains documentation for %{name}.
 
 # Generate and install man pages.
 install -d '%{buildroot}%{_mandir}/man1'
-for cmd in %{buildroot}%{_bindir}/*
+for app in %{name}Denoise %{name}Test %{name}Benchmark
 do
+  cmd="%{buildroot}%{_bindir}/${app}"
   LD_LIBRARY_PATH='%{buildroot}%{_libdir}' \
       help2man \
       --no-info --no-discard-stderr --version-string='%{version}' \
@@ -102,35 +124,48 @@ do
       "${cmd}"
 done
 
-# Remove rpath
-chrpath --delete %{buildroot}%{_bindir}/%{name}{Denoise,Test,Benchmark}
-chrpath --delete %{buildroot}%{_libdir}/libOpenImageDenoise{,_core,_device_cpu}.so.*
-%if %{with hip}
-chrpath --delete %{buildroot}%{_libdir}/libOpenImageDenoise_device_hip.so.*
-%endif
+# Remove RPATH/RUNPATH from regular ELF files, skipping symlinks.
+find %{buildroot}%{_bindir} %{buildroot}%{_libdir} -type f | while IFS= read -r elf
+do
+  if readelf -h "$elf" >/dev/null 2>&1; then
+    if readelf -d "$elf" | grep -qE '\((RPATH|RUNPATH)\)'; then
+      chrpath --delete "$elf"
+    fi
+  fi
+done
 
 # Remove duplicated documentation
 rm -rf %{buildroot}%{_docdir}/OpenImageDenoise
 
+%check
+# Run upstream tests on the CPU; builders do not need GPU access.
+OIDN_DEVICE_HIP=0 OIDN_DEVICE_SYCL=0 OIDN_DEVICE_CUDA=0 OIDN_DEVICE_METAL=0 \
+LD_LIBRARY_PATH="%{buildroot}%{_libdir}" \
+    %{buildroot}%{_bindir}/oidnTest --device cpu
+
 %files
-%license LICENSE.txt
-%doc CHANGELOG.md 
+%doc CHANGELOG.md
 %{_bindir}/%{name}{Denoise,Test,Benchmark}
 %{_mandir}/man1/%{name}{Denoise,Test,Benchmark}.1.gz
 
 %files libs
+%license LICENSE.txt
 %{_libdir}/libOpenImageDenoise{,_core,_device_cpu}.so.2
 %{_libdir}/libOpenImageDenoise{,_core,_device_cpu}.so.%{version}
+
 %if %{with hip}
+%files libs-hip
 %{_libdir}/libOpenImageDenoise_device_hip.so.%{version}
 %endif
 
 %files docs
-%doc README.md readme.pdf 
+%license LICENSE.txt
+%doc README.md readme.pdf
 
 %files devel
-%{_libdir}/cmake/OpenImageDenoise-%{version}/*.cmake
-%{_includedir}/OpenImageDenoise
+%doc README.md
+%{_libdir}/cmake/OpenImageDenoise-%{version}/
+%{_includedir}/OpenImageDenoise/
 %{_libdir}/libOpenImageDenoise.so
 
 %changelog

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-14  4:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-14  4:07 [rpms/oidn] rawhide: Split hip backend as recommended subpackage Luya Tshimbalanga

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox