]> git.pld-linux.org Git - packages/OpenCASCADE.git/commitdiff
fix build with tbb 2021.4
authorJan Palus <atler@pld-linux.org>
Mon, 20 Dec 2021 14:46:11 +0000 (15:46 +0100)
committerJan Palus <atler@pld-linux.org>
Mon, 20 Dec 2021 14:46:11 +0000 (15:46 +0100)
OpenCASCADE-tbb.patch [new file with mode: 0644]
OpenCASCADE.spec

diff --git a/OpenCASCADE-tbb.patch b/OpenCASCADE-tbb.patch
new file mode 100644 (file)
index 0000000..999c118
--- /dev/null
@@ -0,0 +1,33 @@
+diff -u -r opencascade-7.5.0.orig/src/OSD/OSD_Parallel_TBB.cxx opencascade-7.5.0/src/OSD/OSD_Parallel_TBB.cxx
+--- opencascade-7.5.0.orig/src/OSD/OSD_Parallel_TBB.cxx        2020-11-03 15:50:04.000000000 +0100
++++ opencascade-7.5.0/src/OSD/OSD_Parallel_TBB.cxx     2021-12-20 15:02:25.028915774 +0100
+@@ -25,7 +25,7 @@
+ #include <tbb/parallel_for.h>
+ #include <tbb/parallel_for_each.h>
+ #include <tbb/blocked_range.h>
+-#include <tbb/task_scheduler_init.h>
++#include <tbb/global_control.h>
+ Standard_ENABLE_DEPRECATION_WARNINGS
+ //=======================================================================
+@@ -38,19 +38,12 @@
+                                     const FunctorInterface& theFunctor,
+                                     Standard_Integer theNbItems)
+ {
+-  try
+-  {
+     const Handle(OSD_ThreadPool)& aThreadPool = OSD_ThreadPool::DefaultPool();
+     const Standard_Integer aNbThreads = theNbItems > 0 ?
+       aThreadPool->NbDefaultThreadsToLaunch() : -1;
+-    tbb::task_scheduler_init aScheduler (aNbThreads);
++    tbb::global_control(tbb::global_control::max_allowed_parallelism, aNbThreads);
+     tbb::parallel_for_each (theBegin, theEnd, theFunctor);
+-  }
+-  catch (tbb::captured_exception& anException)
+-  {
+-    throw Standard_ProgramError (anException.what());
+-  }
+ }
+ #endif /* HAVE_TBB */
index bc5512c6da39c3e9c981c68b9c3a55314d4aec89..e238679c154b96ec767468546ba7758ad594b335 100644 (file)
@@ -42,6 +42,7 @@ Source0:      https://github.com/tpaviot/oce/releases/download/official-upstream-pack
 # Source0-md5: eb62af12f173b7ce32209701cdd877ea
 Patch0:                %{name}-cmake.patch
 Patch1:                %{name}-inspector-data.patch
+Patch2:                %{name}-tbb.patch
 URL:           https://www.opencascade.com/open-cascade-technology/
 %{?with_freeimage:BuildRequires:       FreeImage-devel}
 BuildRequires: OpenGL-GLU-devel
@@ -60,7 +61,7 @@ BuildRequires:        libstdc++-devel >= 6:4.7
 BuildRequires: libtool
 BuildRequires: rapidjson-devel
 BuildRequires: rpmbuild(macros) >= 1.752
-%{?with_tbb:BuildRequires:     tbb-devel}
+%{?with_tbb:BuildRequires:     tbb-devel >= 2021.4}
 BuildRequires: tcl-devel
 BuildRequires: tk-devel
 %{?with_vtk:BuildRequires:     vtk-devel}
@@ -77,6 +78,7 @@ BuildRequires:        qt5-build >= 5
 BuildRequires: qt5-linguist >= 5
 %endif
 Requires:      %{name}-libs = %{version}-%{release}
+%{?with_tbb:Requires:  tbb >= 2021.4}
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %define                _noautocompressdoc      *.chm
@@ -216,6 +218,7 @@ PrzykĹ‚ady do OpenCASCADE.
 %setup -q -n opencascade-%{version}
 %patch0 -p1
 %patch1 -p1
+%patch2 -p1
 
 %{__sed} -i -e '/set (CMAKE_CONFIGURATION_TYPES/ { s/INTERNAL/STRING/;s/ FORCE// }' CMakeLists.txt
 
This page took 0.132633 seconds and 4 git commands to generate.