summaryrefslogtreecommitdiff
path: root/graphics
diff options
context:
space:
mode:
authorAlexey Dokuchaev <danfe@FreeBSD.org>2015-10-11 21:17:06 +0000
committerAlexey Dokuchaev <danfe@FreeBSD.org>2015-10-11 21:17:06 +0000
commit4b03a46bda8b6948a33492496450badfcddea65f (patch)
treec109749b7bbe3d4fe4e5e79242909a57798c42ef /graphics
parentefd46863c54c85396a42bb331c6c50f30d21757c (diff)
downloadfreebsd-ports-4b03a46bda8b6948a33492496450badfcddea65f.zip
Add a port of Embree, is a collection of high-performance ray tracing
kernels developed at Intel. WWW: https://embree.github.io/
Diffstat (limited to 'graphics')
-rw-r--r--graphics/Makefile1
-rw-r--r--graphics/embree/Makefile48
-rw-r--r--graphics/embree/distinfo2
-rw-r--r--graphics/embree/files/patch-common_sys_sysinfo.cpp34
-rw-r--r--graphics/embree/files/patch-common_sys_thread.cpp21
-rw-r--r--graphics/embree/pkg-descr10
-rw-r--r--graphics/embree/pkg-plist48
7 files changed, 164 insertions, 0 deletions
diff --git a/graphics/Makefile b/graphics/Makefile
index 87b6213298a7..b3c2676547be 100644
--- a/graphics/Makefile
+++ b/graphics/Makefile
@@ -141,6 +141,7 @@
SUBDIR += easypaint
SUBDIR += edje_viewer
SUBDIR += electrix
+ SUBDIR += embree
SUBDIR += enblend
SUBDIR += entangle
SUBDIR += eog
diff --git a/graphics/embree/Makefile b/graphics/embree/Makefile
new file mode 100644
index 000000000000..85c1e9a14b48
--- /dev/null
+++ b/graphics/embree/Makefile
@@ -0,0 +1,48 @@
+# Created by: Alexey Dokuchaev <danfe@FreeBSD.org>
+# $FreeBSD$
+
+PORTNAME= embree
+DISTVERSIONPREFIX= v
+DISTVERSION= 2.7.0
+CATEGORIES= graphics
+
+MAINTAINER= danfe@FreeBSD.org
+COMMENT= Collection of high-performance ray tracing kernels
+
+LICENSE= APACHE20
+
+LIB_DEPENDS= libMagick++-6.so:${PORTSDIR}/graphics/ImageMagick \
+ libIlmImf.so:${PORTSDIR}/graphics/OpenEXR
+
+BROKEN_FreeBSD_9= does not build (insufficient C++11 support)
+
+USE_GITHUB= yes
+
+USES= cmake compiler:c++11-lang
+USE_GL= glut
+USE_XORG= xmu
+USE_LDCONFIG= yes
+
+CMAKE_ARGS= -DRTCORE_TASKING_SYSTEM:STRING=INTERNAL \
+ -DENABLE_ISPC_SUPPORT:BOOL=OFF \
+ -DCOMPILER:STRING=${CHOSEN_COMPILER_TYPE:tu}
+
+PLIST_SUB+= VERSION=${DISTVERSION}
+
+post-patch:
+# MAP_NORESERVE was never implemented in FreeBSD and retired in r273250
+ @${REINPLACE_CMD} -e 's,MAP_NORESERVE,0,' \
+ ${WRKSRC}/common/sys/alloc.cpp
+ @${REINPLACE_CMD} -e 's,_blsr_u64,_&,' \
+ ${WRKSRC}/common/sys/intrinsics.h
+ @${REINPLACE_CMD} -e 's,__UNIX__) &&.*,__LINUX__),' \
+ ${WRKSRC}/tests/benchmark.cpp
+ @${REINPLACE_CMD} -e '/share\/doc/,+2 { \
+ s,share/doc/embree-[^)]*,${DOCSDIR_REL}, ; \
+ s,bin/,, ; } ' ${WRKSRC}/common/cmake/package.cmake
+# Do not force particular compiler binaries (obey the framework)
+ @${REINPLACE_CMD} -e '/_COMPILER/s,^,#,' \
+ ${WRKSRC}/common/cmake/clang.cmake \
+ ${WRKSRC}/common/cmake/gcc.cmake
+
+.include <bsd.port.mk>
diff --git a/graphics/embree/distinfo b/graphics/embree/distinfo
new file mode 100644
index 000000000000..9c79d18622bc
--- /dev/null
+++ b/graphics/embree/distinfo
@@ -0,0 +1,2 @@
+SHA256 (embree-embree-v2.7.0_GH0.tar.gz) = 2b5dacbf1c94a2e6568661eae7cdb91abbdc65feaccd8aec03c8fd4b32fca6aa
+SIZE (embree-embree-v2.7.0_GH0.tar.gz) = 1697062
diff --git a/graphics/embree/files/patch-common_sys_sysinfo.cpp b/graphics/embree/files/patch-common_sys_sysinfo.cpp
new file mode 100644
index 000000000000..785c6a13e41d
--- /dev/null
+++ b/graphics/embree/files/patch-common_sys_sysinfo.cpp
@@ -0,0 +1,34 @@
+--- common/sys/sysinfo.cpp.orig 2015-09-17 06:11:18 UTC
++++ common/sys/sysinfo.cpp
+@@ -414,6 +414,31 @@ namespace embree
+ #endif
+
+ ////////////////////////////////////////////////////////////////////////////////
++/// FreeBSD Platform
++////////////////////////////////////////////////////////////////////////////////
++
++#ifdef __FreeBSD__
++
++#include <sys/sysctl.h>
++
++namespace embree
++{
++ std::string getExecutableFileName()
++ {
++#if __FreeBSD_version > 900009
++ const
++#endif
++ int mib[4] = { CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1 };
++ char buf[1024];
++ size_t len = sizeof(buf);
++ if (sysctl(mib, 4, buf, &len, 0x0, 0) == -1) *buf = '\0';
++ return std::string(buf);
++ }
++}
++
++#endif
++
++////////////////////////////////////////////////////////////////////////////////
+ /// Mac OS X Platform
+ ////////////////////////////////////////////////////////////////////////////////
+
diff --git a/graphics/embree/files/patch-common_sys_thread.cpp b/graphics/embree/files/patch-common_sys_thread.cpp
new file mode 100644
index 000000000000..71b9c5980eda
--- /dev/null
+++ b/graphics/embree/files/patch-common_sys_thread.cpp
@@ -0,0 +1,21 @@
+--- common/sys/thread.cpp.orig 2015-09-17 06:11:18 UTC
++++ common/sys/thread.cpp
+@@ -171,13 +171,16 @@ namespace embree
+ /// Linux Platform
+ ////////////////////////////////////////////////////////////////////////////////
+
+-#if defined(__LINUX__)
++#if defined(__LINUX__) || defined(__FreeBSD__)
++
++#include <pthread_np.h>
++
+ namespace embree
+ {
+ /*! set affinity of the calling thread */
+ void setAffinity(ssize_t affinity)
+ {
+- cpu_set_t cset;
++ cpuset_t cset;
+ CPU_ZERO(&cset);
+ CPU_SET(affinity, &cset);
+
diff --git a/graphics/embree/pkg-descr b/graphics/embree/pkg-descr
new file mode 100644
index 000000000000..2e7b2c6c3e71
--- /dev/null
+++ b/graphics/embree/pkg-descr
@@ -0,0 +1,10 @@
+Embree is a collection of high-performance ray tracing kernels developed
+at Intel. The target users of Embree are graphics application engineers
+that want to improve the performance of their application by leveraging
+the optimized ray tracing kernels of Embree.
+
+These kernels are optimized for photo-realistic rendering on the latest
+Intel processors with support for SSE, AVX, AVX2, AVX512, and the 16-wide
+Intel Xeon Phi coprocessor vector instructions.
+
+WWW: https://embree.github.io/
diff --git a/graphics/embree/pkg-plist b/graphics/embree/pkg-plist
new file mode 100644
index 000000000000..3515464ad884
--- /dev/null
+++ b/graphics/embree/pkg-plist
@@ -0,0 +1,48 @@
+embree-%%VERSION%%/benchmark
+embree-%%VERSION%%/bvh_builder
+embree-%%VERSION%%/displacement_geometry
+embree-%%VERSION%%/dynamic_scene
+embree-%%VERSION%%/hair_geometry
+embree-%%VERSION%%/instanced_geometry
+embree-%%VERSION%%/interpolation
+embree-%%VERSION%%/intersection_filter
+embree-%%VERSION%%/lazy_geometry
+embree-%%VERSION%%/models/cornell_box.ecs
+embree-%%VERSION%%/models/cornell_box.mtl
+embree-%%VERSION%%/models/cornell_box.obj
+embree-%%VERSION%%/models/subdiv0.xml
+embree-%%VERSION%%/models/subdiv1.xml
+embree-%%VERSION%%/models/subdiv2.xml
+embree-%%VERSION%%/models/subdiv3.xml
+embree-%%VERSION%%/models/subdiv4.xml
+embree-%%VERSION%%/models/subdiv5.xml
+embree-%%VERSION%%/models/subdiv6.xml
+embree-%%VERSION%%/models/subdiv7.xml
+embree-%%VERSION%%/models/subdiv8.xml
+embree-%%VERSION%%/models/subdiv9.xml
+embree-%%VERSION%%/motion_blur_geometry
+embree-%%VERSION%%/pathtracer
+embree-%%VERSION%%/retrace
+embree-%%VERSION%%/subdivision_geometry
+embree-%%VERSION%%/triangle_geometry
+embree-%%VERSION%%/user_geometry
+embree-%%VERSION%%/verify
+embree-%%VERSION%%/viewer
+include/embree2/rtcore.h
+include/embree2/rtcore.isph
+include/embree2/rtcore_geometry.h
+include/embree2/rtcore_geometry.isph
+include/embree2/rtcore_geometry_user.h
+include/embree2/rtcore_geometry_user.isph
+include/embree2/rtcore_ray.h
+include/embree2/rtcore_ray.isph
+include/embree2/rtcore_scene.h
+include/embree2/rtcore_scene.isph
+lib/cmake/embree-%%VERSION%%/embree-config-version.cmake
+lib/cmake/embree-%%VERSION%%/embree-config.cmake
+lib/libembree.so.2
+lib/libembree.so.%%VERSION%%
+%%PORTDOCS%%%%DOCSDIR%%/CHANGELOG.md
+%%PORTDOCS%%%%DOCSDIR%%/LICENSE.txt
+%%PORTDOCS%%%%DOCSDIR%%/README.md
+%%PORTDOCS%%%%DOCSDIR%%/readme.pdf