diff options
author | Yuri Victorovich <yuri@FreeBSD.org> | 2019-02-18 15:12:38 +0800 |
---|---|---|
committer | Yuri Victorovich <yuri@FreeBSD.org> | 2019-02-18 15:12:38 +0800 |
commit | 25b9210a560e1e1b34ace45c7eaa1d8e60c01deb (patch) | |
tree | 2759a81c6753d17dee6aa2b7f2f2d9a4d8f4eb72 /graphics/oidn | |
parent | 9427b654e7ec027204e98b1b279f8851161f1e51 (diff) | |
download | freebsd-ports-gnome-25b9210a560e1e1b34ace45c7eaa1d8e60c01deb.tar.gz freebsd-ports-gnome-25b9210a560e1e1b34ace45c7eaa1d8e60c01deb.tar.zst freebsd-ports-gnome-25b9210a560e1e1b34ace45c7eaa1d8e60c01deb.zip |
New port: graphics/oidn: Intel(R) Open Image Denoise library
Diffstat (limited to 'graphics/oidn')
-rw-r--r-- | graphics/oidn/Makefile | 27 | ||||
-rw-r--r-- | graphics/oidn/distinfo | 7 | ||||
-rw-r--r-- | graphics/oidn/files/patch-cmake_install.cmake | 11 | ||||
-rw-r--r-- | graphics/oidn/files/patch-common_thread.cpp | 56 | ||||
-rw-r--r-- | graphics/oidn/files/patch-common_thread.h | 24 | ||||
-rw-r--r-- | graphics/oidn/pkg-descr | 15 | ||||
-rw-r--r-- | graphics/oidn/pkg-plist | 13 |
7 files changed, 153 insertions, 0 deletions
diff --git a/graphics/oidn/Makefile b/graphics/oidn/Makefile new file mode 100644 index 000000000000..3baac9c28099 --- /dev/null +++ b/graphics/oidn/Makefile @@ -0,0 +1,27 @@ +# $FreeBSD$ + +PORTNAME= oidn +DISTVERSIONPREFIX= v +DISTVERSION= 0.8.1 +CATEGORIES= graphics + +MAINTAINER= yuri@FreeBSD.org +COMMENT= Intel(R) Open Image Denoise library + +LICENSE= APACHE20 +LICENSE_FILE= ${WRKSRC}/LICENSE.txt + +LIB_DEPENDS= libtbb.so:devel/tbb + +USES= cmake compiler:c++11-lang +USE_GITHUB= yes +GH_ACCOUNT= OpenImageDenoise +GH_TUPLE= OpenImageDenoise:oidn-weights:cd8e2ce:w/weights \ + OpenImageDenoise:mkl-dnn:9507eb9:m/mkl-dnn +USE_LDCONFIG= yes + +OPTIONS_DEFINE= DOCS + +DOCSDIR= share/doc/${GH_ACCOUNT} + +.include <bsd.port.mk> diff --git a/graphics/oidn/distinfo b/graphics/oidn/distinfo new file mode 100644 index 000000000000..f3a01c003fc2 --- /dev/null +++ b/graphics/oidn/distinfo @@ -0,0 +1,7 @@ +TIMESTAMP = 1550471654 +SHA256 (OpenImageDenoise-oidn-v0.8.1_GH0.tar.gz) = f9ab0feb83cf5494448db0c147f35bfc4a834fdfb2e4d4910c6b6685fec14b27 +SIZE (OpenImageDenoise-oidn-v0.8.1_GH0.tar.gz) = 159658 +SHA256 (OpenImageDenoise-oidn-weights-cd8e2ce_GH0.tar.gz) = 7f242a227f641d3e2cc968b25db4825efc15feb11e4bb58ee2ee888c65f758fc +SIZE (OpenImageDenoise-oidn-weights-cd8e2ce_GH0.tar.gz) = 31599866 +SHA256 (OpenImageDenoise-mkl-dnn-9507eb9_GH0.tar.gz) = 0e00ce128f4cb42ada6feebd71d768e04abab6ad9d80422645be657ac7140f0a +SIZE (OpenImageDenoise-mkl-dnn-9507eb9_GH0.tar.gz) = 1413499 diff --git a/graphics/oidn/files/patch-cmake_install.cmake b/graphics/oidn/files/patch-cmake_install.cmake new file mode 100644 index 000000000000..2154da260972 --- /dev/null +++ b/graphics/oidn/files/patch-cmake_install.cmake @@ -0,0 +1,11 @@ +--- cmake/install.cmake.orig 2019-02-18 06:48:48 UTC ++++ cmake/install.cmake +@@ -45,7 +45,7 @@ install(DIRECTORY include/OpenImageDenoi + ## Install documentation + ## ---------------------------------------------------------------------------- + +-install(FILES ${PROJECT_SOURCE_DIR}/LICENSE.txt DESTINATION ${CMAKE_INSTALL_DOCDIR} COMPONENT lib) ++#install(FILES ${PROJECT_SOURCE_DIR}/LICENSE.txt DESTINATION ${CMAKE_INSTALL_DOCDIR} COMPONENT lib) + install(FILES ${PROJECT_SOURCE_DIR}/CHANGELOG.md DESTINATION ${CMAKE_INSTALL_DOCDIR} COMPONENT lib) + install(FILES ${PROJECT_SOURCE_DIR}/README.md DESTINATION ${CMAKE_INSTALL_DOCDIR} COMPONENT lib) + install(FILES ${PROJECT_SOURCE_DIR}/readme.pdf DESTINATION ${CMAKE_INSTALL_DOCDIR} COMPONENT lib) diff --git a/graphics/oidn/files/patch-common_thread.cpp b/graphics/oidn/files/patch-common_thread.cpp new file mode 100644 index 000000000000..63d418d949fb --- /dev/null +++ b/graphics/oidn/files/patch-common_thread.cpp @@ -0,0 +1,56 @@ +--- common/thread.cpp.orig 2019-02-18 06:42:30 UTC ++++ common/thread.cpp +@@ -14,6 +14,8 @@ + // limitations under the License. // + // ======================================================================== // + ++#include <pthread_np.h> ++ + #if defined(_MSC_VER) + #pragma warning (disable : 4146) // unary minus operator applied to unsigned type, result still unsigned + #endif +@@ -132,7 +135,7 @@ namespace oidn { + OIDN_WARNING("SetThreadGroupAffinity failed"); + } + +-#elif defined(__linux__) ++#elif defined(__linux__) || defined(__FreeBSD__) + + // -------------------------------------------------------------------------- + // ThreadAffinity - Linux +@@ -176,7 +179,7 @@ namespace oidn { + + for (size_t i = 0; i < threadIds.size(); ++i) + { +- cpu_set_t affinity; ++ cpuset_t affinity; + CPU_ZERO(&affinity); + CPU_SET(threadIds[i], &affinity); + +@@ -193,7 +196,7 @@ namespace oidn { + const pthread_t thread = pthread_self(); + + // Save the current affinity +- if (pthread_getaffinity_np(thread, sizeof(cpu_set_t), &oldAffinities[threadIndex]) != 0) ++ if (pthread_getaffinity_np(thread, sizeof(cpuset_t), &oldAffinities[threadIndex]) != 0) + { + OIDN_WARNING("pthread_getaffinity_np failed"); + oldAffinities[threadIndex] = affinities[threadIndex]; +@@ -201,7 +204,7 @@ namespace oidn { + } + + // Set the new affinity +- if (pthread_setaffinity_np(thread, sizeof(cpu_set_t), &affinities[threadIndex]) != 0) ++ if (pthread_setaffinity_np(thread, sizeof(cpuset_t), &affinities[threadIndex]) != 0) + OIDN_WARNING("pthread_setaffinity_np failed"); + } + +@@ -213,7 +216,7 @@ namespace oidn { + const pthread_t thread = pthread_self(); + + // Restore the original affinity +- if (pthread_setaffinity_np(thread, sizeof(cpu_set_t), &oldAffinities[threadIndex]) != 0) ++ if (pthread_setaffinity_np(thread, sizeof(cpuset_t), &oldAffinities[threadIndex]) != 0) + OIDN_WARNING("pthread_setaffinity_np failed"); + } + diff --git a/graphics/oidn/files/patch-common_thread.h b/graphics/oidn/files/patch-common_thread.h new file mode 100644 index 000000000000..75078f986021 --- /dev/null +++ b/graphics/oidn/files/patch-common_thread.h @@ -0,0 +1,24 @@ +--- common/thread.h.orig 2019-02-18 06:37:35 UTC ++++ common/thread.h +@@ -142,7 +142,9 @@ namespace oidn { + void restore(int threadIndex); + }; + +-#elif defined(__linux__) ++#elif defined(__linux__) || defined(__FreeBSD__) ++ ++#include <sys/cpuset.h> + + // -------------------------------------------------------------------------- + // ThreadAffinity - Linux +@@ -151,8 +153,8 @@ namespace oidn { + class ThreadAffinity + { + private: +- std::vector<cpu_set_t> affinities; // thread affinities +- std::vector<cpu_set_t> oldAffinities; // original thread affinities ++ std::vector<cpuset_t> affinities; // thread affinities ++ std::vector<cpuset_t> oldAffinities; // original thread affinities + + public: + ThreadAffinity(int numThreadsPerCore = INT_MAX); diff --git a/graphics/oidn/pkg-descr b/graphics/oidn/pkg-descr new file mode 100644 index 000000000000..7e2c7844fee8 --- /dev/null +++ b/graphics/oidn/pkg-descr @@ -0,0 +1,15 @@ +Intel Open Image Denoise is an open source library of high-performance, +high-quality denoising filters for images rendered with ray tracing. Open Image +Denoise is part of the Intel Rendering Framework and is released under the +permissive Apache 2.0 license. + +The purpose of Open Image Denoise is to provide an open, high-quality, +efficient, and easy-to-use denoising library that allows one to significantly +reduce rendering times in ray tracing based rendering applications. It filters +out the Monte Carlo noise inherent to stochastic ray tracing methods like path +tracing, reducing the amount of necessary samples per pixel by even multiple +orders of magnitude (depending on the desired closeness to the ground truth). +A simple but flexible C/C++ API ensures that the library can be easily +integrated into most existing or new rendering solutions. + +WWW: https://openimagedenoise.github.io/ diff --git a/graphics/oidn/pkg-plist b/graphics/oidn/pkg-plist new file mode 100644 index 000000000000..deee93884e1c --- /dev/null +++ b/graphics/oidn/pkg-plist @@ -0,0 +1,13 @@ +bin/denoise +include/OpenImageDenoise/oidn.h +include/OpenImageDenoise/oidn.hpp +include/OpenImageDenoise/version.h +lib/cmake/OpenImageDenoise/OpenImageDenoiseConfig-%%CMAKE_BUILD_TYPE%%.cmake +lib/cmake/OpenImageDenoise/OpenImageDenoiseConfig.cmake +lib/cmake/OpenImageDenoise/OpenImageDenoiseConfigVersion.cmake +lib/libOpenImageDenoise.so +lib/libOpenImageDenoise.so.0 +lib/libOpenImageDenoise.so.0.8.1 +%%PORTDOCS%%%%DOCSDIR%%/CHANGELOG.md +%%PORTDOCS%%%%DOCSDIR%%/README.md +%%PORTDOCS%%%%DOCSDIR%%/readme.pdf |