Merge branch 'master' into blender2.8
This commit is contained in:
@@ -25,8 +25,10 @@ ExternalProject_Add(external_ffi
|
||||
--enable-shared=no
|
||||
--enable-static=yes
|
||||
--with-pic
|
||||
--libdir=${LIBDIR}/ffi/lib/
|
||||
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/ffi/src/external_ffi/ && make -j${MAKE_THREADS}
|
||||
INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/ffi/src/external_ffi/ && make install
|
||||
PATCH_COMMAND ${PATCH_CMD} -p 0 -d ${BUILD_DIR}/ffi/src/external_ffi < ${PATCH_DIR}/ffi.diff
|
||||
INSTALL_DIR ${LIBDIR}/ffi
|
||||
)
|
||||
|
||||
|
||||
@@ -89,11 +89,12 @@ else()
|
||||
|
||||
set(PYTHON_CONFIGURE_EXTRA_ARGS "--with-openssl=${LIBDIR}/ssl")
|
||||
set(PYTHON_CFLAGS "-I${LIBDIR}/sqlite/include -I${LIBDIR}/bzip2/include -I${LIBDIR}/lzma/include -I${LIBDIR}/zlib/include")
|
||||
set(PYTHON_LDFLAGS "-L${LIBDIR}/sqlite/lib -L${LIBDIR}/bzip2/lib -L${LIBDIR}/lzma/lib -L${LIBDIR}/zlib/lib")
|
||||
set(PYTHON_LDFLAGS "-L${LIBDIR}/ffi/lib -L${LIBDIR}/sqlite/lib -L${LIBDIR}/bzip2/lib -L${LIBDIR}/lzma/lib -L${LIBDIR}/zlib/lib")
|
||||
set(PYTHON_CONFIGURE_EXTRA_ENV
|
||||
export CFLAGS=${PYTHON_CFLAGS} &&
|
||||
export CPPFLAGS=${PYTHON_CFLAGS} &&
|
||||
export LDFLAGS=${PYTHON_LDFLAGS})
|
||||
export LDFLAGS=${PYTHON_LDFLAGS} &&
|
||||
export PKG_CONFIG_PATH=${LIBDIR}/ffi/lib/pkgconfig)
|
||||
set(PYTHON_PATCH ${PATCH_CMD} --verbose -p1 -d ${BUILD_DIR}/python/src/external_python < ${PATCH_DIR}/python_linux.diff)
|
||||
|
||||
ExternalProject_Add(external_python
|
||||
|
||||
11
build_files/build_environment/patches/ffi.diff
Normal file
11
build_files/build_environment/patches/ffi.diff
Normal file
@@ -0,0 +1,11 @@
|
||||
--- Makefile.in 2014-11-12 06:59:58.000000000 -0500
|
||||
+++ Makefile.in 2018-09-17 13:36:10.974086554 -0400
|
||||
@@ -600,7 +600,7 @@
|
||||
target_os = @target_os@
|
||||
target_vendor = @target_vendor@
|
||||
toolexecdir = @toolexecdir@
|
||||
-toolexeclibdir = @toolexeclibdir@
|
||||
+toolexeclibdir = $(libdir)
|
||||
top_build_prefix = @top_build_prefix@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
@@ -56,8 +56,13 @@ INCLUDE(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(PCRE DEFAULT_MSG
|
||||
PCRE_LIBRARY PCRE_INCLUDE_DIR)
|
||||
|
||||
# With 'make deps' precompiled libs, opencollada ships with a copy of libpcre
|
||||
# but not the headers, ${PCRE_LIBRARY} will be valid in this case
|
||||
# but PCRE_FOUND will be FALSE. So we set this variable outside of
|
||||
# the IF(PCRE_FOUND) below to allow blender to successfully link.
|
||||
SET(PCRE_LIBRARIES ${PCRE_LIBRARY})
|
||||
|
||||
IF(PCRE_FOUND)
|
||||
SET(PCRE_LIBRARIES ${PCRE_LIBRARY})
|
||||
SET(PCRE_INCLUDE_DIRS ${PCRE_INCLUDE_DIR})
|
||||
ENDIF(PCRE_FOUND)
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ IF(NOT PYTHON_ROOT_DIR AND NOT $ENV{PYTHON_ROOT_DIR} STREQUAL "")
|
||||
SET(PYTHON_ROOT_DIR $ENV{PYTHON_ROOT_DIR})
|
||||
ENDIF()
|
||||
|
||||
SET(PYTHON_VERSION 3.6 CACHE STRING "Python Version (major and minor only)")
|
||||
SET(PYTHON_VERSION 3.7 CACHE STRING "Python Version (major and minor only)")
|
||||
MARK_AS_ADVANCED(PYTHON_VERSION)
|
||||
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ struct avxb
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline avxb( FalseTy ) : m256(_mm256_setzero_ps()) {}
|
||||
__forceinline avxb( TrueTy ) : m256(_mm256_castsi256_ps(_mm256_cmpeq_epi32(_mm256_setzero_si256(), _mm256_setzero_si256()))) {}
|
||||
__forceinline avxb( TrueTy ) : m256(_mm256_castsi256_ps(_mm256_set1_epi32(-1))) {}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Array Access
|
||||
@@ -86,7 +86,21 @@ __forceinline const avxb operator ^=( avxb& a, const avxb& b ) { return a = a ^
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__forceinline const avxb operator !=( const avxb& a, const avxb& b ) { return _mm256_xor_ps(a, b); }
|
||||
__forceinline const avxb operator ==( const avxb& a, const avxb& b ) { return _mm256_castsi256_ps(_mm256_cmpeq_epi32(a, b)); }
|
||||
__forceinline const avxb operator ==( const avxb& a, const avxb& b )
|
||||
{
|
||||
#ifdef __KERNEL_AVX2__
|
||||
return _mm256_castsi256_ps(_mm256_cmpeq_epi32(a, b));
|
||||
#else
|
||||
__m128i a_lo = _mm_castps_si128(_mm256_extractf128_ps(a, 0));
|
||||
__m128i a_hi = _mm_castps_si128(_mm256_extractf128_ps(a, 1));
|
||||
__m128i b_lo = _mm_castps_si128(_mm256_extractf128_ps(b, 0));
|
||||
__m128i b_hi = _mm_castps_si128(_mm256_extractf128_ps(b, 1));
|
||||
__m128i c_lo = _mm_cmpeq_epi32(a_lo, b_lo);
|
||||
__m128i c_hi = _mm_cmpeq_epi32(a_hi, b_hi);
|
||||
__m256i result = _mm256_insertf128_si256(_mm256_castsi128_si256(c_lo), c_hi, 1);
|
||||
return _mm256_castsi256_ps(result);
|
||||
#endif
|
||||
}
|
||||
|
||||
__forceinline const avxb select( const avxb& m, const avxb& t, const avxb& f ) {
|
||||
#if defined(__KERNEL_SSE41__)
|
||||
|
||||
@@ -214,17 +214,19 @@ __forceinline const avxf nmadd(const avxf& a, const avxf& b, const avxf& c) {
|
||||
#endif
|
||||
}
|
||||
__forceinline const avxf msub(const avxf& a, const avxf& b, const avxf& c) {
|
||||
#ifdef __KERNEL_AVX2__
|
||||
return _mm256_fmsub_ps(a, b, c);
|
||||
#else
|
||||
return (a*b) - c;
|
||||
#endif
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Comparison Operators
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
#ifdef __KERNEL_AVX2__
|
||||
__forceinline const avxb operator <=(const avxf& a, const avxf& b) {
|
||||
return _mm256_cmp_ps(a.m256, b.m256, _CMP_LE_OS);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@ const ImFileType IMB_FILE_TYPES[] = {
|
||||
{NULL, NULL, imb_is_a_hdr, NULL, imb_ftype_default, imb_loadhdr, NULL, imb_savehdr, NULL, IM_FTYPE_FLOAT, IMB_FTYPE_RADHDR, COLOR_ROLE_DEFAULT_FLOAT},
|
||||
#endif
|
||||
#ifdef WITH_OPENEXR
|
||||
{imb_initopenexr, NULL, imb_is_a_openexr, NULL, imb_ftype_default, imb_load_openexr, NULL, imb_save_openexr, NULL, IM_FTYPE_FLOAT, IMB_FTYPE_OPENEXR, COLOR_ROLE_DEFAULT_FLOAT},
|
||||
{imb_initopenexr, imb_exitopenexr, imb_is_a_openexr, NULL, imb_ftype_default, imb_load_openexr, NULL, imb_save_openexr, NULL, IM_FTYPE_FLOAT, IMB_FTYPE_OPENEXR, COLOR_ROLE_DEFAULT_FLOAT},
|
||||
#endif
|
||||
#ifdef WITH_OPENJPEG
|
||||
{NULL, NULL, imb_is_a_jp2, NULL, imb_ftype_default, imb_load_jp2, NULL, imb_save_jp2, NULL, IM_FTYPE_FLOAT, IMB_FTYPE_JP2, COLOR_ROLE_DEFAULT_BYTE},
|
||||
|
||||
@@ -1921,4 +1921,12 @@ void imb_initopenexr(void)
|
||||
setGlobalThreadCount(num_threads);
|
||||
}
|
||||
|
||||
void imb_exitopenexr(void)
|
||||
{
|
||||
/* Tells OpenEXR to free thread pool, also ensures there is no running
|
||||
* tasks.
|
||||
*/
|
||||
setGlobalThreadCount(0);
|
||||
}
|
||||
|
||||
} // export "C"
|
||||
|
||||
@@ -40,6 +40,7 @@ extern "C" {
|
||||
#include <stdio.h>
|
||||
|
||||
void imb_initopenexr (void);
|
||||
void imb_exitopenexr (void);
|
||||
|
||||
int imb_is_a_openexr (const unsigned char *mem);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user