1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-20 00:21:35 +00:00

graphics/oidn: Update 1.1.0 -> 1.2.3

This commit is contained in:
Yuri Victorovich 2020-09-13 03:11:20 +00:00
parent ba1c6ab949
commit 7d787e1ab7
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=548446
10 changed files with 104 additions and 49 deletions

View File

@ -2,9 +2,10 @@
PORTNAME= oidn
DISTVERSIONPREFIX= v
DISTVERSION= 1.1.0
PORTREVISION= 3
DISTVERSION= 1.2.3
CATEGORIES= graphics
MASTER_SITES= http://freebsd.org/:weights # bogus URL to make the framework happy, the fetch uses Git URL below
DISTFILES= ${PORTNAME}-weights-${WEIGHTS_GIT_HASH}${EXTRACT_SUFX}:weights
MAINTAINER= yuri@FreeBSD.org
COMMENT= Intel(R) Open Image Denoise library
@ -13,15 +14,20 @@ LICENSE= APACHE20
LICENSE_FILE= ${WRKSRC}/LICENSE.txt
ONLY_FOR_ARCHS= amd64
ONLY_FOR_ARCHS_REASON= Intel(R) MKL-DNN supports x86 64 bit platforms only (oidn contains a custom version of mkl-dnn, see math/mkl-dnn)
ONLY_FOR_ARCHS_REASON= Intel(R) MKL-DNN supports x86 64 bit platforms only (oidn contains a custom version of mkl-dnn, see math/mkl-dnn), and ISPC has a limited availability
FETCH_DEPENDS= git:devel/git \
git-lfs:devel/git-lfs
BUILD_DEPENDS= ispc>=1.14.1:devel/ispc
LIB_DEPENDS= libtbb.so:devel/tbb
USES= cmake:noninja compiler:c++11-lang python:build
USE_GITHUB= yes
GH_ACCOUNT= OpenImageDenoise
GH_TUPLE= OpenImageDenoise:oidn-weights:f175104:w/weights \
OpenImageDenoise:mkl-dnn:096bda1:m/mkl-dnn
GH_TUPLE= \
OpenImageDenoise:mkl-dnn:603620ba45185e7d91fe112b69287e7d86c64353:m/mkl-dnn
# OpenImageDenoise:oidn-weights:08092e46a1961b13b70e48ad80fa19b452bd4c01:w/weights # replaced with git clone in post-fetch because it needs git-lfs
USE_LDCONFIG= yes
OPTIONS_DEFINE= DOCS
@ -30,4 +36,24 @@ CMAKE_ARGS+= -DTBB_ROOT:STRING=${LOCALBASE} -DTBB_INCLUDE_DIR:STRING=${LOCALBASE
DOCSDIR= share/doc/${GH_ACCOUNT}
WEIGHTS_GIT_URL= https://github.com/OpenImageDenoise/oidn-weights.git
WEIGHTS_GIT_HASH= 08092e46a1961b13b70e48ad80fa19b452bd4c01
pre-fetch:
@if [ "${FORCE_FETCH_ALL}" = "true" ] || ! [ -f "${DISTDIR}/${DIST_SUBDIR}/${PORTNAME}-weights-${WEIGHTS_GIT_HASH}${EXTRACT_SUFX}" ]; then \
${MKDIR} ${DISTDIR}/${DIST_SUBDIR} && \
cd ${DISTDIR}/${DIST_SUBDIR} && \
${ECHO} "==> Fetching the oidn/weights subproject with large LFS files" && \
git config --global filter.lfs.smudge "git-lfs smudge -- %f" && \
git clone -q ${WEIGHTS_GIT_URL} ${PORTNAME}-weights-${WEIGHTS_GIT_HASH} && \
(cd ${PORTNAME}-weights-${WEIGHTS_GIT_HASH} && git reset -q --hard ${WEIGHTS_GIT_HASH} && ${RM} -r .git) && \
${FIND} ${PORTNAME}-weights-${WEIGHTS_GIT_HASH} -and -exec ${TOUCH} -h -d 1970-01-01T00:00:00Z {} \; && \
${FIND} ${PORTNAME}-weights-${WEIGHTS_GIT_HASH} -print0 | LC_ALL=C ${SORT} -z | \
${TAR} czf ${PORTNAME}-weights-${WEIGHTS_GIT_HASH}${EXTRACT_SUFX} --format=bsdtar --gid 0 --uid 0 --options gzip:!timestamp --no-recursion --null -T - && \
${RM} -r ${PORTNAME}-weights-${WEIGHTS_GIT_HASH}; \
fi
post-extract:
@cd ${WRKSRC} && ${RMDIR} weights && ${LN} -s ${WRKDIR}/${PORTNAME}-weights-${WEIGHTS_GIT_HASH} weights
.include <bsd.port.mk>

View File

@ -1,7 +1,7 @@
TIMESTAMP = 1571521700
SHA256 (OpenImageDenoise-oidn-v1.1.0_GH0.tar.gz) = 78674407896d39a26206bd4f080a8a0c3f82f7e4ba4c293d421a8231be4cc977
SIZE (OpenImageDenoise-oidn-v1.1.0_GH0.tar.gz) = 3431532
SHA256 (OpenImageDenoise-oidn-weights-f175104_GH0.tar.gz) = 8a93afdc3d826d420196af8348e9b050c5882435e7745606544899b040bb1376
SIZE (OpenImageDenoise-oidn-weights-f175104_GH0.tar.gz) = 36949154
SHA256 (OpenImageDenoise-mkl-dnn-096bda1_GH0.tar.gz) = 08c6acdd412b3abc87f3b88734a813b1c93c942dbcee44935807cb432daa864b
SIZE (OpenImageDenoise-mkl-dnn-096bda1_GH0.tar.gz) = 1498472
TIMESTAMP = 1599950146
SHA256 (oidn-weights-08092e46a1961b13b70e48ad80fa19b452bd4c01.tar.gz) = 51b6638f22b67581da7c2a877faa2f5d3062bb4e9b9214e5008cb25052748300
SIZE (oidn-weights-08092e46a1961b13b70e48ad80fa19b452bd4c01.tar.gz) = 37029289
SHA256 (OpenImageDenoise-oidn-v1.2.3_GH0.tar.gz) = 9ff7f7b5c442bd56be1ae89f8c45ae1972498b854f7175705ff520bb2c5cb25b
SIZE (OpenImageDenoise-oidn-v1.2.3_GH0.tar.gz) = 3410694
SHA256 (OpenImageDenoise-mkl-dnn-603620ba45185e7d91fe112b69287e7d86c64353_GH0.tar.gz) = 582a5e07027e0bd2b078c11c667bcb9ab06cc955263b95e292c50088ba0ea6ad
SIZE (OpenImageDenoise-mkl-dnn-603620ba45185e7d91fe112b69287e7d86c64353_GH0.tar.gz) = 5800370

View File

@ -1,11 +0,0 @@
--- 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)

View File

@ -0,0 +1,18 @@
--- cmake/oidn_install.cmake.orig 2020-09-11 17:36:51 UTC
+++ cmake/oidn_install.cmake
@@ -31,6 +31,7 @@ install(DIRECTORY include/OpenImageDenoise
## Install documentation
## -----------------------------------------------------------------------------
+if (FALSE)
install(
FILES
${PROJECT_SOURCE_DIR}/README.md
@@ -43,6 +44,7 @@ install(
DESTINATION ${CMAKE_INSTALL_DOCDIR}
COMPONENT lib
)
+endif()
## -----------------------------------------------------------------------------
## Install dependencies: TBB

View File

@ -1,24 +1,24 @@
--- common/thread.cpp.orig 2019-02-18 06:42:30 UTC
--- common/thread.cpp.orig 2020-09-11 17:36:51 UTC
+++ common/thread.cpp
@@ -14,6 +14,8 @@
// limitations under the License. //
// ======================================================================== //
@@ -1,6 +1,8 @@
// Copyright 2009-2020 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
+#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 {
@@ -120,7 +122,7 @@ namespace oidn {
OIDN_WARNING("SetThreadGroupAffinity failed");
}
-#elif defined(__linux__)
+#elif defined(__linux__) || defined(__FreeBSD__)
// --------------------------------------------------------------------------
// ThreadAffinity - Linux
@@ -176,7 +179,7 @@ namespace oidn {
// ---------------------------------------------------------------------------
// ThreadAffinity: Linux
@@ -165,7 +167,7 @@ namespace oidn {
for (size_t i = 0; i < threadIds.size(); ++i)
{
@ -27,7 +27,7 @@
CPU_ZERO(&affinity);
CPU_SET(threadIds[i], &affinity);
@@ -193,7 +196,7 @@ namespace oidn {
@@ -182,7 +184,7 @@ namespace oidn {
const pthread_t thread = pthread_self();
// Save the current affinity
@ -36,7 +36,7 @@
{
OIDN_WARNING("pthread_getaffinity_np failed");
oldAffinities[threadIndex] = affinities[threadIndex];
@@ -201,7 +204,7 @@ namespace oidn {
@@ -190,7 +192,7 @@ namespace oidn {
}
// Set the new affinity
@ -45,7 +45,7 @@
OIDN_WARNING("pthread_setaffinity_np failed");
}
@@ -213,7 +216,7 @@ namespace oidn {
@@ -202,7 +204,7 @@ namespace oidn {
const pthread_t thread = pthread_self();
// Restore the original affinity

View File

@ -1,18 +1,19 @@
--- common/thread.h.orig 2019-02-18 06:37:35 UTC
--- common/thread.h.orig 2020-09-11 17:36:51 UTC
+++ common/thread.h
@@ -142,7 +142,9 @@ namespace oidn {
@@ -130,8 +130,10 @@ 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
+#include <sys/cpuset.h>
+
// ---------------------------------------------------------------------------
// ThreadAffinity: Linux
// ---------------------------------------------------------------------------
@@ -139,8 +141,8 @@ namespace oidn {
class ThreadAffinity : public Verbose
{
private:
- std::vector<cpu_set_t> affinities; // thread affinities
@ -21,4 +22,4 @@
+ std::vector<cpuset_t> oldAffinities; // original thread affinities
public:
ThreadAffinity(int numThreadsPerCore = INT_MAX);
ThreadAffinity(int numThreadsPerCore = INT_MAX, int verbose = 0);

View File

@ -0,0 +1,11 @@
--- mkl-dnn/src/common/memory_debug.cpp.orig 2020-09-12 19:21:13 UTC
+++ mkl-dnn/src/common/memory_debug.cpp
@@ -21,7 +21,7 @@
#include <windows.h>
#endif
-#if defined __linux__ || defined __APPLE__
+#if defined __linux__ || defined __APPLE__ || defined __FreeBSD__
#include <unistd.h>
#include <sys/mman.h>
#endif

View File

@ -0,0 +1,11 @@
--- mkl-dnn/src/common/utils.cpp.orig 2020-09-12 19:26:27 UTC
+++ mkl-dnn/src/common/utils.cpp
@@ -19,7 +19,7 @@
#include <windows.h>
#endif
-#if defined __linux__ || defined __APPLE__
+#if defined __linux__ || defined __APPLE__ || defined __FreeBSD__
#include <unistd.h>
#endif

View File

@ -12,4 +12,4 @@ 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/
WWW: https://www.openimagedenoise.org/

View File

@ -1,4 +1,6 @@
bin/denoise
bin/oidnBenchmark
bin/oidnDenoise
bin/oidnTest
include/OpenImageDenoise/oidn.h
include/OpenImageDenoise/oidn.hpp
include/OpenImageDenoise/version.h
@ -7,7 +9,4 @@ lib/cmake/OpenImageDenoise/OpenImageDenoiseConfig.cmake
lib/cmake/OpenImageDenoise/OpenImageDenoiseConfigVersion.cmake
lib/libOpenImageDenoise.so
lib/libOpenImageDenoise.so.0
lib/libOpenImageDenoise.so.1.1.0
%%PORTDOCS%%%%DOCSDIR%%/CHANGELOG.md
%%PORTDOCS%%%%DOCSDIR%%/README.md
%%PORTDOCS%%%%DOCSDIR%%/readme.pdf
lib/libOpenImageDenoise.so.1.2.3