[new-package] embree3 3.13.5
This commit is contained in:
147
mingw-w64-embree3/001-build-fixes.patch
Normal file
147
mingw-w64-embree3/001-build-fixes.patch
Normal file
@@ -0,0 +1,147 @@
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -202,7 +202,7 @@
|
||||
|
||||
SET(CONFIGURATION_TYPES "Debug;Release;RelWithDebInfo")
|
||||
|
||||
-IF (WIN32)
|
||||
+IF (WIN32 AND NOT MINGW)
|
||||
IF (NOT DEFAULT_CMAKE_CONFIGURATION_TYPES_SET)
|
||||
SET(CMAKE_CONFIGURATION_TYPES "${CONFIGURATION_TYPES}" CACHE STRING "List of generated configurations." FORCE)
|
||||
SET(DEFAULT_CMAKE_CONFIGURATION_TYPES_SET ON CACHE INTERNAL "Default CMake configuration types set.")
|
||||
@@ -316,7 +316,7 @@
|
||||
OPTION(EMBREE_ISA_SSE42 "Enables SSE4.2 ISA." ON)
|
||||
OPTION(EMBREE_ISA_AVX "Enables AVX ISA." ${COMPILER_SUPPORTS_AVX})
|
||||
OPTION(EMBREE_ISA_AVX2 "Enables AVX2 ISA." ${COMPILER_SUPPORTS_AVX2})
|
||||
- IF (WIN32 OR APPLE)
|
||||
+ IF (MSVC OR APPLE)
|
||||
OPTION(EMBREE_ISA_AVX512 "Enables AVX512 ISA." OFF)
|
||||
ELSE()
|
||||
OPTION(EMBREE_ISA_AVX512 "Enables AVX512 ISA." ${COMPILER_SUPPORTS_AVX512})
|
||||
--- a/common/math/math.h
|
||||
+++ b/common/math/math.h
|
||||
@@ -44,7 +44,7 @@
|
||||
__forceinline int toInt (const float& a) { return int(a); }
|
||||
__forceinline float toFloat(const int& a) { return float(a); }
|
||||
|
||||
-#if defined(__WIN32__)
|
||||
+#if defined(_MSC_VER)
|
||||
__forceinline bool finite ( const float x ) { return _finite(x) != 0; }
|
||||
#endif
|
||||
|
||||
@@ -289,7 +289,7 @@
|
||||
}
|
||||
#endif
|
||||
|
||||
-#if defined(__WIN32__) || defined(__FreeBSD__)
|
||||
+#if defined(_MSC_VER) || defined(__FreeBSD__)
|
||||
__forceinline void sincosf(float x, float *s, float *c) {
|
||||
*s = sinf(x); *c = cosf(x);
|
||||
}
|
||||
--- a/common/sys/sysinfo.cpp
|
||||
+++ b/common/sys/sysinfo.cpp
|
||||
@@ -288,7 +288,7 @@
|
||||
int cpuid_leaf_e1[4] = { 0,0,0,0 };
|
||||
if (nIds >= 1) __cpuid (cpuid_leaf_1,0x00000001);
|
||||
#if _WIN32
|
||||
-#if _MSC_VER && (_MSC_FULL_VER < 160040219)
|
||||
+#if defined(_MSC_VER) && (_MSC_FULL_VER < 160040219)
|
||||
#else
|
||||
if (nIds >= 7) __cpuidex(cpuid_leaf_7,0x00000007,0);
|
||||
#endif
|
||||
--- a/tutorials/common/tutorial/CMakeLists.txt
|
||||
+++ b/tutorials/common/tutorial/CMakeLists.txt
|
||||
@@ -49,7 +49,7 @@
|
||||
TARGET_LINK_LIBRARIES(tutorial_ispc benchmark)
|
||||
ENDIF()
|
||||
|
||||
-IF (WIN32 AND NOT EMBREE_EXTERNAL_GLFW)
|
||||
+IF (MSVC AND NOT EMBREE_EXTERNAL_GLFW)
|
||||
|
||||
GET_FILENAME_COMPONENT(GLFW_DIR ${GLFW_LIBRARY} PATH)
|
||||
ADD_CUSTOM_COMMAND(TARGET tutorial POST_BUILD
|
||||
--- a/common/cmake/clang.cmake
|
||||
+++ b/common/cmake/clang.cmake
|
||||
@@ -21,7 +21,7 @@
|
||||
_SET_IF_EMPTY(FLAGS_AVX512 "-march=skx")
|
||||
ENDIF ()
|
||||
|
||||
-IF (WIN32)
|
||||
+IF (MSVC)
|
||||
|
||||
SET(COMMON_CXX_FLAGS "")
|
||||
SET(COMMON_CXX_FLAGS "${COMMON_CXX_FLAGS} /EHsc") # catch C++ exceptions only and extern "C" functions never throw a C++ exception
|
||||
@@ -92,6 +92,7 @@
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-strict-aliasing") # disables strict aliasing rules
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-tree-vectorize") # disable auto vectorizer
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_FORTIFY_SOURCE=2") # perform extra security checks for some standard library calls
|
||||
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_USE_MATH_DEFINES")
|
||||
IF (EMBREE_STACK_PROTECTOR)
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fstack-protector") # protects against return address overrides
|
||||
ENDIF()
|
||||
@@ -132,8 +133,8 @@
|
||||
ELSE(APPLE)
|
||||
IF (NOT EMBREE_ADDRESS_SANITIZER) # for address sanitizer this causes link errors
|
||||
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined") # issues link error for undefined symbols in shared library
|
||||
- SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pie") # enables position independent execution for executable
|
||||
- IF (NOT EMSCRIPTEN)
|
||||
+ IF (NOT EMSCRIPTEN AND NOT MINGW)
|
||||
+ SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pie") # enables position independent execution for executable
|
||||
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -z relro -z now") # re-arranges data sections to increase security
|
||||
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -z noexecstack") # we do not need an executable stack
|
||||
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -z relro -z now") # re-arranges data sections to increase security
|
||||
--- a/common/cmake/gnu.cmake
|
||||
+++ b/common/cmake/gnu.cmake
|
||||
@@ -53,6 +53,7 @@
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-strict-aliasing") # disables strict aliasing rules
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-tree-vectorize") # disable auto vectorizer
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_FORTIFY_SOURCE=2") # perform extra security checks for some standard library calls
|
||||
+SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_USE_MATH_DEFINES")
|
||||
IF (EMBREE_STACK_PROTECTOR)
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fstack-protector") # protects against return address overrides
|
||||
ENDIF()
|
||||
@@ -93,10 +94,12 @@
|
||||
ELSE(APPLE)
|
||||
IF (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
|
||||
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined") # issues link error for undefined symbols in shared library
|
||||
+ IF (NOT MINGW)
|
||||
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -z noexecstack") # we do not need an executable stack
|
||||
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -z relro -z now") # re-arranges data sections to increase security
|
||||
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -z noexecstack") # we do not need an executable stack
|
||||
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -z relro -z now") # re-arranges data sections to increase security
|
||||
+ ENDIF ()
|
||||
ENDIF ()
|
||||
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pie") # enables position independent execution for executable
|
||||
ENDIF(APPLE)
|
||||
--- a/common/cmake/package.cmake
|
||||
+++ b/common/cmake/package.cmake
|
||||
@@ -23,7 +23,7 @@
|
||||
# Install MSVC runtime
|
||||
##############################################################
|
||||
|
||||
-IF (WIN32)
|
||||
+IF (MSVC)
|
||||
SET(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP TRUE)
|
||||
INCLUDE(InstallRequiredSystemLibraries)
|
||||
LIST(FILTER CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS INCLUDE REGEX ".*msvcp[0-9]+\.dll|.*vcruntime[0-9]+\.dll|.*vcruntime[0-9]+_[0-9]+\.dll")
|
||||
@@ -35,7 +35,7 @@
|
||||
##############################################################
|
||||
|
||||
INSTALL(DIRECTORY include/embree3 DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" COMPONENT devel)
|
||||
-IF (NOT WIN32)
|
||||
+IF (NOT MSVC)
|
||||
INSTALL(DIRECTORY man/man3 DESTINATION "${CMAKE_INSTALL_MANDIR}" COMPONENT devel)
|
||||
ENDIF()
|
||||
|
||||
--- a/common/math/constants.h
|
||||
+++ b/common/math/constants.h
|
||||
@@ -7,8 +7,7 @@
|
||||
|
||||
#include <limits>
|
||||
|
||||
-#define _USE_MATH_DEFINES
|
||||
-#include <math.h> // using cmath causes issues under Windows
|
||||
+#include <cmath> // using cmath causes issues under Windows
|
||||
#include <cfloat>
|
||||
#include <climits>
|
||||
|
||||
75
mingw-w64-embree3/PKGBUILD
Normal file
75
mingw-w64-embree3/PKGBUILD
Normal file
@@ -0,0 +1,75 @@
|
||||
# Maintainer: Alexey Pavlov <alexpux@gmail.com>
|
||||
|
||||
_realname=embree3
|
||||
pkgbase=mingw-w64-${_realname}
|
||||
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
|
||||
pkgver=3.13.5
|
||||
pkgrel=1
|
||||
pkgdesc="High Performance Ray Tracing Kernels Intel Corporation (mingw-w64)"
|
||||
arch=('any')
|
||||
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64')
|
||||
url="https://www.embree.org/"
|
||||
license=("spdx:Apache-2.0")
|
||||
depends=("${MINGW_PACKAGE_PREFIX}-gcc-libs"
|
||||
"${MINGW_PACKAGE_PREFIX}-tbb")
|
||||
makedepends=("${MINGW_PACKAGE_PREFIX}-cc"
|
||||
"${MINGW_PACKAGE_PREFIX}-cmake"
|
||||
"${MINGW_PACKAGE_PREFIX}-ninja")
|
||||
source=(${_realname}-${pkgver}.tar.gz::https://github.com/embree/embree/archive/v${pkgver}.tar.gz
|
||||
001-build-fixes.patch
|
||||
https://github.com/embree/embree/pull/412.patch)
|
||||
sha256sums=('b8c22d275d9128741265537c559d0ea73074adbf2f2b66b0a766ca52c52d665b'
|
||||
'5ee91fb07f373b3a83f26f9f9fa3ab80661a9f0b7e1c3f4a23eb572f631fa37f'
|
||||
'8bc0c0635ec0969eb60768fa9d0682096d96d17bf818eb995700f5f64601df14')
|
||||
prepare() {
|
||||
cd ${srcdir}/embree-${pkgver}
|
||||
patch -p1 -i ${srcdir}/001-build-fixes.patch
|
||||
# Windows ARM64 support
|
||||
patch -p1 -i ${srcdir}/412.patch
|
||||
|
||||
mv kernels/embree.rc{,.orig}
|
||||
iconv -f UTF-16LE -t UTF-8 kernels/embree.rc.orig > kernels/embree.rc
|
||||
}
|
||||
|
||||
build() {
|
||||
mkdir -p build-${MSYSTEM} && cd build-${MSYSTEM}
|
||||
|
||||
declare -a extra_config
|
||||
if check_option "debug" "n"; then
|
||||
extra_config+=("-DCMAKE_BUILD_TYPE=Release")
|
||||
else
|
||||
extra_config+=("-DCMAKE_BUILD_TYPE=Debug")
|
||||
fi
|
||||
|
||||
if [[ "${CARCH}" == "x86_64" ]]; then
|
||||
extra_config+=("-DEMBREE_ISA_AVX512=ON" "-DEMBREE_MAX_ISA=AVX512SKX")
|
||||
else
|
||||
extra_config+=("-DEMBREE_ISA_AVX512=OFF")
|
||||
fi
|
||||
|
||||
if [[ "${CARCH}" == "aarch64" ]]; then
|
||||
extra_config+=("-DEMBREE_ARM=ON")
|
||||
else
|
||||
extra_config+=("-DEMBREE_ARM=OFF")
|
||||
fi
|
||||
|
||||
MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX=" \
|
||||
${MINGW_PREFIX}/bin/cmake.exe -Wno-dev \
|
||||
-G"Ninja" \
|
||||
-DCMAKE_INSTALL_PREFIX=${MINGW_PREFIX} \
|
||||
-DEMBREE_STATIC_LIB=OFF \
|
||||
-DEMBREE_ISPC_SUPPORT=OFF \
|
||||
-DEMBREE_STACK_PROTECTOR=ON \
|
||||
-DEMBREE_TUTORIALS=OFF \
|
||||
-DBUILD_TESTING=OFF \
|
||||
${extra_config[@]} \
|
||||
../embree-${pkgver}
|
||||
|
||||
${MINGW_PREFIX}/bin/cmake --build .
|
||||
}
|
||||
|
||||
package() {
|
||||
cd "${srcdir}"/build-${MSYSTEM}
|
||||
DESTDIR=${pkgdir} ${MINGW_PREFIX}/bin/cmake --install .
|
||||
install -Dm644 ${srcdir}/embree-${pkgver}/LICENSE.txt "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE"
|
||||
}
|
||||
Reference in New Issue
Block a user