[packages/OpenSubdiv] - new
qboosh
qboosh at pld-linux.org
Tue Sep 5 18:46:12 CEST 2023
commit 8150d2eb537e2128f78c9ed1fea068b1e0af90ad
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date: Tue Sep 5 18:20:10 2023 +0200
- new
OpenSubdiv-tbb.patch | 24 +++++++++
OpenSubdiv.spec | 144 +++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 168 insertions(+)
---
diff --git a/OpenSubdiv.spec b/OpenSubdiv.spec
new file mode 100644
index 0000000..00febfa
--- /dev/null
+++ b/OpenSubdiv.spec
@@ -0,0 +1,144 @@
+# TODO: CUDA support on bcond
+#
+# Conditional build:
+%bcond_without apidocs # API documentation
+#
+Summary: Open-Source subdivision surface library
+Summary(pl.UTF-8): Mająca otwarte źródła biblioteka podpodziału powierzchni
+Name: OpenSubdiv
+Version: 3.5.1
+%define tagver %(echo %{version} | tr . _)
+Release: 1
+License: Modified Apache v2.0
+Group: Libraries
+#Source0Download: https://github.com/PixarAnimationStudios/OpenSubdiv/tags
+Source0: https://github.com/PixarAnimationStudios/OpenSubdiv/archive/v%{tagver}/%{name}-%{tagver}.tar.gz
+# Source0-md5: 15a2e1df83463116a37309156e138e43
+Patch0: %{name}-tbb.patch
+URL: https://github.com/PixarAnimationStudios/OpenSubdiv
+BuildRequires: OpenCL-devel >= 1.1
+BuildRequires: OpenGL-devel
+BuildRequires: OpenGL-GLX-devel
+BuildRequires: clew-devel
+BuildRequires: cmake >= 3.12
+BuildRequires: glew-devel
+BuildRequires: glfw-devel >= 3.0.0
+BuildRequires: libgomp-devel
+BuildRequires: libstdc++-devel >= 6:5
+BuildRequires: ptex-devel >= 2.0
+BuildRequires: rpm-build >= 4.6
+BuildRequires: rpmbuild(macros) >= 1.605
+BuildRequires: tbb-devel >= 4.0
+BuildRequires: zlib-devel
+%if %{with apidocs}
+BuildRequires: docutils
+BuildRequires: doxygen
+BuildRequires: graphviz
+%endif
+BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+OpenSubdiv is a set of open source libraries that implement high
+performance subdivision surface (subdiv) evaluation on massively
+parallel CPU and GPU architectures. This codepath is optimized for
+drawing deforming subdivs with static topology at interactive
+framerates. The resulting limit surface matches Pixar's Renderman to
+numerical precision.
+
+%description -l pl.UTF-8
+OpenSubdiv to zestaw mających otwarte źródła bibliotek z implementacją
+wyznaczania powierzchni podpodziału w architekturach dużego
+zrównoleglenia na CPU i GPU. Ścieżki kodu są zoptymalizowane pod kątem
+rysowania zniekształconych podpodziałów ze statyczną topologią z
+interaktywną częstotliwością. Wynikowe powierzchnie ograniczające są
+zgodne z oprogramowaniem Pixar Renderman z dokładnością do precyzji
+numerycznej.
+
+%package devel
+Summary: Header files for OpenSubdiv libraries
+Summary(pl.UTF-8): Pliki nagłówkowe bibliotek OpenSubdiv
+Group: Development/Libraries
+Requires: %{name} = %{version}-%{release}
+Requires: libstdc++-devel >= 6:5
+
+%description devel
+Header files for OpenSubdiv libraries.
+
+%description devel -l pl.UTF-8
+Pliki nagłówkowe bibliotek OpenSubdiv.
+
+%package static
+Summary: Static OpenSubdiv libraries
+Summary(pl.UTF-8): Statyczne biblioteki OpenSubdiv
+Group: Development/Libraries
+Requires: %{name}-devel = %{version}-%{release}
+
+%description static
+Static OpenSubdiv libraries.
+
+%description static -l pl.UTF-8
+Statyczne biblioteki OpenSubdiv.
+
+%package apidocs
+Summary: API documentation for OpenSubdiv libraries
+Summary(pl.UTF-8): Dokumentacja API bibliotek OpenSubdiv
+Group: Documentation
+BuildArch: noarch
+
+%description apidocs
+API documentation for OpenSubdiv libraries.
+
+%description apidocs -l pl.UTF-8
+Dokumentacja API bibliotek OpenSubdiv.
+
+%prep
+%setup -q -n %{name}-%{tagver}
+%patch0 -p1
+
+%build
+install -d build
+cd build
+%cmake .. \
+ %{!?with_apidocs:-DNO_DOC=ON} \
+ -DNO_EXAMPLES=ON \
+ -DNO_GLEW=OFF \
+ -DNO_REGRESSION=ON \
+ -DNO_TUTORIALS=ON
+
+%{__make}
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+%{__make} -C build install \
+ DESTDIR=$RPM_BUILD_ROOT
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post -p /sbin/ldconfig
+%postun -p /sbin/ldconfig
+
+%files
+%defattr(644,root,root,755)
+%doc LICENSE.txt NOTICE.txt README.md
+%attr(755,root,root) %{_libdir}/libosdCPU.so.%{version}
+%attr(755,root,root) %{_libdir}/libosdGPU.so.%{version}
+
+%files devel
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/libosdCPU.so
+%attr(755,root,root) %{_libdir}/libosdGPU.so
+%{_includedir}/opensubdiv
+%{_libdir}/cmake/OpenSubdiv
+
+%files static
+%defattr(644,root,root,755)
+%{_libdir}/libosdCPU.a
+%{_libdir}/libosdGPU.a
+
+%if %{with apidocs}
+%files apidocs
+%defattr(644,root,root,755)
+%{_docdir}/opensubdiv
+%endif
diff --git a/OpenSubdiv-tbb.patch b/OpenSubdiv-tbb.patch
new file mode 100644
index 0000000..07cb14e
--- /dev/null
+++ b/OpenSubdiv-tbb.patch
@@ -0,0 +1,24 @@
+--- OpenSubdiv-3_5_1/opensubdiv/osd/tbbEvaluator.cpp.orig 2023-07-20 20:58:39.000000000 +0200
++++ OpenSubdiv-3_5_1/opensubdiv/osd/tbbEvaluator.cpp 2023-09-04 22:05:28.879357953 +0200
+@@ -25,7 +25,7 @@
+ #include "../osd/tbbEvaluator.h"
+ #include "../osd/tbbKernel.h"
+
+-#include <tbb/task_scheduler_init.h>
++#include <tbb/global_control.h>
+
+ namespace OpenSubdiv {
+ namespace OPENSUBDIV_VERSION {
+@@ -215,10 +215,8 @@ TbbEvaluator::Synchronize(void *) {
+ /* static */
+ void
+ TbbEvaluator::SetNumThreads(int numThreads) {
+- if (numThreads == -1) {
+- tbb::task_scheduler_init init;
+- } else {
+- tbb::task_scheduler_init init(numThreads);
++ if (numThreads != -1) {
++ tbb::global_control(tbb::global_control::max_allowed_parallelism, numThreads);
+ }
+ }
+
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/OpenSubdiv.git/commitdiff/8150d2eb537e2128f78c9ed1fea068b1e0af90ad
More information about the pld-cvs-commit
mailing list