From cbb23f8d5770e83e2770d52b5a3d41f9ca1fc6f7 Mon Sep 17 00:00:00 2001 From: s Date: Thu, 29 Jun 2023 11:25:23 +0800 Subject: [PATCH] fix clang build error: omp --- fix-clang.patch | 14 ++++++++++++++ onednn.spec | 5 ++++- 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 fix-clang.patch diff --git a/fix-clang.patch b/fix-clang.patch new file mode 100644 index 0000000..b3f8249 --- /dev/null +++ b/fix-clang.patch @@ -0,0 +1,14 @@ +diff -u -r oneDNN-2.6/cmake/OpenMP.cmake oneDNN-2.6/cmake/OpenMP.cmake +--- oneDNN-2.6/cmake/OpenMP.cmake 2022-03-30 04:26:28.000000000 +0800 ++++ oneDNN-2.6/cmake/OpenMP.cmake 2023-06-29 10:47:55.000000000 +0800 +@@ -23,8 +23,8 @@ + set(OpenMP_cmake_included true) + include("cmake/Threading.cmake") + +-if (APPLE AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang") +- # OSX Clang doesn't have OpenMP by default. ++if ((APPLE OR UNIX) AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang") ++ # OSX, UNIX Clang doesn't have OpenMP by default. + # But we still want to build the library. + set(_omp_severity "WARNING") + else() diff --git a/onednn.spec b/onednn.spec index d2473a2..5ffc994 100644 --- a/onednn.spec +++ b/onednn.spec @@ -2,12 +2,13 @@ Name: onednn Version: 2.6 -Release: 1 +Release: 2 Summary: Deep Neural Network Library License: ASL 2.0 and BSD and Boost and MIT URL: https://github.com/oneapi-src/oneDNN/ Source0: %{url}/archive/v%{version}/onednn-%{version}.tar.gz +Patch0: fix-clang.patch # This package only work in 64bit arches for now @@ -89,6 +90,8 @@ rm -rf %{buildroot}%{_docdir}/dnnl %{_libdir}/cmake/dnnl/*.cmake %changelog +* Thu Jun 29 2023 yoo - 2.6-2 +- fix clang build error: omp * Sat Aug 6 2022 wisespreading - 2.6-1 - Update to 2.6 for AMX * Wed Dec 22 2021 baihuawei - 2.2-3 -- Gitee