public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
To: git-commits@fedoraproject.org
Subject: [rpms/onednn] f45: Build and package examples in onednn-examples subpackage
Date: Tue, 24 Nov 2026 22:56:53 GMT	[thread overview]
Message-ID: <179556101320.1.13989245253330748252.rpms-onednn-2b8aa1078efa@fedoraproject.org> (raw)

            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

                 reply	other threads:[~2026-11-24 22:56 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179556101320.1.13989245253330748252.rpms-onednn-2b8aa1078efa@fedoraproject.org \
    --to=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox