public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/onednn] f45: Build and package examples in onednn-examples subpackage
@ 2026-11-24 22:56 
  0 siblings, 0 replies; only message in thread
From:  @ 2026-11-24 22:56 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/onednn
            Branch : f45
            Commit : 2b8aa1078efaceb7dad0316df9b7a9287c3bad26
            Author : Miguel Martín <mmartinv@redhat.com>
            Date   : 2026-10-26T16:10:48+01:00
            Stats  : +28/-1 in 1 file(s)
            URL    : https://src.fedoraproject.org/rpms/onednn/c/2b8aa1078efaceb7dad0316df9b7a9287c3bad26?branch=f45

            Log:
            Build and package examples in onednn-examples subpackage

Signed-off-by: Miguel Martín <mmartinv@redhat.com>

---
diff --git a/onednn.spec b/onednn.spec
index 4f49147..5179f5e 100644
--- a/onednn.spec
+++ b/onednn.spec
@@ -95,6 +95,14 @@ Requires:       %{name}%{?_isa} = %{version}-%{release}
 googletest-based unit tests for oneDNN. useful for validating oneDNN
 functionality on target hardware.
 
+%package        examples
+Summary:        Example programs for %{name}
+Requires:       %{name}%{?_isa} = %{version}-%{release}
+
+%description    examples
+Compiled example programs demonstrating oneDNN usage, along with their source
+code. Useful for learning how to use oneDNN primitives and the Graph API.
+
 
 %prep
 %autosetup -p1 -n oneDNN-%{version}
@@ -108,7 +116,7 @@ export LDFLAGS="$LDFLAGS -L%{omp_libdir}"
 %endif
 %cmake \
   -DDNNL_ARCH_OPT_FLAGS="" \
-  -DDNNL_BUILD_EXAMPLES=OFF \
+  -DDNNL_BUILD_EXAMPLES=ON \
   -DDNNL_BUILD_TESTS=ON \
 %ifarch x86_64
   -DCMAKE_C_COMPILER=%{_bindir}/dpclang \
@@ -164,6 +172,20 @@ sed -e 's|@LIBEXECDIR@|%{_libexecdir}|g' \
     %{SOURCE1} > %{buildroot}%{_bindir}/onednn-test
 chmod 0755 %{buildroot}%{_bindir}/onednn-test
 
+# install examples
+install -d %{buildroot}%{_libexecdir}/onednn/examples
+find %{_vpath_builddir}/examples -maxdepth 1 -type f -executable \
+    -exec install -pm0755 {} %{buildroot}%{_libexecdir}/onednn/examples/ \;
+find %{buildroot}%{_libexecdir}/onednn/examples -type f -executable \
+    -exec chrpath -d {} \; 2>/dev/null || true
+
+# install example sources for reference
+install -d %{buildroot}%{_datadir}/onednn/examples
+find examples -type f \( -name '*.cpp' -o -name '*.c' -o -name '*.h' -o -name '*.hpp' \) | while read -r f; do
+    install -d "%{buildroot}%{_datadir}/onednn/$(dirname "$f")"
+    install -pm0644 "$f" "%{buildroot}%{_datadir}/onednn/$f"
+done
+
 
 # Some ocl/gpu tests will fails if lacking an appropriate implementation
 %check
@@ -203,5 +225,10 @@ chmod 0755 %{buildroot}%{_bindir}/onednn-test
 %{_libexecdir}/onednn/gtests/
 
 
+%files examples
+%{_libexecdir}/onednn/examples/
+%{_datadir}/onednn/examples/
+
+
 %changelog
 %autochangelog

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

only message in thread, other threads:[~2026-11-24 22:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-24 22:56 [rpms/onednn] f45: Build and package examples in onednn-examples subpackage 

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