Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'build_files/build_environment')
-rw-r--r--build_files/build_environment/CMakeLists.txt2
-rw-r--r--build_files/build_environment/cmake/ispc.cmake6
-rw-r--r--build_files/build_environment/cmake/openmp.cmake6
-rw-r--r--build_files/build_environment/cmake/osl.cmake2
-rw-r--r--build_files/build_environment/cmake/png.cmake2
-rw-r--r--build_files/build_environment/cmake/versions.cmake14
-rwxr-xr-xbuild_files/build_environment/install_deps.sh164
-rw-r--r--build_files/build_environment/patches/openmp.diff23
8 files changed, 146 insertions, 73 deletions
diff --git a/build_files/build_environment/CMakeLists.txt b/build_files/build_environment/CMakeLists.txt
index 3a9574b4b2a..af1653de59a 100644
--- a/build_files/build_environment/CMakeLists.txt
+++ b/build_files/build_environment/CMakeLists.txt
@@ -84,7 +84,7 @@ include(cmake/openimageio.cmake)
include(cmake/tiff.cmake)
if(WIN32)
include(cmake/flexbison.cmake)
-else()
+elseif(UNIX AND NOT APPLE)
include(cmake/flex.cmake)
endif()
include(cmake/osl.cmake)
diff --git a/build_files/build_environment/cmake/ispc.cmake b/build_files/build_environment/cmake/ispc.cmake
index 93fc9dc4846..b1cd2cea0c7 100644
--- a/build_files/build_environment/cmake/ispc.cmake
+++ b/build_files/build_environment/cmake/ispc.cmake
@@ -29,13 +29,13 @@ elseif(APPLE)
if("${CMAKE_HOST_SYSTEM_PROCESSOR}" STREQUAL "arm64")
set(ISPC_EXTRA_ARGS_APPLE
-DBISON_EXECUTABLE=/opt/homebrew/opt/bison/bin/bison
- -DFLEX_EXECUTABLE=${LIBDIR}/flex/bin/flex
+ -DFLEX_EXECUTABLE=/opt/homebrew/opt/flex/bin/flex
-DARM_ENABLED=On
)
else()
set(ISPC_EXTRA_ARGS_APPLE
-DBISON_EXECUTABLE=/usr/local/opt/bison/bin/bison
- -DFLEX_EXECUTABLE=${LIBDIR}/flex/bin/flex
+ -DFLEX_EXECUTABLE=/usr/local/opt/flex/bin/flex
-DARM_ENABLED=Off
)
endif()
@@ -84,7 +84,7 @@ if(WIN32)
external_ispc
external_flexbison
)
-else()
+elseif(UNIX AND NOT APPLE)
add_dependencies(
external_ispc
external_flex
diff --git a/build_files/build_environment/cmake/openmp.cmake b/build_files/build_environment/cmake/openmp.cmake
index 0e5323ca513..d4d5e69a5ad 100644
--- a/build_files/build_environment/cmake/openmp.cmake
+++ b/build_files/build_environment/cmake/openmp.cmake
@@ -16,12 +16,18 @@
#
# ***** END GPL LICENSE BLOCK *****
+if(APPLE)
+ set(OPENMP_PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/openmp/src/external_openmp < ${PATCH_DIR}/openmp.diff)
+else()
+ set(OPENMP_PATCH_COMMAND)
+endif()
ExternalProject_Add(external_openmp
URL file://${PACKAGE_DIR}/${OPENMP_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${OPENMP_HASH_TYPE}=${OPENMP_HASH}
PREFIX ${BUILD_DIR}/openmp
+ PATCH_COMMAND ${OPENMP_PATCH_COMMAND}
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openmp ${DEFAULT_CMAKE_FLAGS}
INSTALL_COMMAND cd ${BUILD_DIR}/openmp/src/external_openmp-build && install_name_tool -id @rpath/libomp.dylib runtime/src/libomp.dylib && make install
INSTALL_DIR ${LIBDIR}/openmp
diff --git a/build_files/build_environment/cmake/osl.cmake b/build_files/build_environment/cmake/osl.cmake
index 05aedb1f085..c20bf68c0ef 100644
--- a/build_files/build_environment/cmake/osl.cmake
+++ b/build_files/build_environment/cmake/osl.cmake
@@ -96,7 +96,7 @@ if(WIN32)
external_osl
external_flexbison
)
-else()
+elseif(UNIX AND NOT APPLE)
add_dependencies(
external_osl
external_flex
diff --git a/build_files/build_environment/cmake/png.cmake b/build_files/build_environment/cmake/png.cmake
index 458d3a1fd98..3fc53b238c2 100644
--- a/build_files/build_environment/cmake/png.cmake
+++ b/build_files/build_environment/cmake/png.cmake
@@ -23,7 +23,7 @@ set(PNG_EXTRA_ARGS
)
if(BLENDER_PLATFORM_ARM)
- set(PNG_EXTRA_ARGS ${PNG_EXTRA_ARGS} -DPNG_HARDWARE_OPTIMIZATIONS=ON -DPNG_ARM_NEON=ON -DCMAKE_SYSTEM_PROCESSOR="aarch64")
+ set(PNG_EXTRA_ARGS ${PNG_EXTRA_ARGS} -DPNG_HARDWARE_OPTIMIZATIONS=ON -DPNG_ARM_NEON=on -DCMAKE_SYSTEM_PROCESSOR="aarch64")
endif()
ExternalProject_Add(external_png
diff --git a/build_files/build_environment/cmake/versions.cmake b/build_files/build_environment/cmake/versions.cmake
index bc220c596c1..d1675bdddfd 100644
--- a/build_files/build_environment/cmake/versions.cmake
+++ b/build_files/build_environment/cmake/versions.cmake
@@ -158,10 +158,18 @@ set(LLVM_HASH 5a4fab4d7fc84aefffb118ac2c8a4fc0)
set(LLVM_HASH_TYPE MD5)
set(LLVM_FILE llvm-project-${LLVM_VERSION}.src.tar.xz)
-set(OPENMP_URI https://github.com/llvm/llvm-project/releases/download/llvmorg-${LLVM_VERSION}/openmp-${LLVM_VERSION}.src.tar.xz)
-set(OPENMP_HASH ac48ce3e4582ccb82f81ab59eb3fc9dc)
+if(APPLE)
+ # Cloth physics test is crashing due to this bug:
+ # https://bugs.llvm.org/show_bug.cgi?id=50579
+ set(OPENMP_VERSION 9.0.1)
+ set(OPENMP_HASH 6eade16057edbdecb3c4eef9daa2bfcf)
+else()
+ set(OPENMP_VERSION ${LLVM_VERSION})
+ set(OPENMP_HASH ac48ce3e4582ccb82f81ab59eb3fc9dc)
+endif()
+set(OPENMP_URI https://github.com/llvm/llvm-project/releases/download/llvmorg-${OPENMP_VERSION}/openmp-${OPENMP_VERSION}.src.tar.xz)
set(OPENMP_HASH_TYPE MD5)
-set(OPENMP_FILE openmp-${LLVM_VERSION}.src.tar.xz)
+set(OPENMP_FILE openmp-${OPENMP_VERSION}.src.tar.xz)
set(OPENIMAGEIO_VERSION 2.2.15.1)
set(OPENIMAGEIO_URI https://github.com/OpenImageIO/oiio/archive/Release-${OPENIMAGEIO_VERSION}.tar.gz)
diff --git a/build_files/build_environment/install_deps.sh b/build_files/build_environment/install_deps.sh
index fd4f59fcda7..ecaff307885 100755
--- a/build_files/build_environment/install_deps.sh
+++ b/build_files/build_environment/install_deps.sh
@@ -603,6 +603,9 @@ MP3LAME_DEV=""
OPENJPEG_USE=false
OPENJPEG_DEV=""
+# Whether to use system GLEW or not (OpenSubDiv needs recent glew to work).
+NO_SYSTEM_GLEW=false
+
# Switch to english language, else some things (like check_package_DEB()) won't work!
LANG_BACK=$LANG
LANG=""
@@ -1016,7 +1019,7 @@ PRINT ""
PYTHON_SOURCE=( "https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tgz" )
_boost_version_nodots=`echo "$BOOST_VERSION" | sed -r 's/\./_/g'`
-BOOST_SOURCE=( "https://dl.bintray.com/boostorg/release/$BOOST_VERSION/source/boost_$_boost_version_nodots.tar.bz2" )
+BOOST_SOURCE=( "https://boostorg.jfrog.io/artifactory/main/release/$BOOST_VERSION/source/boost_$_boost_version_nodots.tar.bz2" )
BOOST_BUILD_MODULES="--with-system --with-filesystem --with-thread --with-regex --with-locale --with-date_time --with-wave --with-iostreams --with-python --with-program_options --with-serialization --with-atomic"
TBB_SOURCE=( "https://github.com/oneapi-src/oneTBB/archive/$TBB_VERSION$TBB_VERSION_UPDATE.tar.gz" )
@@ -1444,9 +1447,7 @@ compile_Python() {
make -j$THREADS && make install
make clean
- if [ -d $_inst ]; then
- _create_inst_shortcut
- else
+ if [ ! -d $_inst ]; then
ERROR "Python--$PYTHON_VERSION failed to compile, exiting"
exit 1
fi
@@ -1462,6 +1463,9 @@ compile_Python() {
INFO "If you want to force rebuild of this lib, use the --force-python option."
fi
+ if [ -d $_inst ]; then
+ _create_inst_shortcut
+ fi
run_ldconfig "python-$PYTHON_VERSION_SHORT"
# Extra step: install required modules with pip.
@@ -1555,9 +1559,7 @@ compile_Boost() {
--prefix=$_inst --disable-icu boost.locale.icu=off install
./b2 --clean
- if [ -d $_inst ]; then
- _create_inst_shortcut
- else
+ if [ ! -d $_inst ]; then
ERROR "Boost-$BOOST_VERSION failed to compile, exiting"
exit 1
fi
@@ -1571,7 +1573,9 @@ compile_Boost() {
INFO "If you want to force rebuild of this lib, use the --force-boost option."
fi
- # Just always run it, much simpler this way!
+ if [ -d $_inst ]; then
+ _create_inst_shortcut
+ fi
run_ldconfig "boost"
}
@@ -1684,9 +1688,7 @@ compile_TBB() {
make clean
- if [ -d $_inst ]; then
- _create_inst_shortcut
- else
+ if [ ! -d $_inst ]; then
ERROR "TBB-$TBB_VERSION$TBB_VERSION_UPDATE failed to compile, exiting"
exit 1
fi
@@ -1700,6 +1702,9 @@ compile_TBB() {
INFO "If you want to force rebuild of this lib, use the --force-tbb option."
fi
+ if [ -d $_inst ]; then
+ _create_inst_shortcut
+ fi
run_ldconfig "tbb"
}
@@ -1819,9 +1824,7 @@ compile_OCIO() {
make clean
- if [ -d $_inst ]; then
- _create_inst_shortcut
- else
+ if [ ! -d $_inst ]; then
ERROR "OpenColorIO-$OCIO_VERSION failed to compile, exiting"
exit 1
fi
@@ -1835,6 +1838,9 @@ compile_OCIO() {
INFO "If you want to force rebuild of this lib, use the --force-ocio option."
fi
+ if [ -d $_inst ]; then
+ _create_inst_shortcut
+ fi
run_ldconfig "ocio"
}
@@ -1950,9 +1956,7 @@ compile_OPENEXR() {
make clean
- if [ -d $_inst ]; then
- _create_inst_shortcut
- else
+ if [ ! -d $_inst ]; then
ERROR "OpenEXR-$OPENEXR_VERSION failed to compile, exiting"
exit 1
fi
@@ -1968,7 +1972,9 @@ compile_OPENEXR() {
_with_built_openexr=true
- # Just always run it, much simpler this way!
+ if [ -d $_inst ]; then
+ _create_inst_shortcut
+ fi
run_ldconfig "openexr"
}
@@ -2109,9 +2115,7 @@ compile_OIIO() {
make -j$THREADS && make install
make clean
- if [ -d $_inst ]; then
- _create_inst_shortcut
- else
+ if [ ! -d $_inst ]; then
ERROR "OpenImageIO-$OIIO_VERSION failed to compile, exiting"
exit 1
fi
@@ -2125,7 +2129,9 @@ compile_OIIO() {
INFO "If you want to force rebuild of this lib, use the --force-oiio option."
fi
- # Just always run it, much simpler this way!
+ if [ -d $_inst ]; then
+ _create_inst_shortcut
+ fi
run_ldconfig "oiio"
}
@@ -2234,9 +2240,7 @@ compile_LLVM() {
make -j$THREADS && make install
make clean
- if [ -d $_inst ]; then
- _create_inst_shortcut
- else
+ if [ ! -d $_inst ]; then
ERROR "LLVM-$LLVM_VERSION failed to compile, exiting"
exit 1
fi
@@ -2249,6 +2253,10 @@ compile_LLVM() {
INFO "Own LLVM-$LLVM_VERSION (CLANG included) is up to date, nothing to do!"
INFO "If you want to force rebuild of this lib, use the --force-llvm option."
fi
+
+ if [ -d $_inst ]; then
+ _create_inst_shortcut
+ fi
}
# ----------------------------------------------------------------------------
@@ -2387,9 +2395,7 @@ compile_OSL() {
make -j$THREADS && make install
make clean
- if [ -d $_inst ]; then
- _create_inst_shortcut
- else
+ if [ ! -d $_inst ]; then
ERROR "OpenShadingLanguage-$OSL_VERSION failed to compile, exiting"
exit 1
fi
@@ -2403,6 +2409,9 @@ compile_OSL() {
INFO "If you want to force rebuild of this lib, use the --force-osl option."
fi
+ if [ -d $_inst ]; then
+ _create_inst_shortcut
+ fi
run_ldconfig "osl"
}
@@ -2503,9 +2512,7 @@ compile_OSD() {
make -j$THREADS && make install
make clean
- if [ -d $_inst ]; then
- _create_inst_shortcut
- else
+ if [ ! -d $_inst ]; then
ERROR "OpenSubdiv-$OSD_VERSION failed to compile, exiting"
exit 1
fi
@@ -2519,6 +2526,9 @@ compile_OSD() {
INFO "If you want to force rebuild of this lib, use the --force-osd option."
fi
+ if [ -d $_inst ]; then
+ _create_inst_shortcut
+ fi
run_ldconfig "osd"
}
@@ -2608,9 +2618,7 @@ compile_BLOSC() {
make clean
- if [ -d $_inst ]; then
- _create_inst_shortcut
- else
+ if [ ! -d $_inst ]; then
ERROR "Blosc-$OPENVDB_BLOSC_VERSION failed to compile, exiting"
exit 1
fi
@@ -2623,6 +2631,9 @@ compile_BLOSC() {
magic_compile_set blosc-$OPENVDB_BLOSC_VERSION $blosc_magic
+ if [ -d $_inst ]; then
+ _create_inst_shortcut
+ fi
run_ldconfig "blosc"
}
@@ -2713,9 +2724,7 @@ install_NanoVDB() {
#~ mkdir -p $_inst
#~ cp -r $_src/include $_inst/include
- if [ -d $_inst ]; then
- _create_inst_shortcut
- else
+ if [ ! -d $_inst ]; then
ERROR "NanoVDB-v$OPENVDB_VERSION failed to install, exiting"
exit 1
fi
@@ -2727,6 +2736,10 @@ install_NanoVDB() {
else
INFO "Own NanoVDB-v$OPENVDB_VERSION is up to date, nothing to do!"
fi
+
+ if [ -d $_inst ]; then
+ _create_inst_shortcut
+ fi
}
@@ -2846,9 +2859,7 @@ compile_OPENVDB() {
make -j$THREADS install
make clean
- if [ -d $_inst ]; then
- _create_inst_shortcut
- else
+ if [ ! -d $_inst ]; then
ERROR "OpenVDB-$OPENVDB_VERSION failed to compile, exiting"
exit 1
fi
@@ -2862,6 +2873,9 @@ compile_OPENVDB() {
INFO "If you want to force rebuild of this lib, use the --force-openvdb option."
fi
+ if [ -d $_inst ]; then
+ _create_inst_shortcut
+ fi
run_ldconfig "openvdb"
if [ "$WITH_NANOVDB" = true ]; then
@@ -2959,9 +2973,7 @@ compile_ALEMBIC() {
make -j$THREADS install
make clean
- if [ -d $_inst ]; then
- _create_inst_shortcut
- else
+ if [ ! -d $_inst ]; then
ERROR "Alembic-$ALEMBIC_VERSION failed to compile, exiting"
exit 1
fi
@@ -2975,6 +2987,9 @@ compile_ALEMBIC() {
INFO "If you want to force rebuild of this lib, use the --force-alembic option."
fi
+ if [ -d $_inst ]; then
+ _create_inst_shortcut
+ fi
run_ldconfig "alembic"
}
@@ -3059,9 +3074,7 @@ compile_USD() {
make -j$THREADS install
make clean
- if [ -d $_inst ]; then
- _create_inst_shortcut
- else
+ if [ ! -d $_inst ]; then
ERROR "USD-$USD_VERSION failed to compile, exiting"
exit 1
fi
@@ -3075,6 +3088,9 @@ compile_USD() {
INFO "If you want to force rebuild of this lib, use the --force-usd option."
fi
+ if [ -d $_inst ]; then
+ _create_inst_shortcut
+ fi
run_ldconfig "usd"
}
@@ -3168,9 +3184,7 @@ compile_OpenCOLLADA() {
make -j$THREADS && make install
make clean
- if [ -d $_inst ]; then
- _create_inst_shortcut
- else
+ if [ ! -d $_inst ]; then
ERROR "OpenCOLLADA-$OPENCOLLADA_VERSION failed to compile, exiting"
exit 1
fi
@@ -3183,6 +3197,10 @@ compile_OpenCOLLADA() {
INFO "Own OpenCOLLADA-$OPENCOLLADA_VERSION is up to date, nothing to do!"
INFO "If you want to force rebuild of this lib, use the --force-opencollada option."
fi
+
+ if [ -d $_inst ]; then
+ _create_inst_shortcut
+ fi
}
# ----------------------------------------------------------------------------
@@ -3283,9 +3301,7 @@ compile_Embree() {
make -j$THREADS && make install
make clean
- if [ -d $_inst ]; then
- _create_inst_shortcut
- else
+ if [ ! -d $_inst ]; then
ERROR "Embree-$EMBREE_VERSION failed to compile, exiting"
exit 1
fi
@@ -3298,6 +3314,10 @@ compile_Embree() {
INFO "Own Embree-$EMBREE_VERSION is up to date, nothing to do!"
INFO "If you want to force rebuild of this lib, use the --force-embree option."
fi
+
+ if [ -d $_inst ]; then
+ _create_inst_shortcut
+ fi
}
# ----------------------------------------------------------------------------
@@ -3360,9 +3380,7 @@ install_ISPC() {
mkdir -p $_inst
cp -r $_src/bin $_inst/bin
- if [ -d $_inst ]; then
- _create_inst_shortcut
- else
+ if [ ! -d $_inst ]; then
ERROR "ISPC-v$ISPC_VERSION failed to install, exiting"
exit 1
fi
@@ -3375,6 +3393,10 @@ install_ISPC() {
INFO "Own ISPC-v$ISPC_VERSION is up to date, nothing to do!"
fi
+ if [ -d $_inst ]; then
+ _create_inst_shortcut
+ fi
+
_ispc_path_bin=$_inst/bin
run_ldconfig "ispc"
}
@@ -3474,9 +3496,7 @@ compile_OIDN() {
make -j$THREADS && make install
make clean
- if [ -d $_inst ]; then
- _create_inst_shortcut
- else
+ if [ ! -d $_inst ]; then
ERROR "OpenImageDenoise-$OIDN_VERSION failed to compile, exiting"
exit 1
fi
@@ -3490,6 +3510,9 @@ compile_OIDN() {
INFO "If you want to force rebuild of this lib, use the --force-oidn option."
fi
+ if [ -d $_inst ]; then
+ _create_inst_shortcut
+ fi
run_ldconfig "oidn"
}
@@ -3606,9 +3629,7 @@ compile_FFmpeg() {
make -j$THREADS && make install
make clean
- if [ -d $_inst ]; then
- _create_inst_shortcut
- else
+ if [ ! -d $_inst ]; then
ERROR "FFmpeg-$FFMPEG_VERSION failed to compile, exiting"
exit 1
fi
@@ -3621,6 +3642,10 @@ compile_FFmpeg() {
INFO "Own ffmpeg-$FFMPEG_VERSION is up to date, nothing to do!"
INFO "If you want to force rebuild of this lib, use the --force-ffmpeg option."
fi
+
+ if [ -d $_inst ]; then
+ _create_inst_shortcut
+ fi
}
# ----------------------------------------------------------------------------
@@ -3719,9 +3744,7 @@ compile_XR_OpenXR_SDK() {
make -j$THREADS && make install
make clean
- if [ -d $_inst ]; then
- _create_inst_shortcut
- else
+ if [ ! -d $_inst ]; then
ERROR "XR-OpenXR-SDK-$XR_OPENXR_VERSION failed to compile, exiting"
exit 1
fi
@@ -3735,6 +3758,9 @@ compile_XR_OpenXR_SDK() {
INFO "If you want to force rebuild of this lib, use the --force-xr-openxr option."
fi
+ if [ -d $_inst ]; then
+ _create_inst_shortcut
+ fi
run_ldconfig "xr-openxr-sdk"
}
@@ -3982,9 +4008,13 @@ install_DEB() {
version_ge $_glew "1.7.0"
if [ $? -eq 1 ]; then
WARNING "OpenSubdiv disabled because GLEW-$_glew is not enough"
+ WARNING "Blender will not use system GLEW library"
OSD_SKIP=true
+ NO_SYSTEM_GLEW=true
else
WARNING "OpenSubdiv will compile with GLEW-$_glew but with limited capability"
+ WARNING "Blender will not use system GLEW library"
+ NO_SYSTEM_GLEW=true
fi
fi
@@ -5955,6 +5985,12 @@ print_info() {
fi
fi
+ if [ "$NO_SYSTEM_GLEW" = true ]; then
+ _1="-D WITH_SYSTEM_GLEW=OFF"
+ PRINT " $_1"
+ _buildargs="$_buildargs $_1"
+ fi
+
if [ "$FFMPEG_SKIP" = false ]; then
_1="-D WITH_CODEC_FFMPEG=ON"
_2="-D FFMPEG_LIBRARIES='avformat;avcodec;avutil;avdevice;swscale;swresample;lzma;rt;`print_info_ffmpeglink`'"
diff --git a/build_files/build_environment/patches/openmp.diff b/build_files/build_environment/patches/openmp.diff
new file mode 100644
index 00000000000..201ab5c7713
--- /dev/null
+++ b/build_files/build_environment/patches/openmp.diff
@@ -0,0 +1,23 @@
+diff --git a/runtime/src/z_Linux_asm.S b/runtime/src/z_Linux_asm.S
+index 0d8885e..42aa5ad 100644
+--- a/runtime/src/z_Linux_asm.S
++++ b/runtime/src/z_Linux_asm.S
+@@ -1540,10 +1540,12 @@ __kmp_unnamed_critical_addr:
+ .comm .gomp_critical_user_,32,8
+ .data
+ .align 8
+- .global __kmp_unnamed_critical_addr
+-__kmp_unnamed_critical_addr:
++ .global ___kmp_unnamed_critical_addr
++___kmp_unnamed_critical_addr:
+ .8byte .gomp_critical_user_
+- .size __kmp_unnamed_critical_addr,8
++# if !(KMP_OS_DARWIN)
++ .size ___kmp_unnamed_critical_addr,8
++# endif
+ #endif /* KMP_ARCH_PPC64 || KMP_ARCH_AARCH64 */
+
+ #if KMP_OS_LINUX
+
+
+