diff options
Diffstat (limited to 'build_files/build_environment')
41 files changed, 1569 insertions, 425 deletions
diff --git a/build_files/build_environment/CMakeLists.txt b/build_files/build_environment/CMakeLists.txt index b63e86a3ac2..468a434b887 100644 --- a/build_files/build_environment/CMakeLists.txt +++ b/build_files/build_environment/CMakeLists.txt @@ -29,10 +29,12 @@ cmake_minimum_required(VERSION 3.5) include(ExternalProject) include(cmake/check_software.cmake) -include(cmake/versions.cmake) include(cmake/options.cmake) +# versions.cmake needs to be included after options.cmake due to the BLENDER_PLATFORM_ARM variable being needed. +include(cmake/versions.cmake) include(cmake/boost_build_options.cmake) include(cmake/download.cmake) +include(cmake/macros.cmake) if(ENABLE_MINGW64) include(cmake/setup_mingw64.cmake) @@ -51,13 +53,12 @@ include(cmake/imath.cmake) include(cmake/openexr.cmake) include(cmake/brotli.cmake) include(cmake/freetype.cmake) +include(cmake/epoxy.cmake) include(cmake/freeglut.cmake) -include(cmake/glew.cmake) include(cmake/alembic.cmake) include(cmake/opensubdiv.cmake) include(cmake/sdl.cmake) include(cmake/opencollada.cmake) -include(cmake/llvm.cmake) if(APPLE) include(cmake/openmp.cmake) endif() @@ -75,6 +76,7 @@ include(cmake/osl.cmake) include(cmake/tbb.cmake) include(cmake/openvdb.cmake) include(cmake/python.cmake) +include(cmake/llvm.cmake) option(USE_PIP_NUMPY "Install NumPy using pip wheel instead of building from source" OFF) if(APPLE AND ("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "x86_64")) set(USE_PIP_NUMPY ON) @@ -92,10 +94,20 @@ include(cmake/pugixml.cmake) include(cmake/ispc.cmake) include(cmake/openimagedenoise.cmake) include(cmake/embree.cmake) +include(cmake/openpgl.cmake) include(cmake/fmt.cmake) include(cmake/robinmap.cmake) if(NOT APPLE) include(cmake/xr_openxr.cmake) + if(NOT WIN32 OR BUILD_MODE STREQUAL Release) + include(cmake/dpcpp.cmake) + include(cmake/dpcpp_deps.cmake) + endif() + if(NOT WIN32) + include(cmake/igc.cmake) + include(cmake/gmmlib.cmake) + include(cmake/ocloc.cmake) + endif() endif() # OpenColorIO and dependencies. @@ -128,6 +140,7 @@ if(NOT WIN32 OR ENABLE_MINGW64) include(cmake/vpx.cmake) include(cmake/x264.cmake) include(cmake/xvidcore.cmake) + include(cmake/aom.cmake) include(cmake/ffmpeg.cmake) include(cmake/fftw.cmake) include(cmake/sndfile.cmake) @@ -157,6 +170,8 @@ if(UNIX AND NOT APPLE) include(cmake/libglu.cmake) include(cmake/mesa.cmake) include(cmake/wayland_protocols.cmake) + # Can be removed when the build-bot upgrades to v1.20.x or newer. + include(cmake/wayland.cmake) endif() include(cmake/harvest.cmake) diff --git a/build_files/build_environment/cmake/alembic.cmake b/build_files/build_environment/cmake/alembic.cmake index 484a7849ace..8b049e9e206 100644 --- a/build_files/build_environment/cmake/alembic.cmake +++ b/build_files/build_environment/cmake/alembic.cmake @@ -42,4 +42,5 @@ endif() add_dependencies( external_alembic external_openexr + external_imath ) diff --git a/build_files/build_environment/cmake/aom.cmake b/build_files/build_environment/cmake/aom.cmake new file mode 100644 index 00000000000..9f64439771f --- /dev/null +++ b/build_files/build_environment/cmake/aom.cmake @@ -0,0 +1,45 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + +if(WIN32) + # The default generator on windows is msbuild, which we do not + # want to use for this dep, as needs to build with mingw + set(AOM_GENERATOR "Ninja") + # The default flags are full of MSVC options given this will be + # building with mingw, it'll have an unhappy time with that and + # we need to clear them out. + set(AOM_CMAKE_FLAGS ) + # CMake will correctly identify phreads being available, however + # we do not want to use them, as that gains a dependency on + # libpthreadswin.dll which we do not want. when pthreads is not + # available oam will use a pthreads emulation layer using win32 threads + set(AOM_EXTRA_ARGS_WIN32 -DCMAKE_HAVE_PTHREAD_H=OFF) +else() + set(AOM_GENERATOR "Unix Makefiles") + set(AOM_CMAKE_FLAGS ${DEFAULT_CMAKE_FLAGS}) +endif() + +set(AOM_EXTRA_ARGS + -DENABLE_TESTDATA=OFF + -DENABLE_TESTS=OFF + -DENABLE_TOOLS=OFF + -DENABLE_EXAMPLES=OFF + ${AOM_EXTRA_ARGS_WIN32} +) + +# This is slightly different from all other deps in the way that +# aom uses cmake as a build system, but still needs the environment setup +# to include perl so we manually setup the environment and call +# cmake directly for the configure, build and install commands. + +ExternalProject_Add(external_aom + URL file://${PACKAGE_DIR}/${AOM_FILE} + DOWNLOAD_DIR ${DOWNLOAD_DIR} + URL_HASH ${AOM_HASH_TYPE}=${AOM_HASH} + PREFIX ${BUILD_DIR}/aom + CONFIGURE_COMMAND ${CONFIGURE_ENV} && + cd ${BUILD_DIR}/aom/src/external_aom-build/ && + ${CMAKE_COMMAND} -G "${AOM_GENERATOR}" -DCMAKE_INSTALL_PREFIX=${LIBDIR}/aom ${AOM_CMAKE_FLAGS} ${AOM_EXTRA_ARGS} ${BUILD_DIR}/aom/src/external_aom/ + BUILD_COMMAND ${CMAKE_COMMAND} --build . + INSTALL_COMMAND ${CMAKE_COMMAND} --build . --target install + INSTALL_DIR ${LIBDIR}/aom +) diff --git a/build_files/build_environment/cmake/check_software.cmake b/build_files/build_environment/cmake/check_software.cmake index 2a1aaef0bee..bdb9036e3f9 100644 --- a/build_files/build_environment/cmake/check_software.cmake +++ b/build_files/build_environment/cmake/check_software.cmake @@ -12,21 +12,13 @@ if(UNIX) automake bison ${_libtoolize_name} + meson + ninja pkg-config tclsh yasm ) - if(NOT APPLE) - set(_required_software - ${_required_software} - - # Needed for Mesa. - meson - ninja - ) - endif() - foreach(_software ${_required_software}) find_program(_software_find NAMES ${_software}) if(NOT _software_find) @@ -54,13 +46,10 @@ if(UNIX) " ${_software_missing}\n" "\n" "On Debian and Ubuntu:\n" - " apt install autoconf automake libtool yasm tcl ninja-build meson python3-mako\n" - "\n" - "On macOS Intel (with homebrew):\n" - " brew install autoconf automake bison libtool pkg-config yasm\n" + " apt install autoconf automake bison libtool yasm tcl ninja-build meson python3-mako\n" "\n" - "On macOS ARM (with homebrew):\n" - " brew install autoconf automake bison flex libtool pkg-config yasm\n" + "On macOS (with homebrew):\n" + " brew install autoconf automake bison flex libtool meson ninja pkg-config yasm\n" "\n" "Other platforms:\n" " Install equivalent packages.\n") diff --git a/build_files/build_environment/cmake/download.cmake b/build_files/build_environment/cmake/download.cmake index 81e7f7ab3fe..7c91fe5455e 100644 --- a/build_files/build_environment/cmake/download.cmake +++ b/build_files/build_environment/cmake/download.cmake @@ -14,6 +14,20 @@ function(download_source dep) else() set(TARGET_URI https://svn.blender.org/svnroot/bf-blender/trunk/lib/packages/${TARGET_FILE}) endif() + # Validate all required variables are set and give an explicit error message + # rather than CMake erroring out later on with a more ambigious error. + if (NOT DEFINED TARGET_FILE) + message(FATAL_ERROR "${dep}_FILE variable not set") + endif() + if (NOT DEFINED TARGET_HASH) + message(FATAL_ERROR "${dep}_HASH variable not set") + endif() + if (NOT DEFINED TARGET_HASH_TYPE) + message(FATAL_ERROR "${dep}_HASH_TYPE variable not set") + endif() + if (NOT DEFINED TARGET_URI) + message(FATAL_ERROR "${dep}_URI variable not set") + endif() set(TARGET_FILE ${PACKAGE_DIR}/${TARGET_FILE}) message("Checking source : ${dep} (${TARGET_FILE})") if(NOT EXISTS ${TARGET_FILE}) @@ -25,6 +39,36 @@ function(download_source dep) SHOW_PROGRESS ) endif() + if(EXISTS ${TARGET_FILE}) + # Sometimes the download fails, but that is not a + # fail condition for "file(DOWNLOAD" it will warn about + # a crc mismatch and just carry on, we need to explicitly + # catch this and remove the bogus 0 byte file so we can + # retry without having to go find the file and manually + # delete it. + file (SIZE ${TARGET_FILE} TARGET_SIZE) + if(${TARGET_SIZE} EQUAL 0) + file(REMOVE ${TARGET_FILE}) + message(FATAL_ERROR "for ${TARGET_FILE} file size 0, download likely failed, deleted...") + endif() + + # If we are using sources from the blender repo also + # validate that the hashes match, this takes a + # little more time, but protects us when we are + # building a release package and one of the packages + # is missing or incorrect. + # + # For regular platform maintenaince this is not needed + # since the actual build of the dep will notify the + # platform maintainer if there is a problem with the + # source package and refuse to build. + if(NOT PACKAGE_USE_UPSTREAM_SOURCES) + file(${TARGET_HASH_TYPE} ${TARGET_FILE} LOCAL_HASH) + if(NOT ${TARGET_HASH} STREQUAL ${LOCAL_HASH}) + message(FATAL_ERROR "${TARGET_FILE} ${TARGET_HASH_TYPE} mismatch\nExpected\t: ${TARGET_HASH}\nActual\t: ${LOCAL_HASH}") + endif() + endif() + endif() endfunction(download_source) download_source(ZLIB) @@ -36,7 +80,7 @@ download_source(BLOSC) download_source(PTHREADS) download_source(OPENEXR) download_source(FREETYPE) -download_source(GLEW) +download_source(EPOXY) download_source(FREEGLUT) download_source(ALEMBIC) download_source(OPENSUBDIV) @@ -51,7 +95,6 @@ download_source(OSL) download_source(PYTHON) download_source(TBB) download_source(OPENVDB) -download_source(NANOVDB) download_source(NUMPY) download_source(LAME) download_source(OGG) @@ -89,15 +132,34 @@ download_source(MESA) download_source(NASM) download_source(XR_OPENXR_SDK) download_source(WL_PROTOCOLS) +download_source(WAYLAND) download_source(ISPC) download_source(GMP) download_source(POTRACE) download_source(HARU) download_source(ZSTD) +download_source(SSE2NEON) download_source(FLEX) download_source(BROTLI) download_source(FMT) download_source(ROBINMAP) download_source(IMATH) download_source(PYSTRING) +download_source(OPENPGL) download_source(LEVEL_ZERO) +download_source(DPCPP) +download_source(VCINTRINSICS) +download_source(OPENCLHEADERS) +download_source(ICDLOADER) +download_source(MP11) +download_source(SPIRV_HEADERS) +download_source(IGC) +download_source(IGC_LLVM) +download_source(IGC_OPENCL_CLANG) +download_source(IGC_VCINTRINSICS) +download_source(IGC_SPIRV_HEADERS) +download_source(IGC_SPIRV_TOOLS) +download_source(IGC_SPIRV_TRANSLATOR) +download_source(GMMLIB) +download_source(OCLOC) +download_source(AOM) diff --git a/build_files/build_environment/cmake/dpcpp.cmake b/build_files/build_environment/cmake/dpcpp.cmake new file mode 100644 index 00000000000..dbba97b8264 --- /dev/null +++ b/build_files/build_environment/cmake/dpcpp.cmake @@ -0,0 +1,109 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + + +if(WIN32) + set(LLVM_GENERATOR "Ninja") +else() + set(LLVM_GENERATOR "Unix Makefiles") +endif() + +set(DPCPP_CONFIGURE_ARGS + # When external deps dpcpp needs are not found it will automatically + # download the during the configure stage using FetchContent. Given + # we need to keep an archive of all source used during build for compliance + # reasons it CANNOT download anything we do not know about. By setting + # this property to ON, all downloads are disabled, and we will have to + # provide the missing deps some other way, a build error beats a compliance + # violation + --cmake-opt FETCHCONTENT_FULLY_DISCONNECTED=ON +) +set(DPCPP_SOURCE_ROOT ${BUILD_DIR}/dpcpp/src/external_dpcpp/) +set(DPCPP_EXTRA_ARGS + # When external deps dpcpp needs are not found it will automatically + # download the during the configure stage using FetchContent. Given + # we need to keep an archive of all source used during build for compliance + # reasons it CANNOT download anything we do not know about. By setting + # this property to ON, all downloads are disabled, and we will have to + # provide the missing deps some other way, a build or configure error + # beats a compliance violation + -DFETCHCONTENT_FULLY_DISCONNECTED=ON + -DLLVMGenXIntrinsics_SOURCE_DIR=${BUILD_DIR}/vcintrinsics/src/external_vcintrinsics/ + -DOpenCL_HEADERS=file://${PACKAGE_DIR}/${OPENCLHEADERS_FILE} + -DOpenCL_LIBRARY_SRC=file://${PACKAGE_DIR}/${ICDLOADER_FILE} + -DBOOST_MP11_SOURCE_DIR=${BUILD_DIR}/mp11/src/external_mp11/ + -DLEVEL_ZERO_LIBRARY=${LIBDIR}/level-zero/lib/${LIBPREFIX}ze_loader${SHAREDLIBEXT} + -DLEVEL_ZERO_INCLUDE_DIR=${LIBDIR}/level-zero/include + -DLLVM_EXTERNAL_SPIRV_HEADERS_SOURCE_DIR=${BUILD_DIR}/spirvheaders/src/external_spirvheaders/ + # Below here is copied from an invocation of buildbot/config.py + -DLLVM_ENABLE_ASSERTIONS=ON + -DLLVM_TARGETS_TO_BUILD=X86 + -DLLVM_EXTERNAL_PROJECTS=sycl^^llvm-spirv^^opencl^^libdevice^^xpti^^xptifw + -DLLVM_EXTERNAL_SYCL_SOURCE_DIR=${DPCPP_SOURCE_ROOT}/sycl + -DLLVM_EXTERNAL_LLVM_SPIRV_SOURCE_DIR=${DPCPP_SOURCE_ROOT}/llvm-spirv + -DLLVM_EXTERNAL_XPTI_SOURCE_DIR=${DPCPP_SOURCE_ROOT}/xpti + -DXPTI_SOURCE_DIR=${DPCPP_SOURCE_ROOT}/xpti + -DLLVM_EXTERNAL_XPTIFW_SOURCE_DIR=${DPCPP_SOURCE_ROOT}/xptifw + -DLLVM_EXTERNAL_LIBDEVICE_SOURCE_DIR=${DPCPP_SOURCE_ROOT}/libdevice + -DLLVM_ENABLE_PROJECTS=clang^^sycl^^llvm-spirv^^opencl^^libdevice^^xpti^^xptifw + -DLIBCLC_TARGETS_TO_BUILD= + -DLIBCLC_GENERATE_REMANGLED_VARIANTS=OFF + -DSYCL_BUILD_PI_HIP_PLATFORM=AMD + -DLLVM_BUILD_TOOLS=ON + -DSYCL_ENABLE_WERROR=OFF + -DSYCL_INCLUDE_TESTS=ON + -DLLVM_ENABLE_DOXYGEN=OFF + -DLLVM_ENABLE_SPHINX=OFF + -DBUILD_SHARED_LIBS=OFF + -DSYCL_ENABLE_XPTI_TRACING=ON + -DLLVM_ENABLE_LLD=OFF + -DXPTI_ENABLE_WERROR=OFF + -DSYCL_CLANG_EXTRA_FLAGS= + -DSYCL_ENABLE_PLUGINS=level_zero + -DCMAKE_INSTALL_RPATH=\$ORIGIN + -DPython3_ROOT_DIR=${LIBDIR}/python/ + -DPython3_EXECUTABLE=${PYTHON_BINARY} + -DPYTHON_EXECUTABLE=${PYTHON_BINARY} + -DLLDB_ENABLE_CURSES=OFF + -DLLVM_ENABLE_TERMINFO=OFF +) + +if(WIN32) + list(APPEND DPCPP_EXTRA_ARGS -DPython3_FIND_REGISTRY=NEVER) +endif() + +ExternalProject_Add(external_dpcpp + URL file://${PACKAGE_DIR}/${DPCPP_FILE} + DOWNLOAD_DIR ${DOWNLOAD_DIR} + URL_HASH ${DPCPP_HASH_TYPE}=${DPCPP_HASH} + PREFIX ${BUILD_DIR}/dpcpp + CMAKE_GENERATOR ${LLVM_GENERATOR} + SOURCE_SUBDIR llvm + LIST_SEPARATOR ^^ + CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/dpcpp ${DEFAULT_CMAKE_FLAGS} ${DPCPP_EXTRA_ARGS} + #CONFIGURE_COMMAND ${PYTHON_BINARY} ${BUILD_DIR}/dpcpp/src/external_dpcpp/buildbot/configure.py ${DPCPP_CONFIGURE_ARGS} + #BUILD_COMMAND echo "." #${PYTHON_BINARY} ${BUILD_DIR}/dpcpp/src/external_dpcpp/buildbot/compile.py + INSTALL_COMMAND ${CMAKE_COMMAND} --build . -- deploy-sycl-toolchain + PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/dpcpp/src/external_dpcpp < ${PATCH_DIR}/dpcpp.diff + INSTALL_DIR ${LIBDIR}/dpcpp +) + +add_dependencies( + external_dpcpp + external_python + external_python_site_packages + external_vcintrinsics + external_openclheaders + external_icdloader + external_mp11 + external_level-zero + external_spirvheaders +) + +if(BUILD_MODE STREQUAL Release AND WIN32) + ExternalProject_Add_Step(external_dpcpp after_install + COMMAND ${CMAKE_COMMAND} -E rm -f ${LIBDIR}/dpcpp/bin/clang-cl.exe + COMMAND ${CMAKE_COMMAND} -E rm -f ${LIBDIR}/dpcpp/bin/clang-cpp.exe + COMMAND ${CMAKE_COMMAND} -E rm -f ${LIBDIR}/dpcpp/bin/clang.exe + COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/dpcpp ${HARVEST_TARGET}/dpcpp + ) +endif() diff --git a/build_files/build_environment/cmake/dpcpp_deps.cmake b/build_files/build_environment/cmake/dpcpp_deps.cmake new file mode 100644 index 00000000000..e66006993f6 --- /dev/null +++ b/build_files/build_environment/cmake/dpcpp_deps.cmake @@ -0,0 +1,61 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + +# These are build time requirements for dpcpp +# We only have to unpack these dpcpp will build +# them. + +ExternalProject_Add(external_vcintrinsics + URL file://${PACKAGE_DIR}/${VCINTRINSICS_FILE} + URL_HASH ${VCINTRINSICS_HASH_TYPE}=${VCINTRINSICS_HASH} + DOWNLOAD_DIR ${DOWNLOAD_DIR} + PREFIX ${BUILD_DIR}/vcintrinsics + CONFIGURE_COMMAND echo . + BUILD_COMMAND echo . + INSTALL_COMMAND echo . +) + +# opencl headers do not have to be unpacked, dpcpp will do it +# but it wouldn't hurt to do it anyway as an opertunity to validate +# the hash is correct. +ExternalProject_Add(external_openclheaders + URL file://${PACKAGE_DIR}/${OPENCLHEADERS_FILE} + URL_HASH ${OPENCLHEADERS_HASH_TYPE}=${OPENCLHEADERS_HASH} + DOWNLOAD_DIR ${DOWNLOAD_DIR} + PREFIX ${BUILD_DIR}/openclheaders + CONFIGURE_COMMAND echo . + BUILD_COMMAND echo . + INSTALL_COMMAND echo . +) + +# icdloader does not have to be unpacked, dpcpp will do it +# but it wouldn't hurt to do it anyway as an opertunity to validate +# the hash is correct. +ExternalProject_Add(external_icdloader + URL file://${PACKAGE_DIR}/${ICDLOADER_FILE} + URL_HASH ${ICDLOADER_HASH_TYPE}=${ICDLOADER_HASH} + DOWNLOAD_DIR ${DOWNLOAD_DIR} + PREFIX ${BUILD_DIR}/icdloader + CONFIGURE_COMMAND echo . + BUILD_COMMAND echo . + INSTALL_COMMAND echo . +) + +ExternalProject_Add(external_mp11 + URL file://${PACKAGE_DIR}/${MP11_FILE} + URL_HASH ${MP11_HASH_TYPE}=${MP11_HASH} + DOWNLOAD_DIR ${DOWNLOAD_DIR} + PREFIX ${BUILD_DIR}/mp11 + CONFIGURE_COMMAND echo . + BUILD_COMMAND echo . + INSTALL_COMMAND echo . +) + +ExternalProject_Add(external_spirvheaders + URL file://${PACKAGE_DIR}/${SPIRV_HEADERS_FILE} + URL_HASH ${SPIRV_HEADERS_HASH_TYPE}=${SPIRV_HEADERS_HASH} + DOWNLOAD_DIR ${DOWNLOAD_DIR} + PREFIX ${BUILD_DIR}/spirvheaders + CONFIGURE_COMMAND echo . + BUILD_COMMAND echo . + INSTALL_COMMAND echo . +) diff --git a/build_files/build_environment/cmake/embree.cmake b/build_files/build_environment/cmake/embree.cmake index 2eafc729111..8c689cf000b 100644 --- a/build_files/build_environment/cmake/embree.cmake +++ b/build_files/build_environment/cmake/embree.cmake @@ -10,18 +10,12 @@ set(EMBREE_EXTRA_ARGS -DEMBREE_RAY_MASK=ON -DEMBREE_FILTER_FUNCTION=ON -DEMBREE_BACKFACE_CULLING=OFF - -DEMBREE_MAX_ISA=AVX2 -DEMBREE_TASKING_SYSTEM=TBB -DEMBREE_TBB_ROOT=${LIBDIR}/tbb -DTBB_ROOT=${LIBDIR}/tbb - -DTBB_STATIC_LIB=${TBB_STATIC_LIBRARY} ) -if(BLENDER_PLATFORM_ARM) - set(EMBREE_EXTRA_ARGS - ${EMBREE_EXTRA_ARGS} - -DEMBREE_MAX_ISA=NEON) -else() +if (NOT BLENDER_PLATFORM_ARM) set(EMBREE_EXTRA_ARGS ${EMBREE_EXTRA_ARGS} -DEMBREE_MAX_ISA=AVX2) @@ -30,23 +24,10 @@ endif() if(TBB_STATIC_LIBRARY) set(EMBREE_EXTRA_ARGS ${EMBREE_EXTRA_ARGS} - -DEMBREE_TBB_LIBRARY_NAME=tbb_static - -DEMBREE_TBBMALLOC_LIBRARY_NAME=tbbmalloc_static + -DEMBREE_TBB_COMPONENT=tbb_static ) endif() -if(WIN32) - set(EMBREE_BUILD_DIR ${BUILD_MODE}/) - if(BUILD_MODE STREQUAL Debug) - list(APPEND EMBREE_EXTRA_ARGS - -DEMBREE_TBBMALLOC_LIBRARY_NAME=tbbmalloc_debug - -DEMBREE_TBB_LIBRARY_NAME=tbb_debug - ) - endif() -else() - set(EMBREE_BUILD_DIR) -endif() - ExternalProject_Add(external_embree URL file://${PACKAGE_DIR}/${EMBREE_FILE} DOWNLOAD_DIR ${DOWNLOAD_DIR} diff --git a/build_files/build_environment/cmake/epoxy.cmake b/build_files/build_environment/cmake/epoxy.cmake new file mode 100644 index 00000000000..4cd9158f2ac --- /dev/null +++ b/build_files/build_environment/cmake/epoxy.cmake @@ -0,0 +1,25 @@ +# SPDX-License-Identifier: GPL-2.0-or-later +if(WIN32) + set(EPOXY_LIB_TYPE shared) +else() + set(EPOXY_LIB_TYPE static) +endif() +ExternalProject_Add(external_epoxy + URL file://${PACKAGE_DIR}/${EPOXY_FILE} + DOWNLOAD_DIR ${DOWNLOAD_DIR} + URL_HASH ${EPOXY_HASH_TYPE}=${EPOXY_HASH} + PREFIX ${BUILD_DIR}/epoxy + PATCH_COMMAND ${PATCH_CMD} -p 1 -N -d ${BUILD_DIR}/epoxy/src/external_epoxy/ < ${PATCH_DIR}/epoxy.diff + CONFIGURE_COMMAND ${CONFIGURE_ENV} && meson setup --prefix ${LIBDIR}/epoxy --default-library ${EPOXY_LIB_TYPE} --libdir lib ${BUILD_DIR}/epoxy/src/external_epoxy-build ${BUILD_DIR}/epoxy/src/external_epoxy -Dtests=false + BUILD_COMMAND ninja + INSTALL_COMMAND ninja install +) + +if(BUILD_MODE STREQUAL Release AND WIN32) + ExternalProject_Add_Step(external_epoxy after_install + COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/epoxy/include ${HARVEST_TARGET}/epoxy/include + COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/epoxy/bin/epoxy-0.dll ${HARVEST_TARGET}/epoxy/bin/epoxy-0.dll + COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/epoxy/lib/epoxy.lib ${HARVEST_TARGET}/epoxy/lib/epoxy.lib + DEPENDEES install + ) +endif() diff --git a/build_files/build_environment/cmake/ffmpeg.cmake b/build_files/build_environment/cmake/ffmpeg.cmake index 4cf96ee2fcb..7730607c514 100644 --- a/build_files/build_environment/cmake/ffmpeg.cmake +++ b/build_files/build_environment/cmake/ffmpeg.cmake @@ -1,9 +1,9 @@ # SPDX-License-Identifier: GPL-2.0-or-later -set(FFMPEG_CFLAGS "-I${mingw_LIBDIR}/lame/include -I${mingw_LIBDIR}/openjpeg/include/ -I${mingw_LIBDIR}/ogg/include -I${mingw_LIBDIR}/vorbis/include -I${mingw_LIBDIR}/theora/include -I${mingw_LIBDIR}/opus/include -I${mingw_LIBDIR}/vpx/include -I${mingw_LIBDIR}/x264/include -I${mingw_LIBDIR}/xvidcore/include -I${mingw_LIBDIR}/zlib/include") -set(FFMPEG_LDFLAGS "-L${mingw_LIBDIR}/lame/lib -L${mingw_LIBDIR}/openjpeg/lib -L${mingw_LIBDIR}/ogg/lib -L${mingw_LIBDIR}/vorbis/lib -L${mingw_LIBDIR}/theora/lib -L${mingw_LIBDIR}/opus/lib -L${mingw_LIBDIR}/vpx/lib -L${mingw_LIBDIR}/x264/lib -L${mingw_LIBDIR}/xvidcore/lib -L${mingw_LIBDIR}/zlib/lib") +set(FFMPEG_CFLAGS "-I${mingw_LIBDIR}/lame/include -I${mingw_LIBDIR}/openjpeg/include/ -I${mingw_LIBDIR}/ogg/include -I${mingw_LIBDIR}/vorbis/include -I${mingw_LIBDIR}/theora/include -I${mingw_LIBDIR}/opus/include -I${mingw_LIBDIR}/vpx/include -I${mingw_LIBDIR}/x264/include -I${mingw_LIBDIR}/xvidcore/include -I${mingw_LIBDIR}/zlib/include -I${mingw_LIBDIR}/aom/include") +set(FFMPEG_LDFLAGS "-L${mingw_LIBDIR}/lame/lib -L${mingw_LIBDIR}/openjpeg/lib -L${mingw_LIBDIR}/ogg/lib -L${mingw_LIBDIR}/vorbis/lib -L${mingw_LIBDIR}/theora/lib -L${mingw_LIBDIR}/opus/lib -L${mingw_LIBDIR}/vpx/lib -L${mingw_LIBDIR}/x264/lib -L${mingw_LIBDIR}/xvidcore/lib -L${mingw_LIBDIR}/zlib/lib -L${mingw_LIBDIR}/aom/lib") set(FFMPEG_EXTRA_FLAGS --pkg-config-flags=--static --extra-cflags=${FFMPEG_CFLAGS} --extra-ldflags=${FFMPEG_LDFLAGS}) -set(FFMPEG_ENV PKG_CONFIG_PATH=${mingw_LIBDIR}/openjpeg/lib/pkgconfig:${mingw_LIBDIR}/x264/lib/pkgconfig:${mingw_LIBDIR}/vorbis/lib/pkgconfig:${mingw_LIBDIR}/ogg/lib/pkgconfig:${mingw_LIBDIR}:${mingw_LIBDIR}/vpx/lib/pkgconfig:${mingw_LIBDIR}/theora/lib/pkgconfig:${mingw_LIBDIR}/openjpeg/lib/pkgconfig:${mingw_LIBDIR}/opus/lib/pkgconfig:) +set(FFMPEG_ENV PKG_CONFIG_PATH=${mingw_LIBDIR}/openjpeg/lib/pkgconfig:${mingw_LIBDIR}/x264/lib/pkgconfig:${mingw_LIBDIR}/vorbis/lib/pkgconfig:${mingw_LIBDIR}/ogg/lib/pkgconfig:${mingw_LIBDIR}:${mingw_LIBDIR}/vpx/lib/pkgconfig:${mingw_LIBDIR}/theora/lib/pkgconfig:${mingw_LIBDIR}/openjpeg/lib/pkgconfig:${mingw_LIBDIR}/opus/lib/pkgconfig:${mingw_LIBDIR}/aom/lib/pkgconfig:) if(WIN32) set(FFMPEG_ENV set ${FFMPEG_ENV} &&) @@ -79,6 +79,7 @@ ExternalProject_Add(external_ffmpeg --disable-librtmp --enable-libx264 --enable-libxvid + --enable-libaom --disable-libopencore-amrnb --disable-libopencore-amrwb --disable-libdc1394 @@ -125,6 +126,7 @@ add_dependencies( external_vorbis external_ogg external_lame + external_aom ) if(WIN32) add_dependencies( diff --git a/build_files/build_environment/cmake/glew.cmake b/build_files/build_environment/cmake/glew.cmake deleted file mode 100644 index 0745ad01533..00000000000 --- a/build_files/build_environment/cmake/glew.cmake +++ /dev/null @@ -1,16 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0-or-later - -set(GLEW_EXTRA_ARGS - -DBUILD_UTILS=Off - -DBUILD_SHARED_LIBS=Off -) - -ExternalProject_Add(external_glew - URL file://${PACKAGE_DIR}/${GLEW_FILE} - DOWNLOAD_DIR ${DOWNLOAD_DIR} - URL_HASH ${GLEW_HASH_TYPE}=${GLEW_HASH} - PATCH_COMMAND COMMAND ${CMAKE_COMMAND} -E copy ${PATCH_DIR}/cmakelists_glew.txt ${BUILD_DIR}/glew/src/external_glew/CMakeLists.txt - PREFIX ${BUILD_DIR}/glew - CMAKE_ARGS -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_INSTALL_PREFIX=${LIBDIR}/glew ${DEFAULT_CMAKE_FLAGS} ${GLEW_EXTRA_ARGS} - INSTALL_DIR ${LIBDIR}/glew -) diff --git a/build_files/build_environment/cmake/gmmlib.cmake b/build_files/build_environment/cmake/gmmlib.cmake new file mode 100644 index 00000000000..c46f5c8943d --- /dev/null +++ b/build_files/build_environment/cmake/gmmlib.cmake @@ -0,0 +1,13 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + +set(GMMLIB_EXTRA_ARGS +) + +ExternalProject_Add(external_gmmlib + URL file://${PACKAGE_DIR}/${GMMLIB_FILE} + URL_HASH ${GMMLIB_HASH_TYPE}=${GMMLIB_HASH} + DOWNLOAD_DIR ${DOWNLOAD_DIR} + PREFIX ${BUILD_DIR}/gmmlib + CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/gmmlib ${DEFAULT_CMAKE_FLAGS} ${GMMLIB_EXTRA_ARGS} + INSTALL_DIR ${LIBDIR}/gmmlib +) diff --git a/build_files/build_environment/cmake/harvest.cmake b/build_files/build_environment/cmake/harvest.cmake index aeaa6fbd2b5..6c920e651fe 100644 --- a/build_files/build_environment/cmake/harvest.cmake +++ b/build_files/build_environment/cmake/harvest.cmake @@ -11,187 +11,192 @@ message("HARVEST_TARGET = ${HARVEST_TARGET}") if(WIN32) -if(BUILD_MODE STREQUAL Release) - add_custom_target(Harvest_Release_Results - COMMAND # jpeg rename libfile + copy include - ${CMAKE_COMMAND} -E copy ${LIBDIR}/jpeg/lib/jpeg-static.lib ${HARVEST_TARGET}/jpeg/lib/libjpeg.lib && - ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/jpeg/include/ ${HARVEST_TARGET}/jpeg/include/ && - # png - ${CMAKE_COMMAND} -E copy ${LIBDIR}/png/lib/libpng16_static.lib ${HARVEST_TARGET}/png/lib/libpng.lib && - ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/png/include/ ${HARVEST_TARGET}/png/include/ && - # freeglut-> opengl - ${CMAKE_COMMAND} -E copy ${LIBDIR}/freeglut/lib/freeglut_static.lib ${HARVEST_TARGET}/opengl/lib/freeglut_static.lib && - ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/freeglut/include/ ${HARVEST_TARGET}/opengl/include/ && - # glew-> opengl - ${CMAKE_COMMAND} -E copy ${LIBDIR}/glew/lib/libglew32.lib ${HARVEST_TARGET}/opengl/lib/glew.lib && - ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/glew/include/ ${HARVEST_TARGET}/opengl/include/ && - # tiff - ${CMAKE_COMMAND} -E copy ${LIBDIR}/tiff/lib/tiff.lib ${HARVEST_TARGET}/tiff/lib/libtiff.lib && - ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/tiff/include/ ${HARVEST_TARGET}/tiff/include/ - DEPENDS - ) -endif() + if(BUILD_MODE STREQUAL Release) + add_custom_target(Harvest_Release_Results + COMMAND # jpeg rename libfile + copy include + ${CMAKE_COMMAND} -E copy ${LIBDIR}/jpeg/lib/jpeg-static.lib ${HARVEST_TARGET}/jpeg/lib/libjpeg.lib && + ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/jpeg/include/ ${HARVEST_TARGET}/jpeg/include/ && + # png + ${CMAKE_COMMAND} -E copy ${LIBDIR}/png/lib/libpng16_static.lib ${HARVEST_TARGET}/png/lib/libpng.lib && + ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/png/include/ ${HARVEST_TARGET}/png/include/ && + # freeglut-> opengl + ${CMAKE_COMMAND} -E copy ${LIBDIR}/freeglut/lib/freeglut_static.lib ${HARVEST_TARGET}/opengl/lib/freeglut_static.lib && + ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/freeglut/include/ ${HARVEST_TARGET}/opengl/include/ && + DEPENDS + ) + endif() -else(WIN32) +else() -function(harvest from to) - set(pattern "") - foreach(f ${ARGN}) - set(pattern ${f}) - endforeach() + function(harvest from to) + set(pattern "") + foreach(f ${ARGN}) + set(pattern ${f}) + endforeach() - if(pattern STREQUAL "") - get_filename_component(dirpath ${to} DIRECTORY) - get_filename_component(filename ${to} NAME) - install( - FILES ${LIBDIR}/${from} - DESTINATION ${HARVEST_TARGET}/${dirpath} - RENAME ${filename}) - else() - install( - DIRECTORY ${LIBDIR}/${from}/ - DESTINATION ${HARVEST_TARGET}/${to} - USE_SOURCE_PERMISSIONS - FILES_MATCHING PATTERN ${pattern} - PATTERN "pkgconfig" EXCLUDE - PATTERN "cmake" EXCLUDE - PATTERN "__pycache__" EXCLUDE - PATTERN "tests" EXCLUDE) + if(pattern STREQUAL "") + get_filename_component(dirpath ${to} DIRECTORY) + get_filename_component(filename ${to} NAME) + install( + FILES ${LIBDIR}/${from} + DESTINATION ${HARVEST_TARGET}/${dirpath} + RENAME ${filename} + ) + else() + install( + DIRECTORY ${LIBDIR}/${from}/ + DESTINATION ${HARVEST_TARGET}/${to} + USE_SOURCE_PERMISSIONS + FILES_MATCHING PATTERN ${pattern} + PATTERN "pkgconfig" EXCLUDE + PATTERN "cmake" EXCLUDE + PATTERN "__pycache__" EXCLUDE + PATTERN "tests" EXCLUDE + ) + endif() + endfunction() + + harvest(alembic/include alembic/include "*.h") + harvest(alembic/lib/libAlembic.a alembic/lib/libAlembic.a) + harvest(alembic/bin alembic/bin "*") + harvest(brotli/include brotli/include "*.h") + harvest(brotli/lib brotli/lib "*.a") + harvest(boost/include boost/include "*") + harvest(boost/lib boost/lib "*.a") + harvest(imath/include imath/include "*.h") + harvest(imath/lib imath/lib "*.a") + harvest(ffmpeg/include ffmpeg/include "*.h") + harvest(ffmpeg/lib ffmpeg/lib "*.a") + harvest(fftw3/include fftw3/include "*.h") + harvest(fftw3/lib fftw3/lib "*.a") + harvest(flac/lib sndfile/lib "libFLAC.a") + harvest(freetype/include freetype/include "*.h") + harvest(freetype/lib/libfreetype2ST.a freetype/lib/libfreetype.a) + harvest(epoxy/include epoxy/include "*.h") + harvest(epoxy/lib epoxy/lib "*.a") + harvest(gmp/include gmp/include "*.h") + harvest(gmp/lib gmp/lib "*.a") + harvest(jemalloc/include jemalloc/include "*.h") + harvest(jemalloc/lib jemalloc/lib "*.a") + harvest(jpeg/include jpeg/include "*.h") + harvest(jpeg/lib jpeg/lib "libjpeg.a") + harvest(lame/lib ffmpeg/lib "*.a") + if(NOT APPLE) + harvest(level-zero/include/level_zero level-zero/include/level_zero "*.h") + harvest(level-zero/lib level-zero/lib "*.so*") endif() -endfunction() + harvest(llvm/bin llvm/bin "clang-format") + if(BUILD_CLANG_TOOLS) + harvest(llvm/bin llvm/bin "clang-tidy") + harvest(llvm/share/clang llvm/share "run-clang-tidy.py") + endif() + harvest(llvm/include llvm/include "*") + harvest(llvm/bin llvm/bin "llvm-config") + harvest(llvm/lib llvm/lib "libLLVM*.a") + harvest(llvm/lib llvm/lib "libclang*.a") + harvest(llvm/lib/clang llvm/lib/clang "*.h") + if(APPLE) + harvest(openmp/lib openmp/lib "*") + harvest(openmp/include openmp/include "*.h") + endif() + if(BLENDER_PLATFORM_ARM) + harvest(sse2neon sse2neon "*.h") + endif() + harvest(ogg/lib ffmpeg/lib "*.a") + harvest(openal/include openal/include "*.h") + if(UNIX AND NOT APPLE) + harvest(openal/lib openal/lib "*.a") -harvest(alembic/include alembic/include "*.h") -harvest(alembic/lib/libAlembic.a alembic/lib/libAlembic.a) -harvest(alembic/bin alembic/bin "*") -harvest(brotli/include brotli/include "*.h") -harvest(brotli/lib brotli/lib "*.a") -harvest(boost/include boost/include "*") -harvest(boost/lib boost/lib "*.a") -harvest(imath/include imath/include "*.h") -harvest(imath/lib imath/lib "*.a") -harvest(ffmpeg/include ffmpeg/include "*.h") -harvest(ffmpeg/lib ffmpeg/lib "*.a") -harvest(fftw3/include fftw3/include "*.h") -harvest(fftw3/lib fftw3/lib "*.a") -harvest(flac/lib sndfile/lib "libFLAC.a") -harvest(freetype/include freetype/include "*.h") -harvest(freetype/lib/libfreetype2ST.a freetype/lib/libfreetype.a) -harvest(glew/include glew/include "*.h") -harvest(glew/lib glew/lib "*.a") -harvest(gmp/include gmp/include "*.h") -harvest(gmp/lib gmp/lib "*.a") -harvest(jemalloc/include jemalloc/include "*.h") -harvest(jemalloc/lib jemalloc/lib "*.a") -harvest(jpeg/include jpeg/include "*.h") -harvest(jpeg/lib jpeg/lib "libjpeg.a") -harvest(lame/lib ffmpeg/lib "*.a") -if(NOT APPLE) - harvest(level-zero/include/level_zero level-zero/include/level_zero "*.h") - harvest(level-zero/lib level-zero/lib "*.so*") -endif() -harvest(llvm/bin llvm/bin "clang-format") -if(BUILD_CLANG_TOOLS) - harvest(llvm/bin llvm/bin "clang-tidy") - harvest(llvm/share/clang llvm/share "run-clang-tidy.py") -endif() -harvest(llvm/include llvm/include "*") -harvest(llvm/bin llvm/bin "llvm-config") -harvest(llvm/lib llvm/lib "libLLVM*.a") -harvest(llvm/lib llvm/lib "libclang*.a") -harvest(llvm/lib/clang llvm/lib/clang "*.h") -if(APPLE) - harvest(openmp/lib openmp/lib "*") - harvest(openmp/include openmp/include "*.h") -endif() -if(BLENDER_PLATFORM_ARM) - harvest(sse2neon sse2neon "*.h") -endif() -harvest(ogg/lib ffmpeg/lib "*.a") -harvest(openal/include openal/include "*.h") -if(UNIX AND NOT APPLE) - harvest(openal/lib openal/lib "*.a") + harvest(blosc/include blosc/include "*.h") + harvest(blosc/lib blosc/lib "*.a") - harvest(blosc/include blosc/include "*.h") - harvest(blosc/lib blosc/lib "*.a") + harvest(zlib/include zlib/include "*.h") + harvest(zlib/lib zlib/lib "*.a") - harvest(zlib/include zlib/include "*.h") - harvest(zlib/lib zlib/lib "*.a") + harvest(xml2/include xml2/include "*.h") + harvest(xml2/lib xml2/lib "*.a") - harvest(xml2/include xml2/include "*.h") - harvest(xml2/lib xml2/lib "*.a") + harvest(wayland-protocols/share/wayland-protocols wayland-protocols/share/wayland-protocols/ "*.xml") + harvest(wayland/bin wayland/bin "wayland-scanner") + else() + harvest(blosc/lib openvdb/lib "*.a") + harvest(xml2/lib opencollada/lib "*.a") + endif() + harvest(opencollada/include/opencollada opencollada/include "*.h") + harvest(opencollada/lib/opencollada opencollada/lib "*.a") + harvest(opencolorio/include opencolorio/include "*.h") + harvest(opencolorio/lib opencolorio/lib "*.a") + harvest(opencolorio/lib/static opencolorio/lib "*.a") + harvest(openexr/include openexr/include "*.h") + harvest(openexr/lib openexr/lib "*.a") + harvest(openimageio/bin openimageio/bin "idiff") + harvest(openimageio/bin openimageio/bin "maketx") + harvest(openimageio/bin openimageio/bin "oiiotool") + harvest(openimageio/include openimageio/include "*") + harvest(openimageio/lib openimageio/lib "*.a") + harvest(openimagedenoise/include openimagedenoise/include "*") + harvest(openimagedenoise/lib openimagedenoise/lib "*.a") + harvest(embree/include embree/include "*.h") + harvest(embree/lib embree/lib "*.a") + harvest(openpgl/include openpgl/include "*.h") + harvest(openpgl/lib openpgl/lib "*.a") + harvest(openpgl/lib/cmake/openpgl-${OPENPGL_SHORT_VERSION} openpgl/lib/cmake/openpgl "*.cmake") + harvest(openjpeg/include/openjpeg-${OPENJPEG_SHORT_VERSION} openjpeg/include "*.h") + harvest(openjpeg/lib openjpeg/lib "*.a") + harvest(opensubdiv/include opensubdiv/include "*.h") + harvest(opensubdiv/lib opensubdiv/lib "*.a") + harvest(openvdb/include/openvdb openvdb/include/openvdb "*.h") + harvest(openvdb/include/nanovdb openvdb/include/nanovdb "*.h") + harvest(openvdb/lib openvdb/lib "*.a") + harvest(xr_openxr_sdk/include/openxr xr_openxr_sdk/include/openxr "*.h") + harvest(xr_openxr_sdk/lib xr_openxr_sdk/lib "*.a") + harvest(osl/bin osl/bin "oslc") + harvest(osl/include osl/include "*.h") + harvest(osl/lib osl/lib "*.a") + harvest(osl/share/OSL/shaders osl/share/OSL/shaders "*.h") + harvest(png/include png/include "*.h") + harvest(png/lib png/lib "*.a") + harvest(pugixml/include pugixml/include "*.hpp") + harvest(pugixml/lib pugixml/lib "*.a") + harvest(python/bin python/bin "python${PYTHON_SHORT_VERSION}") + harvest(python/include python/include "*h") + harvest(python/lib python/lib "*") + harvest(sdl/include/SDL2 sdl/include "*.h") + harvest(sdl/lib sdl/lib "libSDL2.a") + harvest(sndfile/include sndfile/include "*.h") + harvest(sndfile/lib sndfile/lib "*.a") + harvest(spnav/include spnav/include "*.h") + harvest(spnav/lib spnav/lib "*.a") + harvest(tbb/include tbb/include "*.h") + harvest(tbb/lib/libtbb_static.a tbb/lib/libtbb.a) + harvest(theora/lib ffmpeg/lib "*.a") + harvest(tiff/include tiff/include "*.h") + harvest(tiff/lib tiff/lib "*.a") + harvest(vorbis/lib ffmpeg/lib "*.a") + harvest(opus/lib ffmpeg/lib "*.a") + harvest(vpx/lib ffmpeg/lib "*.a") + harvest(x264/lib ffmpeg/lib "*.a") + harvest(xvidcore/lib ffmpeg/lib "*.a") + harvest(aom/lib ffmpeg/lib "*.a") + harvest(webp/lib webp/lib "*.a") + harvest(webp/include webp/include "*.h") + harvest(usd/include usd/include "*.h") + harvest(usd/lib/usd usd/lib/usd "*") + harvest(usd/plugin usd/plugin "*") + harvest(potrace/include potrace/include "*.h") + harvest(potrace/lib potrace/lib "*.a") + harvest(haru/include haru/include "*.h") + harvest(haru/lib haru/lib "*.a") + harvest(zstd/include zstd/include "*.h") + harvest(zstd/lib zstd/lib "*.a") - harvest(wayland-protocols/share/wayland-protocols wayland-protocols/share/wayland-protocols/ "*.xml") -else() - harvest(blosc/lib openvdb/lib "*.a") - harvest(xml2/lib opencollada/lib "*.a") -endif() -harvest(opencollada/include/opencollada opencollada/include "*.h") -harvest(opencollada/lib/opencollada opencollada/lib "*.a") -harvest(opencolorio/include opencolorio/include "*.h") -harvest(opencolorio/lib opencolorio/lib "*.a") -harvest(opencolorio/lib/static opencolorio/lib "*.a") -harvest(openexr/include openexr/include "*.h") -harvest(openexr/lib openexr/lib "*.a") -harvest(openimageio/bin openimageio/bin "idiff") -harvest(openimageio/bin openimageio/bin "maketx") -harvest(openimageio/bin openimageio/bin "oiiotool") -harvest(openimageio/include openimageio/include "*") -harvest(openimageio/lib openimageio/lib "*.a") -harvest(openimagedenoise/include openimagedenoise/include "*") -harvest(openimagedenoise/lib openimagedenoise/lib "*.a") -harvest(embree/include embree/include "*.h") -harvest(embree/lib embree/lib "*.a") -harvest(openjpeg/include/openjpeg-${OPENJPEG_SHORT_VERSION} openjpeg/include "*.h") -harvest(openjpeg/lib openjpeg/lib "*.a") -harvest(opensubdiv/include opensubdiv/include "*.h") -harvest(opensubdiv/lib opensubdiv/lib "*.a") -harvest(openvdb/include/openvdb openvdb/include/openvdb "*.h") -harvest(openvdb/include/nanovdb openvdb/include/nanovdb "*.h") -harvest(openvdb/lib openvdb/lib "*.a") -harvest(xr_openxr_sdk/include/openxr xr_openxr_sdk/include/openxr "*.h") -harvest(xr_openxr_sdk/lib xr_openxr_sdk/lib "*.a") -harvest(osl/bin osl/bin "oslc") -harvest(osl/include osl/include "*.h") -harvest(osl/lib osl/lib "*.a") -harvest(osl/share/OSL/shaders osl/share/OSL/shaders "*.h") -harvest(png/include png/include "*.h") -harvest(png/lib png/lib "*.a") -harvest(pugixml/include pugixml/include "*.hpp") -harvest(pugixml/lib pugixml/lib "*.a") -harvest(python/bin python/bin "python${PYTHON_SHORT_VERSION}") -harvest(python/include python/include "*h") -harvest(python/lib python/lib "*") -harvest(sdl/include/SDL2 sdl/include "*.h") -harvest(sdl/lib sdl/lib "libSDL2.a") -harvest(sndfile/include sndfile/include "*.h") -harvest(sndfile/lib sndfile/lib "*.a") -harvest(spnav/include spnav/include "*.h") -harvest(spnav/lib spnav/lib "*.a") -harvest(tbb/include tbb/include "*.h") -harvest(tbb/lib/libtbb_static.a tbb/lib/libtbb.a) -harvest(theora/lib ffmpeg/lib "*.a") -harvest(tiff/include tiff/include "*.h") -harvest(tiff/lib tiff/lib "*.a") -harvest(vorbis/lib ffmpeg/lib "*.a") -harvest(opus/lib ffmpeg/lib "*.a") -harvest(vpx/lib ffmpeg/lib "*.a") -harvest(x264/lib ffmpeg/lib "*.a") -harvest(xvidcore/lib ffmpeg/lib "*.a") -harvest(webp/lib webp/lib "*.a") -harvest(webp/include webp/include "*.h") -harvest(usd/include usd/include "*.h") -harvest(usd/lib/usd usd/lib/usd "*") -harvest(usd/plugin usd/plugin "*") -harvest(potrace/include potrace/include "*.h") -harvest(potrace/lib potrace/lib "*.a") -harvest(haru/include haru/include "*.h") -harvest(haru/lib haru/lib "*.a") -harvest(zstd/include zstd/include "*.h") -harvest(zstd/lib zstd/lib "*.a") + if(UNIX AND NOT APPLE) + harvest(libglu/lib mesa/lib "*.so*") + harvest(mesa/lib64 mesa/lib "*.so*") -if(UNIX AND NOT APPLE) - harvest(libglu/lib mesa/lib "*.so*") - harvest(mesa/lib64 mesa/lib "*.so*") -endif() + harvest(dpcpp dpcpp "*") + harvest(igc dpcpp/lib/igc "*") + harvest(ocloc dpcpp/lib/ocloc "*") + endif() endif() diff --git a/build_files/build_environment/cmake/igc.cmake b/build_files/build_environment/cmake/igc.cmake new file mode 100644 index 00000000000..3b488a77b3f --- /dev/null +++ b/build_files/build_environment/cmake/igc.cmake @@ -0,0 +1,126 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + +unpack_only(igc_vcintrinsics) +unpack_only(igc_spirv_headers) +unpack_only(igc_spirv_tools) + +# +# igc_opencl_clang contains patches that need to be applied +# to external_igc_llvm and igc_spirv_translator, we unpack +# igc_opencl_clang first, then have the patch stages of +# external_igc_llvm and igc_spirv_translator apply them. +# + +ExternalProject_Add(external_igc_opencl_clang + URL file://${PACKAGE_DIR}/${IGC_OPENCL_CLANG_FILE} + DOWNLOAD_DIR ${DOWNLOAD_DIR} + URL_HASH ${IGC_OPENCL_CLANG_HASH_TYPE}=${IGC_OPENCL_CLANG_HASH} + PREFIX ${BUILD_DIR}/igc_opencl_clang + CONFIGURE_COMMAND echo . + BUILD_COMMAND echo . + INSTALL_COMMAND echo . + PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/igc_opencl_clang/src/external_igc_opencl_clang/ < ${PATCH_DIR}/igc_opencl_clang.diff +) + +set(IGC_OPENCL_CLANG_PATCH_DIR ${BUILD_DIR}/igc_opencl_clang/src/external_igc_opencl_clang/patches) +set(IGC_LLVM_SOURCE_DIR ${BUILD_DIR}/igc_llvm/src/external_igc_llvm) +set(IGC_SPIRV_TRANSLATOR_SOURCE_DIR ${BUILD_DIR}/igc_spirv_translator/src/external_igc_spirv_translator) + +ExternalProject_Add(external_igc_llvm + URL file://${PACKAGE_DIR}/${IGC_LLVM_FILE} + DOWNLOAD_DIR ${DOWNLOAD_DIR} + URL_HASH ${IGC_LLVM_HASH_TYPE}=${IGC_LLVM_HASH} + PREFIX ${BUILD_DIR}/igc_llvm + CONFIGURE_COMMAND echo . + BUILD_COMMAND echo . + INSTALL_COMMAND echo . + PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${IGC_LLVM_SOURCE_DIR} < ${IGC_OPENCL_CLANG_PATCH_DIR}/clang/0001-OpenCL-3.0-support.patch && + ${PATCH_CMD} -p 1 -d ${IGC_LLVM_SOURCE_DIR} < ${IGC_OPENCL_CLANG_PATCH_DIR}/clang/0002-Remove-__IMAGE_SUPPORT__-macro-for-SPIR.patch && + ${PATCH_CMD} -p 1 -d ${IGC_LLVM_SOURCE_DIR} < ${IGC_OPENCL_CLANG_PATCH_DIR}/clang/0003-Avoid-calling-ParseCommandLineOptions-in-BackendUtil.patch && + ${PATCH_CMD} -p 1 -d ${IGC_LLVM_SOURCE_DIR} < ${IGC_OPENCL_CLANG_PATCH_DIR}/clang/0004-OpenCL-support-cl_ext_float_atomics.patch && + ${PATCH_CMD} -p 1 -d ${IGC_LLVM_SOURCE_DIR} < ${IGC_OPENCL_CLANG_PATCH_DIR}/clang/0005-OpenCL-Add-cl_khr_integer_dot_product.patch && + ${PATCH_CMD} -p 1 -d ${IGC_LLVM_SOURCE_DIR} < ${IGC_OPENCL_CLANG_PATCH_DIR}/llvm/0001-Memory-leak-fix-for-Managed-Static-Mutex.patch && + ${PATCH_CMD} -p 1 -d ${IGC_LLVM_SOURCE_DIR} < ${IGC_OPENCL_CLANG_PATCH_DIR}/llvm/0002-Remove-repo-name-in-LLVM-IR.patch +) +add_dependencies( + external_igc_llvm + external_igc_opencl_clang +) + +ExternalProject_Add(external_igc_spirv_translator + URL file://${PACKAGE_DIR}/${IGC_SPIRV_TRANSLATOR_FILE} + DOWNLOAD_DIR ${DOWNLOAD_DIR} + URL_HASH ${IGC_SPIRV_TRANSLATOR_HASH_TYPE}=${IGC_SPIRV_TRANSLATOR_HASH} + PREFIX ${BUILD_DIR}/igc_spirv_translator + CONFIGURE_COMMAND echo . + BUILD_COMMAND echo . + INSTALL_COMMAND echo . + PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${IGC_SPIRV_TRANSLATOR_SOURCE_DIR} < ${IGC_OPENCL_CLANG_PATCH_DIR}/spirv/0001-update-SPIR-V-headers-for-SPV_INTEL_split_barrier.patch && + ${PATCH_CMD} -p 1 -d ${IGC_SPIRV_TRANSLATOR_SOURCE_DIR} < ${IGC_OPENCL_CLANG_PATCH_DIR}/spirv/0002-Add-support-for-split-barriers-extension-SPV_INTEL_s.patch && + ${PATCH_CMD} -p 1 -d ${IGC_SPIRV_TRANSLATOR_SOURCE_DIR} < ${IGC_OPENCL_CLANG_PATCH_DIR}/spirv/0003-Support-cl_bf16_conversions.patch +) +add_dependencies( + external_igc_spirv_translator + external_igc_opencl_clang +) + +if(WIN32) + set(IGC_GENERATOR "Ninja") + set(IGC_TARGET Windows64) +else() + set(IGC_GENERATOR "Unix Makefiles") + set(IGC_TARGET Linux64) +endif() + +set(IGC_EXTRA_ARGS + -DIGC_OPTION__ARCHITECTURE_TARGET=${IGC_TARGET} + -DIGC_OPTION__ARCHITECTURE_HOST=${IGC_TARGET} +) + +if(UNIX AND NOT APPLE) + list(APPEND IGC_EXTRA_ARGS + -DFLEX_EXECUTABLE=${LIBDIR}/flex/bin/flex + -DFLEX_INCLUDE_DIR=${LIBDIR}/flex/include + ) +endif() + +ExternalProject_Add(external_igc + URL file://${PACKAGE_DIR}/${IGC_FILE} + DOWNLOAD_DIR ${DOWNLOAD_DIR} + URL_HASH ${IGC_HASH_TYPE}=${IGC_HASH} + CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/igc ${DEFAULT_CMAKE_FLAGS} ${IGC_EXTRA_ARGS} + + # IGC is pretty set in its way where sub projects ought to live, for some it offers + # hooks to supply alternatives folders, other are just hardocded with no way to configure + # we symlink everything here, since it's less work than trying to convince the cmake + # scripts to accept alternative locations. + # + PATCH_COMMAND ${CMAKE_COMMAND} -E create_symlink ${BUILD_DIR}/igc_llvm/src/external_igc_llvm/ ${BUILD_DIR}/igc/src/llvm-project && + ${CMAKE_COMMAND} -E create_symlink ${BUILD_DIR}/igc_opencl_clang/src/external_igc_opencl_clang/ ${BUILD_DIR}/igc/src/llvm-project/llvm/projects/opencl-clang && + ${CMAKE_COMMAND} -E create_symlink ${BUILD_DIR}/igc_spirv_translator/src/external_igc_spirv_translator/ ${BUILD_DIR}/igc/src/llvm-project/llvm/projects/llvm-spirv && + ${CMAKE_COMMAND} -E create_symlink ${BUILD_DIR}/igc_spirv_tools/src/external_igc_spirv_tools/ ${BUILD_DIR}/igc/src/SPIRV-Tools && + ${CMAKE_COMMAND} -E create_symlink ${BUILD_DIR}/igc_spirv_headers/src/external_igc_spirv_headers/ ${BUILD_DIR}/igc/src/SPIRV-Headers && + ${CMAKE_COMMAND} -E create_symlink ${BUILD_DIR}/igc_vcintrinsics/src/external_igc_vcintrinsics/ ${BUILD_DIR}/igc/src/vc-intrinsics + PREFIX ${BUILD_DIR}/igc + INSTALL_DIR ${LIBDIR}/igc + INSTALL_COMMAND ${CMAKE_COMMAND} --install . --strip + CMAKE_GENERATOR ${IGC_GENERATOR} +) + +add_dependencies( + external_igc + external_igc_vcintrinsics + external_igc_llvm + external_igc_opencl_clang + external_igc_vcintrinsics + external_igc_spirv_headers + external_igc_spirv_tools + external_igc_spirv_translator +) + +if(UNIX AND NOT APPLE) + add_dependencies( + external_igc + external_flex + ) +endif() diff --git a/build_files/build_environment/cmake/ispc.cmake b/build_files/build_environment/cmake/ispc.cmake index 160088bc16f..c2dbedca55f 100644 --- a/build_files/build_environment/cmake/ispc.cmake +++ b/build_files/build_environment/cmake/ispc.cmake @@ -6,6 +6,7 @@ if(WIN32) -DBISON_EXECUTABLE=${LIBDIR}/flexbison/win_bison.exe -DM4_EXECUTABLE=${DOWNLOAD_DIR}/mingw/mingw64/msys/1.0/bin/m4.exe -DARM_ENABLED=Off + -DPython3_FIND_REGISTRY=NEVER ) elseif(APPLE) # Use bison and flex installed via Homebrew. @@ -27,7 +28,7 @@ elseif(UNIX) set(ISPC_EXTRA_ARGS_UNIX -DCMAKE_C_COMPILER=${LIBDIR}/llvm/bin/clang -DCMAKE_CXX_COMPILER=${LIBDIR}/llvm/bin/clang++ - -DARM_ENABLED=Off + -DARM_ENABLED=${BLENDER_PLATFORM_ARM} -DFLEX_EXECUTABLE=${LIBDIR}/flex/bin/flex ) endif() @@ -43,6 +44,8 @@ set(ISPC_EXTRA_ARGS -DISPC_INCLUDE_TESTS=Off -DCLANG_LIBRARY_DIR=${LIBDIR}/llvm/lib -DCLANG_INCLUDE_DIRS=${LIBDIR}/llvm/include + -DPython3_ROOT_DIR=${LIBDIR}/python/ + -DPython3_EXECUTABLE=${PYTHON_BINARY} ${ISPC_EXTRA_ARGS_WIN} ${ISPC_EXTRA_ARGS_APPLE} ${ISPC_EXTRA_ARGS_UNIX} @@ -61,6 +64,7 @@ ExternalProject_Add(external_ispc add_dependencies( external_ispc ll + external_python ) if(WIN32) diff --git a/build_files/build_environment/cmake/jpeg.cmake b/build_files/build_environment/cmake/jpeg.cmake index 39388ad466b..118785d859b 100644 --- a/build_files/build_environment/cmake/jpeg.cmake +++ b/build_files/build_environment/cmake/jpeg.cmake @@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0-or-later if(WIN32) - # cmake for windows + # CMAKE for MS-Windows. set(JPEG_EXTRA_ARGS -DNASM=${NASM_PATH} -DWITH_JPEG8=ON @@ -33,8 +33,8 @@ if(WIN32) ) endif() -else(WIN32) - # cmake for unix +else() + # CMAKE for UNIX. set(JPEG_EXTRA_ARGS -DWITH_JPEG8=ON -DENABLE_STATIC=ON diff --git a/build_files/build_environment/cmake/llvm.cmake b/build_files/build_environment/cmake/llvm.cmake index cf92a5175a3..e4ddc7db846 100644 --- a/build_files/build_environment/cmake/llvm.cmake +++ b/build_files/build_environment/cmake/llvm.cmake @@ -25,11 +25,14 @@ set(LLVM_EXTRA_ARGS -DLLVM_BUILD_LLVM_C_DYLIB=OFF -DLLVM_ENABLE_UNWIND_TABLES=OFF -DLLVM_ENABLE_PROJECTS=clang${LLVM_BUILD_CLANG_TOOLS_EXTRA} + -DPython3_ROOT_DIR=${LIBDIR}/python/ + -DPython3_EXECUTABLE=${PYTHON_BINARY} ${LLVM_XML2_ARGS} ) if(WIN32) set(LLVM_GENERATOR "Ninja") + list(APPEND LLVM_EXTRA_ARGS -DPython3_FIND_REGISTRY=NEVER) else() set(LLVM_GENERATOR "Unix Makefiles") endif() @@ -74,3 +77,8 @@ if(APPLE) external_xml2 ) endif() + +add_dependencies( + ll + external_python +) diff --git a/build_files/build_environment/cmake/macros.cmake b/build_files/build_environment/cmake/macros.cmake new file mode 100644 index 00000000000..82fc151a038 --- /dev/null +++ b/build_files/build_environment/cmake/macros.cmake @@ -0,0 +1,18 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + +# shorthand to only unpack a certain dependency +macro(unpack_only name) + string(TOUPPER ${name} UPPER_NAME) + set(TARGET_FILE ${${UPPER_NAME}_FILE}) + set(TARGET_HASH_TYPE ${${UPPER_NAME}_HASH_TYPE}) + set(TARGET_HASH ${${UPPER_NAME}_HASH}) + ExternalProject_Add(external_${name} + URL file://${PACKAGE_DIR}/${TARGET_FILE} + URL_HASH ${TARGET_HASH_TYPE}=${TARGET_HASH} + DOWNLOAD_DIR ${DOWNLOAD_DIR} + PREFIX ${BUILD_DIR}/${name} + CONFIGURE_COMMAND echo . + BUILD_COMMAND echo . + INSTALL_COMMAND echo . + ) +endmacro() diff --git a/build_files/build_environment/cmake/ocloc.cmake b/build_files/build_environment/cmake/ocloc.cmake new file mode 100644 index 00000000000..f686d2dd4fc --- /dev/null +++ b/build_files/build_environment/cmake/ocloc.cmake @@ -0,0 +1,24 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + +set(OCLOC_EXTRA_ARGS + -DNEO_SKIP_UNIT_TESTS=1 + -DNEO_BUILD_WITH_OCL=0 + -DBUILD_WITH_L0=0 + -DIGC_DIR=${LIBDIR}/igc + -DGMM_DIR=${LIBDIR}/gmmlib +) + +ExternalProject_Add(external_ocloc + URL file://${PACKAGE_DIR}/${OCLOC_FILE} + URL_HASH ${OCLOC_HASH_TYPE}=${OCLOC_HASH} + DOWNLOAD_DIR ${DOWNLOAD_DIR} + PREFIX ${BUILD_DIR}/ocloc + CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/ocloc ${DEFAULT_CMAKE_FLAGS} ${OCLOC_EXTRA_ARGS} + INSTALL_DIR ${LIBDIR}/ocloc +) + +add_dependencies( + external_ocloc + external_igc + external_gmmlib +) diff --git a/build_files/build_environment/cmake/openimagedenoise.cmake b/build_files/build_environment/cmake/openimagedenoise.cmake index 3612e91a690..14a730d69b6 100644 --- a/build_files/build_environment/cmake/openimagedenoise.cmake +++ b/build_files/build_environment/cmake/openimagedenoise.cmake @@ -9,6 +9,7 @@ set(OIDN_EXTRA_ARGS -DOIDN_STATIC_RUNTIME=OFF -DISPC_EXECUTABLE=${LIBDIR}/ispc/bin/ispc -DOIDN_FILTER_RTLIGHTMAP=OFF + -DPYTHON_EXECUTABLE=${PYTHON_BINARY} ) if(WIN32) @@ -38,6 +39,7 @@ add_dependencies( external_openimagedenoise external_tbb external_ispc + external_python ) if(WIN32) diff --git a/build_files/build_environment/cmake/openimageio.cmake b/build_files/build_environment/cmake/openimageio.cmake index b7d7ce689a4..26881488039 100644 --- a/build_files/build_environment/cmake/openimageio.cmake +++ b/build_files/build_environment/cmake/openimageio.cmake @@ -18,9 +18,15 @@ if(WIN32) set(PNG_LIBNAME libpng16_static${LIBEXT}) set(OIIO_SIMD_FLAGS -DUSE_SIMD=sse2) set(OPENJPEG_POSTFIX _msvc) + if(BUILD_MODE STREQUAL Debug) + set(TIFF_POSTFIX d) + else() + set(TIFF_POSTFIX) + endif() else() set(PNG_LIBNAME libpng${LIBEXT}) set(OIIO_SIMD_FLAGS) + set(TIFF_POSTFIX) endif() if(MSVC) @@ -65,7 +71,7 @@ set(OPENIMAGEIO_EXTRA_ARGS -DZLIB_INCLUDE_DIR=${LIBDIR}/zlib/include -DPNG_LIBRARY=${LIBDIR}/png/lib/${PNG_LIBNAME} -DPNG_PNG_INCLUDE_DIR=${LIBDIR}/png/include - -DTIFF_LIBRARY=${LIBDIR}/tiff/lib/${LIBPREFIX}tiff${LIBEXT} + -DTIFF_LIBRARY=${LIBDIR}/tiff/lib/${LIBPREFIX}tiff${TIFF_POSTFIX}${LIBEXT} -DTIFF_INCLUDE_DIR=${LIBDIR}/tiff/include -DJPEG_LIBRARY=${LIBDIR}/jpeg/lib/${JPEG_LIBRARY} -DJPEG_INCLUDE_DIR=${LIBDIR}/jpeg/include diff --git a/build_files/build_environment/cmake/openpgl.cmake b/build_files/build_environment/cmake/openpgl.cmake new file mode 100644 index 00000000000..e6b0cd8eb4a --- /dev/null +++ b/build_files/build_environment/cmake/openpgl.cmake @@ -0,0 +1,49 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + +# Note the utility apps may use png/tiff/gif system libraries, but the +# library itself does not depend on them, so should give no problems. + +set(OPENPGL_EXTRA_ARGS + -DOPENPGL_BUILD_PYTHON=OFF + -DOPENPGL_BUILD_STATIC=ON + -DOPENPGL_TBB_ROOT=${LIBDIR}/tbb + -DTBB_ROOT=${LIBDIR}/tbb + -Dembree_DIR=${LIBDIR}/embree/lib/cmake/embree-${EMBREE_VERSION} + -DCMAKE_DEBUG_POSTFIX=_d +) + +if(TBB_STATIC_LIBRARY) + set(OPENPGL_EXTRA_ARGS + ${OPENPGL_EXTRA_ARGS} + -DOPENPGL_TBB_COMPONENT=tbb_static + ) +endif() + +ExternalProject_Add(external_openpgl + URL file://${PACKAGE_DIR}/${OPENPGL_FILE} + DOWNLOAD_DIR ${DOWNLOAD_DIR} + URL_HASH ${OPENPGL_HASH_TYPE}=${OPENPGL_HASH} + PREFIX ${BUILD_DIR}/openpgl + CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openpgl ${DEFAULT_CMAKE_FLAGS} ${OPENPGL_EXTRA_ARGS} + INSTALL_DIR ${LIBDIR}/openpgl +) + +add_dependencies( + external_openpgl + external_tbb + external_embree +) + +if(WIN32) + if(BUILD_MODE STREQUAL Release) + ExternalProject_Add_Step(external_openpgl after_install + COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/openpgl ${HARVEST_TARGET}/openpgl + DEPENDEES install + ) + else() + ExternalProject_Add_Step(external_openpgl after_install + COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/openpgl/lib/openpgl_d.lib ${HARVEST_TARGET}/openpgl/lib/openpgl_d.lib + DEPENDEES install + ) + endif() +endif() diff --git a/build_files/build_environment/cmake/options.cmake b/build_files/build_environment/cmake/options.cmake index 7b9529068f4..299b82f6d05 100644 --- a/build_files/build_environment/cmake/options.cmake +++ b/build_files/build_environment/cmake/options.cmake @@ -15,7 +15,7 @@ message("BuildMode = ${BUILD_MODE}") if(BUILD_MODE STREQUAL "Debug") set(LIBDIR ${CMAKE_CURRENT_BINARY_DIR}/Debug) -else(BUILD_MODE STREQUAL "Debug") +else() set(LIBDIR ${CMAKE_CURRENT_BINARY_DIR}/Release) endif() @@ -38,6 +38,7 @@ message("BUILD_DIR = ${BUILD_DIR}") if(WIN32) set(PATCH_CMD ${DOWNLOAD_DIR}/mingw/mingw64/msys/1.0/bin/patch.exe) set(LIBEXT ".lib") + set(SHAREDLIBEXT ".lib") set(LIBPREFIX "") # For OIIO and OSL @@ -96,6 +97,7 @@ if(WIN32) else() set(PATCH_CMD patch) set(LIBEXT ".a") + set(SHAREDLIBEXT ".so") set(LIBPREFIX "lib") if(APPLE) diff --git a/build_files/build_environment/cmake/python.cmake b/build_files/build_environment/cmake/python.cmake index 3f45333ed3d..8fed10e9d72 100644 --- a/build_files/build_environment/cmake/python.cmake +++ b/build_files/build_environment/cmake/python.cmake @@ -27,6 +27,7 @@ if(WIN32) PREFIX ${BUILD_DIR}/python CONFIGURE_COMMAND "" BUILD_COMMAND cd ${BUILD_DIR}/python/src/external_python/pcbuild/ && set IncludeTkinter=false && call build.bat -e -p x64 -c ${BUILD_MODE} + PATCH_COMMAND ${PATCH_CMD} --verbose -p1 -d ${BUILD_DIR}/python/src/external_python < ${PATCH_DIR}/python_windows.diff INSTALL_COMMAND ${PYTHON_BINARY_INTERNAL} ${PYTHON_SRC}/PC/layout/main.py -b ${PYTHON_SRC}/PCbuild/amd64 -s ${PYTHON_SRC} -t ${PYTHON_SRC}/tmp/ --include-stable --include-pip --include-dev --include-launchers --include-venv --include-symbols ${PYTHON_EXTRA_INSTLAL_FLAGS} --copy ${LIBDIR}/python ) diff --git a/build_files/build_environment/cmake/sse2neon.cmake b/build_files/build_environment/cmake/sse2neon.cmake index 2216ad43d59..07fe1ac6f39 100644 --- a/build_files/build_environment/cmake/sse2neon.cmake +++ b/build_files/build_environment/cmake/sse2neon.cmake @@ -1,9 +1,9 @@ # SPDX-License-Identifier: GPL-2.0-or-later ExternalProject_Add(external_sse2neon - GIT_REPOSITORY ${SSE2NEON_GIT} - GIT_TAG ${SSE2NEON_GIT_HASH} + URL file://${PACKAGE_DIR}/${SSE2NEON_FILE} DOWNLOAD_DIR ${DOWNLOAD_DIR} + URL_HASH ${SSE2NEON_HASH_TYPE}=${SSE2NEON_HASH} PREFIX ${BUILD_DIR}/sse2neon CONFIGURE_COMMAND echo sse2neon - Nothing to configure BUILD_COMMAND echo sse2neon - nothing to build diff --git a/build_files/build_environment/cmake/tiff.cmake b/build_files/build_environment/cmake/tiff.cmake index bd495df2a4c..1f8e9442ae5 100644 --- a/build_files/build_environment/cmake/tiff.cmake +++ b/build_files/build_environment/cmake/tiff.cmake @@ -3,6 +3,8 @@ set(TIFF_EXTRA_ARGS -DZLIB_LIBRARY=${LIBDIR}/zlib/lib/${ZLIB_LIBRARY} -DZLIB_INCLUDE_DIR=${LIBDIR}/zlib/include + -DJPEG_LIBRARY=${LIBDIR}/jpeg/lib/${JPEG_LIBRARY} + -DJPEG_INCLUDE_DIR=${LIBDIR}/jpeg/include -DPNG_STATIC=ON -DBUILD_SHARED_LIBS=OFF -Dlzma=OFF @@ -24,10 +26,12 @@ add_dependencies( external_tiff external_zlib ) - -if(WIN32 AND BUILD_MODE STREQUAL Debug) - ExternalProject_Add_Step(external_tiff after_install - COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tiff/lib/tiffd${LIBEXT} ${LIBDIR}/tiff/lib/tiff${LIBEXT} - DEPENDEES install - ) +if(WIN32) + if(BUILD_MODE STREQUAL Release) + ExternalProject_Add_Step(external_tiff after_install + COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tiff/lib/tiff.lib ${HARVEST_TARGET}/tiff/lib/libtiff.lib && + ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/tiff/include/ ${HARVEST_TARGET}/tiff/include/ + DEPENDEES install + ) + endif() endif() diff --git a/build_files/build_environment/cmake/versions.cmake b/build_files/build_environment/cmake/versions.cmake index 550be86b6b6..01996efa9bd 100644 --- a/build_files/build_environment/cmake/versions.cmake +++ b/build_files/build_environment/cmake/versions.cmake @@ -45,15 +45,15 @@ set(PTHREADS_HASH f3bf81bb395840b3446197bcf4ecd653) set(PTHREADS_HASH_TYPE MD5) set(PTHREADS_FILE pthreads4w-code-${PTHREADS_VERSION}.zip) -set(OPENEXR_VERSION 3.1.4) +set(OPENEXR_VERSION 3.1.5) set(OPENEXR_URI https://github.com/AcademySoftwareFoundation/openexr/archive/v${OPENEXR_VERSION}.tar.gz) -set(OPENEXR_HASH e990be1ff765797bc2d93a8060e1c1f2) +set(OPENEXR_HASH a92f38eedd43e56c0af56d4852506886) set(OPENEXR_HASH_TYPE MD5) set(OPENEXR_FILE openexr-${OPENEXR_VERSION}.tar.gz) -set(IMATH_VERSION 3.1.4) +set(IMATH_VERSION 3.1.5) set(IMATH_URI https://github.com/AcademySoftwareFoundation/Imath/archive/v${OPENEXR_VERSION}.tar.gz) -set(IMATH_HASH fddf14ec73e12c34e74c3c175e311a3f) +set(IMATH_HASH dd375574276c54872b7b3d54053baff0) set(IMATH_HASH_TYPE MD5) set(IMATH_FILE imath-${IMATH_VERSION}.tar.gz) @@ -80,11 +80,11 @@ set(FREETYPE_HASH bd4e3b007474319909a6b79d50908e85) set(FREETYPE_HASH_TYPE MD5) set(FREETYPE_FILE freetype-${FREETYPE_VERSION}.tar.gz) -set(GLEW_VERSION 1.13.0) -set(GLEW_URI http://prdownloads.sourceforge.net/glew/glew/${GLEW_VERSION}/glew-${GLEW_VERSION}.tgz) -set(GLEW_HASH 7cbada3166d2aadfc4169c4283701066) -set(GLEW_HASH_TYPE MD5) -set(GLEW_FILE glew-${GLEW_VERSION}.tgz) +set(EPOXY_VERSION 1.5.10) +set(EPOXY_URI https://github.com/anholt/libepoxy/archive/refs/tags/${EPOXY_VERSION}.tar.gz) +set(EPOXY_HASH f0730aad115c952e77591fcc805b1dc1) +set(EPOXY_HASH_TYPE MD5) +set(EPOXY_FILE libepoxy-${EPOXY_VERSION}.tar.gz) set(FREEGLUT_VERSION 3.0.0) set(FREEGLUT_URI http://prdownloads.sourceforge.net/freeglut/freeglut/${FREEGLUT_VERSION}/freeglut-${FREEGLUT_VERSION}.tar.gz) @@ -147,7 +147,7 @@ set(OPENIMAGEIO_HASH de45fb38501c4581062b522b53b6141c) set(OPENIMAGEIO_HASH_TYPE MD5) set(OPENIMAGEIO_FILE OpenImageIO-${OPENIMAGEIO_VERSION}.tar.gz) -# 8.0.0 is currently oiio's preferred vesion although never versions may be available. +# 8.0.0 is currently oiio's preferred version although never versions may be available. # the preferred version can be found in oiio's externalpackages.cmake set(FMT_VERSION 8.0.0) set(FMT_URI https://github.com/fmtlib/fmt/archive/refs/tags/${FMT_VERSION}.tar.gz) @@ -155,7 +155,7 @@ set(FMT_HASH 7bce0e9e022e586b178b150002e7c2339994e3c2bbe44027e9abb0d60f9cce83) set(FMT_HASH_TYPE SHA256) set(FMT_FILE fmt-${FMT_VERSION}.tar.gz) -# 0.6.2 is currently oiio's preferred vesion although never versions may be available. +# 0.6.2 is currently oiio's preferred version although never versions may be available. # the preferred version can be found in oiio's externalpackages.cmake set(ROBINMAP_VERSION v0.6.2) set(ROBINMAP_URI https://github.com/Tessil/robin-map/archive/refs/tags/${ROBINMAP_VERSION}.tar.gz) @@ -163,9 +163,9 @@ set(ROBINMAP_HASH c08ec4b1bf1c85eb0d6432244a6a89862229da1cb834f3f90fba8dc35d8c8e set(ROBINMAP_HASH_TYPE SHA256) set(ROBINMAP_FILE robinmap-${ROBINMAP_VERSION}.tar.gz) -set(TIFF_VERSION 4.3.0) +set(TIFF_VERSION 4.4.0) set(TIFF_URI http://download.osgeo.org/libtiff/tiff-${TIFF_VERSION}.tar.gz) -set(TIFF_HASH 0a2e4744d1426a8fc8211c0cdbc3a1b3) +set(TIFF_HASH 376f17f189e9d02280dfe709b2b2bbea) set(TIFF_HASH_TYPE MD5) set(TIFF_FILE tiff-${TIFF_VERSION}.tar.gz) @@ -410,9 +410,9 @@ set(SQLITE_HASH fb558c49ee21a837713c4f1e7e413309aabdd9c7) set(SQLITE_HASH_TYPE SHA1) set(SQLITE_FILE sqlite-src-3240000.zip) -set(EMBREE_VERSION 3.13.3) +set(EMBREE_VERSION 3.13.4) set(EMBREE_URI https://github.com/embree/embree/archive/v${EMBREE_VERSION}.zip) -set(EMBREE_HASH f62766ba54e48a2f327c3a22596e7133) +set(EMBREE_HASH 52d0be294d6c88ba7a6c9e046796e7be) set(EMBREE_HASH_TYPE MD5) set(EMBREE_FILE embree-v${EMBREE_VERSION}.zip) @@ -458,6 +458,12 @@ set(WL_PROTOCOLS_URI https://gitlab.freedesktop.org/wayland/wayland-protocols/-/ set(WL_PROTOCOLS_HASH af5ca07e13517cdbab33504492cef54a) set(WL_PROTOCOLS_HASH_TYPE MD5) +set(WAYLAND_VERSION 1.21.0) +set(WAYLAND_FILE wayland-${WAYLAND_VERSION}.tar.xz) +set(WAYLAND_URI https://gitlab.freedesktop.org/wayland/wayland/-/releases/1.21.0/downloads/wayland-${WAYLAND_VERSION}.tar.xz) +set(WAYLAND_HASH f2653a2293bcd882d756c6a83d278903) +set(WAYLAND_HASH_TYPE MD5) + set(ISPC_VERSION v1.17.0) set(ISPC_URI https://github.com/ispc/ispc/archive/${ISPC_VERSION}.tar.gz) set(ISPC_HASH 4f476a3109332a77fe839a9014c60ca9) @@ -488,8 +494,11 @@ set(ZSTD_HASH 5194fbfa781fcf45b98c5e849651aa7b3b0a008c6b72d4a0db760f3002291e94) set(ZSTD_HASH_TYPE SHA256) set(ZSTD_FILE zstd-${ZSTD_VERSION}.tar.gz) -set(SSE2NEON_GIT https://github.com/DLTcollab/sse2neon.git) -set(SSE2NEON_GIT_HASH fe5ff00bb8d19b327714a3c290f3e2ce81ba3525) +set(SSE2NEON_VERSION fe5ff00bb8d19b327714a3c290f3e2ce81ba3525) +set(SSE2NEON_URI https://github.com/DLTcollab/sse2neon/archive/${SSE2NEON_VERSION}.tar.gz) +set(SSE2NEON_HASH 0780253525d299c31775ef95853698d03db9c7739942af8570000f4a25a5d605) +set(SSE2NEON_HASH_TYPE SHA256) +set(SSE2NEON_FILE sse2neon-${SSE2NEON_VERSION}.tar.gz) set(BROTLI_VERSION v1.0.9) set(BROTLI_URI https://github.com/google/brotli/archive/refs/tags/${BROTLI_VERSION}.tar.gz) @@ -497,8 +506,152 @@ set(BROTLI_HASH f9e8d81d0405ba66d181529af42a3354f838c939095ff99930da6aa9cdf6fe46 set(BROTLI_HASH_TYPE SHA256) set(BROTLI_FILE brotli-${BROTLI_VERSION}.tar.gz) +set(OPENPGL_VERSION v0.3.1-beta) +set(OPENPGL_SHORT_VERSION 0.3.1) +set(OPENPGL_URI https://github.com/OpenPathGuidingLibrary/openpgl/archive/refs/tags/${OPENPGL_VERSION}.tar.gz) +set(OPENPGL_HASH 3830098c485c962018932766199527aab453a8029528dbbc04d4454d82431e2c) +set(OPENPGL_HASH_TYPE SHA256) +set(OPENPGL_FILE openpgl-${OPENPGL_VERSION}.tar.gz) + set(LEVEL_ZERO_VERSION v1.7.15) set(LEVEL_ZERO_URI https://github.com/oneapi-src/level-zero/archive/refs/tags/${LEVEL_ZERO_VERSION}.tar.gz) set(LEVEL_ZERO_HASH c39bb05a8e5898aa6c444e1704105b93d3f1888b9c333f8e7e73825ffbfb2617) set(LEVEL_ZERO_HASH_TYPE SHA256) set(LEVEL_ZERO_FILE level-zero-${LEVEL_ZERO_VERSION}.tar.gz) + +set(DPCPP_VERSION 20220812) +set(DPCPP_URI https://github.com/intel/llvm/archive/refs/tags/sycl-nightly/${DPCPP_VERSION}.tar.gz) +set(DPCPP_HASH 0e3c95346c295f5cf80f3a42d80b1c49481955898530242636ddc002627248d6) +set(DPCPP_HASH_TYPE SHA256) +set(DPCPP_FILE DPCPP-${DPCPP_VERSION}.tar.gz) + +######################## +### DPCPP DEPS BEGIN ### +######################## +# The following deps are build time requirements for dpcpp, when possible +# the source in the dpcpp source tree for the version chosen is documented +# by each dep, these will only have to be downloaded and unpacked, dpcpp +# will take care of building them, unpack is being done in dpcpp_deps.cmake + +# Source llvm/lib/SYCLLowerIR/CMakeLists.txt +set(VCINTRINSICS_VERSION 984bb27baacce6ee5c716c2e64845f2a1928025b) +set(VCINTRINSICS_URI https://github.com/intel/vc-intrinsics/archive/${VCINTRINSICS_VERSION}.tar.gz) +set(VCINTRINSICS_HASH abea415a15a0dd11fdc94dee8fb462910f2548311b787e02f42509789e1b0d7b) +set(VCINTRINSICS_HASH_TYPE SHA256) +set(VCINTRINSICS_FILE vc-intrinsics-${VCINTRINSICS_VERSION}.tar.gz) + +# Source opencl/CMakeLists.txt +set(OPENCLHEADERS_VERSION dcd5bede6859d26833cd85f0d6bbcee7382dc9b3) +set(OPENCLHEADERS_URI https://github.com/KhronosGroup/OpenCL-Headers/archive/${OPENCLHEADERS_VERSION}.tar.gz) +set(OPENCLHEADERS_HASH ca8090359654e94f2c41e946b7e9d826253d795ae809ce7c83a7d3c859624693) +set(OPENCLHEADERS_HASH_TYPE SHA256) +set(OPENCLHEADERS_FILE opencl_headers-${OPENCLHEADERS_VERSION}.tar.gz) + +# Source opencl/CMakeLists.txt +set(ICDLOADER_VERSION aec3952654832211636fc4af613710f80e203b0a) +set(ICDLOADER_URI https://github.com/KhronosGroup/OpenCL-ICD-Loader/archive/${ICDLOADER_VERSION}.tar.gz) +set(ICDLOADER_HASH e1880551d67bd8dc31d13de63b94bbfd6b1f315b6145dad1ffcd159b89bda93c) +set(ICDLOADER_HASH_TYPE SHA256) +set(ICDLOADER_FILE icdloader-${ICDLOADER_VERSION}.tar.gz) + +# Source sycl/cmake/modules/AddBoostMp11Headers.cmake +# Using external MP11 here, getting AddBoostMp11Headers.cmake to recognize +# our copy in boost directly was more trouble than it was worth. +set(MP11_VERSION 7bc4e1ae9b36ec8ee635c3629b59ec525bbe82b9) +set(MP11_URI https://github.com/boostorg/mp11/archive/${MP11_VERSION}.tar.gz) +set(MP11_HASH 071ee2bd3952ec89882edb3af25dd1816f6b61723f66e42eea32f4d02ceef426) +set(MP11_HASH_TYPE SHA256) +set(MP11_FILE mp11-${MP11_VERSION}.tar.gz) + +# Source llvm-spirv/CMakeLists.txt (repo) +# Source llvm-spirv/spirv-headers-tag.conf (hash) +set(SPIRV_HEADERS_VERSION 36c0c1596225e728bd49abb7ef56a3953e7ed468) +set(SPIRV_HEADERS_URI https://github.com/KhronosGroup/SPIRV-Headers/archive/${SPIRV_HEADERS_VERSION}.tar.gz) +set(SPIRV_HEADERS_HASH 7a5c89633f8740456fe8adee052033e134476d267411d1336c0cb1e587a9229a) +set(SPIRV_HEADERS_HASH_TYPE SHA256) +set(SPIRV_HEADERS_FILE SPIR-V-Headers-${SPIRV_HEADERS_VERSION}.tar.gz) + +###################### +### DPCPP DEPS END ### +###################### + +########################################## +### Intel Graphics Compiler DEPS BEGIN ### +########################################## +# The following deps are build time requirements for the intel graphics +# compiler, the versions used are taken from the following location +# https://github.com/intel/intel-graphics-compiler/releases + +set(IGC_VERSION 1.0.11222) +set(IGC_URI https://github.com/intel/intel-graphics-compiler/archive/refs/tags/igc-${IGC_VERSION}.tar.gz) +set(IGC_HASH d92f0608dcbb52690855685f9447282e5c09c0ba98ae35fabf114fcf8b1e9fcf) +set(IGC_HASH_TYPE SHA256) +set(IGC_FILE igc-${IGC_VERSION}.tar.gz) + +set(IGC_LLVM_VERSION llvmorg-11.1.0) +set(IGC_LLVM_URI https://github.com/llvm/llvm-project/archive/refs/tags/${IGC_LLVM_VERSION}.tar.gz) +set(IGC_LLVM_HASH 53a0719f3f4b0388013cfffd7b10c7d5682eece1929a9553c722348d1f866e79) +set(IGC_LLVM_HASH_TYPE SHA256) +set(IGC_LLVM_FILE ${IGC_LLVM_VERSION}.tar.gz) + +# WARNING WARNING WARNING +# +# IGC_OPENCL_CLANG contains patches for some of its dependencies. +# +# Whenever IGC_OPENCL_CLANG_VERSION changes, one *MUST* inspect +# IGC_OPENCL_CLANG's patches folder and update igc.cmake to account for +# any added or removed patches. +# +# WARNING WARNING WARNING + +set(IGC_OPENCL_CLANG_VERSION bbdd1587f577397a105c900be114b56755d1f7dc) +set(IGC_OPENCL_CLANG_URI https://github.com/intel/opencl-clang/archive/${IGC_OPENCL_CLANG_VERSION}.tar.gz) +set(IGC_OPENCL_CLANG_HASH d08315f1b0d8a6fef33de2b3e6aa7356534c324910634962c72523d970773efc) +set(IGC_OPENCL_CLANG_HASH_TYPE SHA256) +set(IGC_OPENCL_CLANG_FILE opencl-clang-${IGC_OPENCL_CLANG_VERSION}.tar.gz) + +set(IGC_VCINTRINSICS_VERSION v0.4.0) +set(IGC_VCINTRINSICS_URI https://github.com/intel/vc-intrinsics/archive/refs/tags/${IGC_VCINTRINSICS_VERSION}.tar.gz) +set(IGC_VCINTRINSICS_HASH c8b92682ad5031cf9d5b82a40e7d5c0e763cd9278660adbcaa69aab988e4b589) +set(IGC_VCINTRINSICS_HASH_TYPE SHA256) +set(IGC_VCINTRINSICS_FILE vc-intrinsics-${IGC_VCINTRINSICS_VERSION}.tar.gz) + +set(IGC_SPIRV_HEADERS_VERSION sdk-1.3.204.1) +set(IGC_SPIRV_HEADERS_URI https://github.com/KhronosGroup/SPIRV-Headers/archive/refs/tags/${IGC_SPIRV_HEADERS_VERSION}.tar.gz) +set(IGC_SPIRV_HEADERS_HASH 262864053968c217d45b24b89044a7736a32361894743dd6cfe788df258c746c) +set(IGC_SPIRV_HEADERS_HASH_TYPE SHA256) +set(IGC_SPIRV_HEADERS_FILE SPIR-V-Headers-${IGC_SPIRV_HEADERS_VERSION}.tar.gz) + +set(IGC_SPIRV_TOOLS_VERSION sdk-1.3.204.1) +set(IGC_SPIRV_TOOLS_URI https://github.com/KhronosGroup/SPIRV-Tools/archive/refs/tags/${IGC_SPIRV_TOOLS_VERSION}.tar.gz) +set(IGC_SPIRV_TOOLS_HASH 6e19900e948944243024aedd0a201baf3854b377b9cc7a386553bc103b087335) +set(IGC_SPIRV_TOOLS_HASH_TYPE SHA256) +set(IGC_SPIRV_TOOLS_FILE SPIR-V-Tools-${IGC_SPIRV_TOOLS_VERSION}.tar.gz) + +set(IGC_SPIRV_TRANSLATOR_VERSION 99420daab98998a7e36858befac9c5ed109d4920) +set(IGC_SPIRV_TRANSLATOR_URI https://github.com/KhronosGroup/SPIRV-LLVM-Translator/archive/${IGC_SPIRV_TRANSLATOR_VERSION}.tar.gz) +set(IGC_SPIRV_TRANSLATOR_HASH 77dfb4ddb6bfb993535562c02ddea23f0a0d1c5a0258c1afe7e27c894ff783a8) +set(IGC_SPIRV_TRANSLATOR_HASH_TYPE SHA256) +set(IGC_SPIRV_TRANSLATOR_FILE SPIR-V-Translator-${IGC_SPIRV_TRANSLATOR_VERSION}.tar.gz) + +######################################## +### Intel Graphics Compiler DEPS END ### +######################################## + +set(GMMLIB_VERSION intel-gmmlib-22.1.2) +set(GMMLIB_URI https://github.com/intel/gmmlib/archive/refs/tags/${GMMLIB_VERSION}.tar.gz) +set(GMMLIB_HASH 3b9a6d5e7e3f5748b3d0a2fb0e980ae943907fece0980bd9c0508e71c838e334) +set(GMMLIB_HASH_TYPE SHA256) +set(GMMLIB_FILE ${GMMLIB_VERSION}.tar.gz) + +set(OCLOC_VERSION 22.20.23198) +set(OCLOC_URI https://github.com/intel/compute-runtime/archive/refs/tags/${OCLOC_VERSION}.tar.gz) +set(OCLOC_HASH ab22b8bf2560a57fdd3def0e35a62ca75991406f959c0263abb00cd6cd9ae998) +set(OCLOC_HASH_TYPE SHA256) +set(OCLOC_FILE ocloc-${OCLOC_VERSION}.tar.gz) + +set(AOM_VERSION 3.4.0) +set(AOM_URI https://storage.googleapis.com/aom-releases/libaom-${AOM_VERSION}.tar.gz) +set(AOM_HASH bd754b58c3fa69f3ffd29da77de591bd9c26970e3b18537951336d6c0252e354) +set(AOM_HASH_TYPE SHA256) +set(AOM_FILE libaom-${AOM_VERSION}.tar.gz) diff --git a/build_files/build_environment/cmake/vpx.cmake b/build_files/build_environment/cmake/vpx.cmake index ba17acad80f..111e93e79e1 100644 --- a/build_files/build_environment/cmake/vpx.cmake +++ b/build_files/build_environment/cmake/vpx.cmake @@ -1,11 +1,13 @@ # SPDX-License-Identifier: GPL-2.0-or-later if(WIN32) - if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8") - set(VPX_EXTRA_FLAGS --target=x86_64-win64-gcc --disable-multithread) - else() - set(VPX_EXTRA_FLAGS --target=x86-win32-gcc --disable-multithread) - endif() + # VPX is determined to use pthreads which it will tell ffmpeg to dynamically + # link, which is not something we're super into distribution wise. However + # if it cannot find pthread.h it'll happily provide a pthread emulation + # layer using win32 threads. So all this patch does is make it not find + # pthead.h + set(VPX_PATCH ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/vpx/src/external_vpx < ${PATCH_DIR}/vpx_windows.diff) + set(VPX_EXTRA_FLAGS --target=x86_64-win64-gcc ) else() if(APPLE) if("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "arm64") @@ -18,6 +20,16 @@ else() endif() endif() +if(NOT BLENDER_PLATFORM_ARM) + list(APPEND VPX_EXTRA_FLAGS + --enable-sse4_1 + --enable-sse3 + --enable-ssse3 + --enable-avx + --enable-avx2 + ) +endif() + ExternalProject_Add(external_vpx URL file://${PACKAGE_DIR}/${VPX_FILE} DOWNLOAD_DIR ${DOWNLOAD_DIR} @@ -30,11 +42,6 @@ ExternalProject_Add(external_vpx --enable-static --disable-install-bins --disable-install-srcs - --disable-sse4_1 - --disable-sse3 - --disable-ssse3 - --disable-avx - --disable-avx2 --disable-unit-tests --disable-examples --enable-vp8 @@ -42,6 +49,7 @@ ExternalProject_Add(external_vpx ${VPX_EXTRA_FLAGS} BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/vpx/src/external_vpx/ && make -j${MAKE_THREADS} INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/vpx/src/external_vpx/ && make install + PATCH_COMMAND ${VPX_PATCH} INSTALL_DIR ${LIBDIR}/vpx ) diff --git a/build_files/build_environment/cmake/wayland.cmake b/build_files/build_environment/cmake/wayland.cmake new file mode 100644 index 00000000000..29859cc9ba5 --- /dev/null +++ b/build_files/build_environment/cmake/wayland.cmake @@ -0,0 +1,20 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + +ExternalProject_Add(external_wayland + URL file://${PACKAGE_DIR}/${WAYLAND_FILE} + DOWNLOAD_DIR ${DOWNLOAD_DIR} + URL_HASH ${WAYLAND_HASH_TYPE}=${WAYLAND_HASH} + PREFIX ${BUILD_DIR}/wayland + PATCH_COMMAND ${PATCH_CMD} -d ${BUILD_DIR}/wayland/src/external_wayland < ${PATCH_DIR}/wayland.diff + # Use `-E` so the `PKG_CONFIG_PATH` can be defined to link against our own LIBEXPAT. + CONFIGURE_COMMAND ${CMAKE_COMMAND} -E env PKG_CONFIG_PATH=${LIBDIR}/expat/lib/pkgconfig:${LIBDIR}/xml2/lib/pkgconfig:$PKG_CONFIG_PATH + meson --prefix ${LIBDIR}/wayland -Ddocumentation=false -Dtests=false -Dlibraries=false . ../external_wayland + BUILD_COMMAND ninja + INSTALL_COMMAND ninja install +) + +add_dependencies( + external_wayland + external_expat + external_xml2 +) diff --git a/build_files/build_environment/install_deps.sh b/build_files/build_environment/install_deps.sh index 81db928a477..5de0547727d 100755 --- a/build_files/build_environment/install_deps.sh +++ b/build_files/build_environment/install_deps.sh @@ -40,15 +40,15 @@ ver-ocio:,ver-oiio:,ver-llvm:,ver-osl:,ver-osd:,ver-openvdb:,ver-xr-openxr:,ver- force-all,force-python,force-boost,force-tbb,\ force-ocio,force-imath,force-openexr,force-oiio,force-llvm,force-osl,force-osd,force-openvdb,\ force-ffmpeg,force-opencollada,force-alembic,force-embree,force-oidn,force-usd,\ -force-xr-openxr,force-level-zero,\ +force-xr-openxr,force-level-zero, force-openpgl,\ build-all,build-python,build-boost,build-tbb,\ build-ocio,build-imath,build-openexr,build-oiio,build-llvm,build-osl,build-osd,build-openvdb,\ build-ffmpeg,build-opencollada,build-alembic,build-embree,build-oidn,build-usd,\ -build-xr-openxr,build-level-zero,\ +build-xr-openxr,build-level-zero, build-openpgl,\ skip-python,skip-boost,skip-tbb,\ skip-ocio,skip-imath,skip-openexr,skip-oiio,skip-llvm,skip-osl,skip-osd,skip-openvdb,\ skip-ffmpeg,skip-opencollada,skip-alembic,skip-embree,skip-oidn,skip-usd,\ -skip-xr-openxr,skip-level-zero \ +skip-xr-openxr,skip-level-zero, skip-openpgl \ -- "$@" \ ) @@ -232,6 +232,9 @@ ARGUMENTS_INFO="\"COMMAND LINE ARGUMENTS: --build-level-zero=<ver> Force the build of OneAPI Level Zero library. + --build-openpgl + Force the build of OpenPGL library. + Note about the --build-foo options: * They force the script to prefer building dependencies rather than using available packages. This may make things simpler and allow working around some distribution bugs, but on the other hand it will @@ -302,6 +305,9 @@ ARGUMENTS_INFO="\"COMMAND LINE ARGUMENTS: --force-level-zero=<ver> Force the rebuild of OneAPI Level Zero library. + --force-openpgl + Force the rebuild of OpenPGL library. + Note about the --force-foo options: * They obviously only have an effect if those libraries are built by this script (i.e. if there is no available and satisfactory package)! @@ -363,7 +369,10 @@ ARGUMENTS_INFO="\"COMMAND LINE ARGUMENTS: Unconditionally skip OpenXR-SDK installation/building. --skip-level-zero=<ver> - Unconditionally skip OneAPI Level Zero installation/building.\"" + Unconditionally skip OneAPI Level Zero installation/building. + + --skip-openpgl + Unconditionally skip OpenPGL installation/building.\"" # ---------------------------------------------------------------------------- # Main Vars @@ -465,7 +474,7 @@ TBB_VERSION="2020" TBB_VERSION_SHORT="2020" TBB_VERSION_UPDATE="_U3" # Used for source packages... TBB_VERSION_MIN="2018" -TBB_VERSION_MEX="2022" +TBB_VERSION_MEX="2021" # 2021 introduces 'oneTBB', which has lots of compatibility breakage with previous versions TBB_FORCE_BUILD=false TBB_FORCE_REBUILD=false TBB_SKIP=false @@ -478,7 +487,7 @@ OCIO_FORCE_BUILD=false OCIO_FORCE_REBUILD=false OCIO_SKIP=false -IMATH_VERSION="3.1.4" +IMATH_VERSION="3.1.5" IMATH_VERSION_SHORT="3.1" IMATH_VERSION_MIN="3.0" IMATH_VERSION_MEX="4.0" @@ -487,7 +496,7 @@ IMATH_FORCE_REBUILD=false IMATH_SKIP=false _with_built_imath=false -OPENEXR_VERSION="3.1.4" +OPENEXR_VERSION="3.1.5" OPENEXR_VERSION_SHORT="3.1" OPENEXR_VERSION_MIN="3.0" OPENEXR_VERSION_MEX="4.0" @@ -567,7 +576,7 @@ OPENCOLLADA_FORCE_BUILD=false OPENCOLLADA_FORCE_REBUILD=false OPENCOLLADA_SKIP=false -EMBREE_VERSION="3.13.3" +EMBREE_VERSION="3.13.4" EMBREE_VERSION_SHORT="3.13" EMBREE_VERSION_MIN="3.13" EMBREE_VERSION_MEX="4.0" @@ -593,6 +602,14 @@ LEVEL_ZERO_FORCE_BUILD=false LEVEL_ZERO_FORCE_REBUILD=false LEVEL_ZERO_SKIP=false +OPENPGL_VERSION="0.3.1" +OPENPGL_VERSION_SHORT="0.3" +OPENPGL_VERSION_MIN="0.3.1" +OPENPGL_VERSION_MEX="0.3.2" +OPENPGL_FORCE_BUILD=false +OPENPGL_FORCE_REBUILD=false +OPENPGL_SKIP=false + XR_OPENXR_VERSION="1.0.22" XR_OPENXR_VERSION_SHORT="1.0" XR_OPENXR_VERSION_MIN="1.0.8" @@ -627,6 +644,9 @@ WEBP_DEV="" VPX_USE=false VPX_VERSION_MIN=0.9.7 VPX_DEV="" +AOM_USE=false +AOM_VERSION_MIN=3.3.0 +AOM_DEV="" OPUS_USE=false OPUS_VERSION_MIN=1.1.1 OPUS_DEV="" @@ -635,9 +655,6 @@ 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="" @@ -827,6 +844,7 @@ while true; do USD_FORCE_BUILD=true XR_OPENXR_FORCE_BUILD=true LEVEL_ZERO_FORCE_BUILD=true + OPENPGL_FORCE_BUILD=true shift; continue ;; --build-python) @@ -887,6 +905,9 @@ while true; do --build-level-zero) LEVEL_ZERO_FORCE_BUILD=true; shift; continue ;; + --build-openpgl) + OPENPGL_FORCE_BUILD=true; shift; continue + ;; --force-all) PYTHON_FORCE_REBUILD=true BOOST_FORCE_REBUILD=true @@ -907,6 +928,7 @@ while true; do USD_FORCE_REBUILD=true XR_OPENXR_FORCE_REBUILD=true LEVEL_ZERO_FORCE_REBUILD=true + OPENPGL_FORCE_REBUILD=true shift; continue ;; --force-python) @@ -967,6 +989,9 @@ while true; do --force-level-zero) LEVEL_ZERO_FORCE_REBUILD=true; shift; continue ;; + --force-openpgl) + OPENPGL_FORCE_REBUILD=true; shift; continue + ;; --skip-python) PYTHON_SKIP=true; shift; continue ;; @@ -1024,6 +1049,9 @@ while true; do --skip-level-zero) LEVEL_ZERO_SKIP=true; shift; continue ;; + --skip-openpgl) + OPENPGL_SKIP=true; shift; continue + ;; --) # no more arguments to parse break @@ -1173,6 +1201,9 @@ XR_OPENXR_REPO_BRANCH="master" LEVEL_ZERO_SOURCE=("https://github.com/oneapi-src/level-zero/archive/refs/tags/v${LEVEL_ZERO_VERSION}.tar.gz") +OPENPGL_USE_REPO=false +OPENPGL_SOURCE=( "https://github.com/OpenPathGuidingLibrary/openpgl/archive/refs/tags/v${OPENPGL_VERSION}-beta.tar.gz" ) + FFMPEG_SOURCE=( "http://ffmpeg.org/releases/ffmpeg-$FFMPEG_VERSION.tar.bz2" ) # C++11 is required now @@ -1193,7 +1224,7 @@ Those libraries should be available as packages in all recent distributions (opt * libx11, libxcursor, libxi, libxrandr, libxinerama (and other libx... as needed). * libwayland-client0, libwayland-cursor0, libwayland-egl1, libxkbcommon0, libdbus-1-3, libegl1 (Wayland) * libsqlite3, libzstd, libbz2, libssl, libfftw3, libxml2, libtinyxml, yasm, libyaml-cpp, flex. - * libsdl2, libglew, libpugixml, libpotrace, [libgmp], [libglewmx], fontconfig, [libharu/libhpdf].\"" + * libsdl2, libepoxy, libpugixml, libpotrace, [libgmp], fontconfig, [libharu/libhpdf].\"" DEPS_SPECIFIC_INFO="\"BUILDABLE DEPENDENCIES: @@ -1212,7 +1243,7 @@ You may also want to build them yourself (optional ones are [between brackets]): ** [NumPy $PYTHON_NUMPY_VERSION] (use pip). * Boost $BOOST_VERSION (from $BOOST_SOURCE, modules: $BOOST_BUILD_MODULES). * TBB $TBB_VERSION (from $TBB_SOURCE). - * [FFMpeg $FFMPEG_VERSION (needs libvorbis, libogg, libtheora, libx264, libmp3lame, libxvidcore, libvpx, libwebp, ...)] (from $FFMPEG_SOURCE). + * [FFMpeg $FFMPEG_VERSION (needs libvorbis, libogg, libtheora, libx264, libmp3lame, libxvidcore, libvpx, libaom, libwebp, ...)] (from $FFMPEG_SOURCE). * [OpenColorIO $OCIO_VERSION] (from $OCIO_SOURCE). * Imath $IMATH_VERSION (from $IMATH_SOURCE). * OpenEXR $OPENEXR_VERSION (from $OPENEXR_SOURCE). @@ -1227,7 +1258,8 @@ You may also want to build them yourself (optional ones are [between brackets]): * [Alembic $ALEMBIC_VERSION] (from $ALEMBIC_SOURCE). * [Universal Scene Description $USD_VERSION] (from $USD_SOURCE). * [OpenXR-SDK $XR_OPENXR_VERSION] (from $XR_OPENXR_SOURCE). - * [OneAPI Level Zero $LEVEL_ZERO_VERSION] (from $LEVEL_ZERO_SOURCE).\"" + * [OneAPI Level Zero $LEVEL_ZERO_VERSION] (from $LEVEL_ZERO_SOURCE). + * [OpenPGL $OPENPGL_VERSION] (from $OPENPGL_SOURCE).\"" if [ "$DO_SHOW_DEPS" = true ]; then PRINT "" @@ -1661,6 +1693,7 @@ _update_deps_tbb() { USD_FORCE_BUILD=true EMBREE_FORCE_BUILD=true OIDN_FORCE_BUILD=true + OPENPGL_FORCE_BUILD=true fi if [ "$2" = true ]; then OSD_FORCE_REBUILD=true @@ -1668,6 +1701,7 @@ _update_deps_tbb() { USD_FORCE_REBUILD=true EMBREE_FORCE_REBUILD=true OIDN_FORCE_REBUILD=true + OPENPGL_FORCE_REBUILD=true fi } @@ -1687,7 +1721,7 @@ compile_TBB() { fi # To be changed each time we make edits that would modify the compiled result! - tbb_magic=0 + tbb_magic=1 _init_tbb # Force having own builds for the dependencies. @@ -2696,14 +2730,13 @@ compile_OSD() { mkdir build cd build + cmake_d="-D CMAKE_BUILD_TYPE=Release" if [ -d $INST/tbb ]; then - cmake_d="$cmake_d $cmake_d -D TBB_LOCATION=$INST/tbb" + cmake_d="$cmake_d -D TBB_LOCATION=$INST/tbb" fi - cmake_d="-D CMAKE_BUILD_TYPE=Release" cmake_d="$cmake_d -D CMAKE_INSTALL_PREFIX=$_inst" - # ptex is only needed when nicholas bishop is ready cmake_d="$cmake_d -D NO_PTEX=1" - cmake_d="$cmake_d -D NO_CLEW=1 -D NO_CUDA=1 -D NO_OPENCL=1" + cmake_d="$cmake_d -D NO_CLEW=1 -D NO_CUDA=1 -D NO_OPENCL=1 -D NO_GLEW=1" # maya plugin, docs, tutorials, regression tests and examples are not needed cmake_d="$cmake_d -D NO_MAYA=1 -D NO_DOC=1 -D NO_TUTORIALS=1 -D NO_REGRESSION=1 -DNO_EXAMPLES=1" @@ -3004,7 +3037,7 @@ compile_ALEMBIC() { fi # To be changed each time we make edits that would modify the compiled result! - alembic_magic=2 + alembic_magic=3 _init_alembic # Force having own builds for the dependencies. @@ -3052,7 +3085,7 @@ compile_ALEMBIC() { fi if [ "$_with_built_openexr" = true ]; then cmake_d="$cmake_d -D USE_ARNOLD=OFF" - cmake_d="$cmake_d -D USE_BINARIES=OFF" + cmake_d="$cmake_d -D USE_BINARIES=ON" # Tests use some Alembic binaries... cmake_d="$cmake_d -D USE_EXAMPLES=OFF" cmake_d="$cmake_d -D USE_HDF5=OFF" cmake_d="$cmake_d -D USE_MAYA=OFF" @@ -3307,7 +3340,12 @@ _init_embree() { } _update_deps_embree() { - : + if [ "$1" = true ]; then + OPENPGL_FORCE_BUILD=true + fi + if [ "$2" = true ]; then + OPENPGL_FORCE_REBUILD=true + fi } clean_Embree() { @@ -3326,7 +3364,7 @@ compile_Embree() { fi # To be changed each time we make edits that would modify the compiled results! - embree_magic=10 + embree_magic=12 _init_embree # Force having own builds for the dependencies. @@ -3386,7 +3424,7 @@ compile_Embree() { cmake_d="$cmake_d -D EMBREE_TASKING_SYSTEM=TBB" if [ -d $INST/tbb ]; then - make_d="$make_d EMBREE_TBB_ROOT=$INST/tbb" + cmake_d="$cmake_d -D EMBREE_TBB_ROOT=$INST/tbb" fi cmake $cmake_d ../ @@ -3525,7 +3563,7 @@ compile_OIDN() { install_ISPC # To be changed each time we make edits that would modify the compiled results! - oidn_magic=9 + oidn_magic=10 _init_oidn # Force having own builds for the dependencies. @@ -3581,7 +3619,7 @@ compile_OIDN() { cmake_d="$cmake_d -D ISPC_DIR_HINT=$_ispc_path_bin" if [ -d $INST/tbb ]; then - make_d="$make_d TBB_ROOT=$INST/tbb" + cmake_d="$cmake_d -D TBB_ROOT=$INST/tbb" fi cmake $cmake_d ../ @@ -3638,7 +3676,7 @@ compile_FFmpeg() { fi # To be changed each time we make edits that would modify the compiled result! - ffmpeg_magic=5 + ffmpeg_magic=6 _init_ffmpeg # Force having own builds for the dependencies. @@ -3691,6 +3729,10 @@ compile_FFmpeg() { extra="$extra --enable-libvpx" fi + if [ "$AOM_USE" = true ]; then + extra="$extra --enable-libaom" + fi + if [ "$WEBP_USE" = true ]; then extra="$extra --enable-libwebp" fi @@ -3960,6 +4002,112 @@ compile_Level_Zero() { # ---------------------------------------------------------------------------- +# Build OpenPGL + +_init_openpgl() { + _src=$SRC/openpgl-$OPENPGL_VERSION + _git=false + _inst=$INST/openpgl-$OPENPGL_VERSION_SHORT + _inst_shortcut=$INST/openpgl +} + +_update_deps_openpgl() { + : +} + +clean_OpenPGL() { + _init_openpgl + if [ -d $_inst ]; then + # Force rebuilding the dependencies if needed. + _update_deps_openpgl false true + fi + _clean +} + +compile_OpenPGL() { + if [ "$NO_BUILD" = true ]; then + WARNING "--no-build enabled, OpenPGL will not be compiled!" + return + fi + + # To be changed each time we make edits that would modify the compiled results! + openpgl_magic=1 + _init_openpgl + + # Force having own builds for the dependencies. + _update_deps_openpgl true false + + # Clean install if needed! + magic_compile_check openpgl-$OPENPGL_VERSION $openpgl_magic + if [ $? -eq 1 -o "$OPENPGL_FORCE_REBUILD" = true ]; then + clean_OpenPGL + fi + + if [ ! -d $_inst ]; then + INFO "Building OpenPGL-$OPENPGL_VERSION" + + # Force rebuilding the dependencies. + _update_deps_openpgl true true + + prepare_inst + + if [ ! -d $_src ]; then + mkdir -p $SRC + download OPENPGL_SOURCE[@] "$_src.tar.gz" + INFO "Unpacking OpenPGL-$OPENPGL_VERSION" + tar -C $SRC --transform "s,(.*/?)openpgl-$OPENPGL_VERSION-beta[^/]*(.*),\1openpgl-$OPENPGL_VERSION\2,x" \ + -xf $_src.tar.gz + fi + + cd $_src + + INFO "$_src" + + # Always refresh the whole build! + if [ -d build ]; then + rm -rf build + fi + mkdir build + cd build + + cmake_d="-D CMAKE_BUILD_TYPE=Release" + cmake_d="$cmake_d -D CMAKE_INSTALL_PREFIX=$_inst" + cmake_d="$cmake_d -D OPENPGL_BUILD_STATIC=OFF" + cmake_d="$cmake_d -D OPENPGL_BUILD_PYTHON=OFF" + cmake_d="$cmake_d -D EMBREE_ISPC_SUPPORT=OFF" + if [ -d $INST/tbb ]; then + cmake_d="$cmake_d -D OPENPGL_TBB_ROOT=$INST/tbb" + cmake_d="$cmake_d -D TBB_ROOT=$INST/tbb" + fi + + cmake $cmake_d ../ + + make -j$THREADS && make install + make clean + + if [ ! -d $_inst ]; then + ERROR "OpenPGL-$OPENPGL_VERSION failed to compile, exiting" + exit 1 + fi + + magic_compile_set openpgl-$OPENPGL_VERSION $openpgl_magic + + cd $CWD + INFO "Done compiling OpenPGL-$OPENPGL_VERSION!" + else + INFO "Own OpenPGL-$OPENPGL_VERSION is up to date, nothing to do!" + INFO "If you want to force rebuild of this lib, use the --force-openpgl option." + fi + + if [ -d $_inst ]; then + _create_inst_shortcut + fi + + run_ldconfig "openpgl" +} + + +# ---------------------------------------------------------------------------- # Install on DEB-like get_package_version_DEB() { @@ -4059,10 +4207,10 @@ install_DEB() { libxcursor-dev libxi-dev wget libsqlite3-dev libxrandr-dev libxinerama-dev \ libwayland-dev wayland-protocols libegl-dev libxkbcommon-dev libdbus-1-dev linux-libc-dev \ libbz2-dev libncurses5-dev libssl-dev liblzma-dev libreadline-dev \ - libopenal-dev libglew-dev yasm \ + libopenal-dev libepoxy-dev yasm \ libsdl2-dev libfftw3-dev patch bzip2 libxml2-dev libtinyxml-dev libjemalloc-dev \ - libgmp-dev libpugixml-dev libpotrace-dev libhpdf-dev libzstd-dev libpystring-dev" - # libglewmx-dev (broken in deb testing currently...) + libgmp-dev libpugixml-dev libpotrace-dev libhpdf-dev libzstd-dev libpystring-dev \ + libglfw3-dev" VORBIS_USE=true OGG_USE=true @@ -4145,33 +4293,37 @@ install_DEB() { WEBP_USE=true fi - if [ "$WITH_ALL" = true ]; then - XVID_DEV="libxvidcore-dev" - check_package_DEB $XVID_DEV - if [ $? -eq 0 ]; then - XVID_USE=true - fi + XVID_DEV="libxvidcore-dev" + check_package_DEB $XVID_DEV + if [ $? -eq 0 ]; then + XVID_USE=true + fi - MP3LAME_DEV="libmp3lame-dev" - check_package_DEB $MP3LAME_DEV - if [ $? -eq 0 ]; then - MP3LAME_USE=true - fi + MP3LAME_DEV="libmp3lame-dev" + check_package_DEB $MP3LAME_DEV + if [ $? -eq 0 ]; then + MP3LAME_USE=true + fi - VPX_DEV="libvpx-dev" - check_package_version_ge_DEB $VPX_DEV $VPX_VERSION_MIN - if [ $? -eq 0 ]; then - VPX_USE=true - fi + VPX_DEV="libvpx-dev" + check_package_version_ge_DEB $VPX_DEV $VPX_VERSION_MIN + if [ $? -eq 0 ]; then + VPX_USE=true + fi - OPUS_DEV="libopus-dev" - check_package_version_ge_DEB $OPUS_DEV $OPUS_VERSION_MIN - if [ $? -eq 0 ]; then - OPUS_USE=true - fi + AOM_DEV="libaom-dev" + check_package_version_ge_DEB $AOM_DEV $AOM_VERSION_MIN + if [ $? -eq 0 ]; then + AOM_USE=true + fi + + OPUS_DEV="libopus-dev" + check_package_version_ge_DEB $OPUS_DEV $OPUS_VERSION_MIN + if [ $? -eq 0 ]; then + OPUS_USE=true fi - # Check cmake/glew versions and disable features for older distros. + # Check cmake version and disable features for older distros. # This is so Blender can at least compile. PRINT "" _cmake=`get_package_version_DEB cmake` @@ -4189,28 +4341,6 @@ install_DEB() { fi PRINT "" - _glew=`get_package_version_DEB libglew-dev` - if [ -z $_glew ]; then - # Stupid virtual package in Ubuntu 12.04 doesn't show version number... - _glew=`apt-cache showpkg libglew-dev|tail -n1|awk '{print $2}'|sed 's/-.*//'` - fi - version_ge $_glew "1.9.0" - if [ $? -eq 1 ]; then - 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 - - - PRINT "" _do_compile_python=false if [ "$PYTHON_SKIP" = true ]; then WARNING "Skipping Python installation, as requested..." @@ -4573,6 +4703,9 @@ install_DEB() { if [ "$VPX_USE" = true ]; then _packages="$_packages $VPX_DEV" fi + if [ "$AOM_USE" = true ]; then + _packages="$_packages $AOM_DEV" + fi if [ "$OPUS_USE" = true ]; then _packages="$_packages $OPUS_DEV" fi @@ -4607,6 +4740,18 @@ install_DEB() { PRINT "" compile_Level_Zero fi + + PRINT "" + if [ "$OPENPGL_SKIP" = true ]; then + WARNING "Skipping OpenPGL installation, as requested..." + elif [ "$OPENPGL_FORCE_BUILD" = true ]; then + INFO "Forced OpenPGL building, as requested..." + compile_OpenPGL + else + # No package currently! + PRINT "" + compile_OpenPGL + fi } @@ -4785,7 +4930,7 @@ install_RPM() { libX11-devel libXi-devel libXcursor-devel libXrandr-devel libXinerama-devel \ wayland-devel wayland-protocols-devel mesa-libEGL-devel libxkbcommon-devel dbus-devel kernel-headers \ wget ncurses-devel readline-devel $OPENJPEG_DEV openal-soft-devel \ - glew-devel yasm patch \ + libepoxy-devel yasm patch \ libxml2-devel yaml-cpp-devel tinyxml-devel jemalloc-devel \ gmp-devel pugixml-devel potrace-devel libharu-devel libzstd-devel pystring-devel" @@ -4873,21 +5018,27 @@ install_RPM() { WEBP_USE=true fi - if [ "$WITH_ALL" = true ]; then - VPX_DEV="libvpx-devel" - check_package_version_ge_RPM $VPX_DEV $VPX_VERSION_MIN - if [ $? -eq 0 ]; then - VPX_USE=true - fi + VPX_DEV="libvpx-devel" + check_package_version_ge_RPM $VPX_DEV $VPX_VERSION_MIN + if [ $? -eq 0 ]; then + VPX_USE=true + fi + + AOM_DEV="libaom-devel" + check_package_version_ge_RPM $AOM_DEV $AOM_VERSION_MIN + if [ $? -eq 0 ]; then + AOM_USE=true + fi + OPUS_DEV="libopus-devel" + check_package_version_ge_RPM $OPUS_DEV $OPUS_VERSION_MIN + if [ $? -eq 0 ]; then + OPUS_USE=true + fi + + if [ "$WITH_ALL" = true ]; then PRINT "" install_packages_RPM libspnav-devel - - OPUS_DEV="libopus-devel" - check_package_version_ge_RPM $OPUS_DEV $OPUS_VERSION_MIN - if [ $? -eq 0 ]; then - OPUS_USE=true - fi fi PRINT "" @@ -5272,6 +5423,9 @@ install_RPM() { if [ "$VPX_USE" = true ]; then _packages="$_packages $VPX_DEV" fi + if [ "$AOM_USE" = true ]; then + _packages="$_packages $AOM_DEV" + fi if [ "$OPUS_USE" = true ]; then _packages="$_packages $OPUS_DEV" fi @@ -5305,6 +5459,18 @@ install_RPM() { PRINT "" compile_Level_Zero fi + + PRINT "" + if [ "$OPENPGL_SKIP" = true ]; then + WARNING "Skipping OpenPGL installation, as requested..." + elif [ "$OPENPGL_FORCE_BUILD" = true ]; then + INFO "Forced OpenPGL building, as requested..." + compile_OpenPGL + else + # No package currently! + PRINT "" + compile_OpenPGL + fi } @@ -5416,7 +5582,7 @@ install_ARCH() { fi _packages="$BASE_DEVEL git cmake fontconfig flex \ - libxi libxcursor libxrandr libxinerama glew libpng libtiff wget openal \ + libxi libxcursor libxrandr libxinerama libepoxy libpng libtiff wget openal \ $OPENJPEG_DEV yasm sdl2 fftw \ libxml2 yaml-cpp tinyxml python-requests jemalloc gmp potrace pugixml libharu \ zstd pystring" @@ -5461,30 +5627,34 @@ install_ARCH() { WEBP_USE=true fi - if [ "$WITH_ALL" = true ]; then - XVID_DEV="xvidcore" - check_package_ARCH $XVID_DEV - if [ $? -eq 0 ]; then - XVID_USE=true - fi + XVID_DEV="xvidcore" + check_package_ARCH $XVID_DEV + if [ $? -eq 0 ]; then + XVID_USE=true + fi - MP3LAME_DEV="lame" - check_package_ARCH $MP3LAME_DEV - if [ $? -eq 0 ]; then - MP3LAME_USE=true - fi + MP3LAME_DEV="lame" + check_package_ARCH $MP3LAME_DEV + if [ $? -eq 0 ]; then + MP3LAME_USE=true + fi - VPX_DEV="libvpx" - check_package_version_ge_ARCH $VPX_DEV $VPX_VERSION_MIN - if [ $? -eq 0 ]; then - VPX_USE=true - fi + VPX_DEV="libvpx" + check_package_version_ge_ARCH $VPX_DEV $VPX_VERSION_MIN + if [ $? -eq 0 ]; then + VPX_USE=true + fi - OPUS_DEV="opus" - check_package_version_ge_ARCH $OPUS_DEV $OPUS_VERSION_MIN - if [ $? -eq 0 ]; then - OPUS_USE=true - fi + AOM_DEV="libaom" + check_package_version_ge_ARCH $AOM_DEV $AOM_VERSION_MIN + if [ $? -eq 0 ]; then + AOM_USE=true + fi + + OPUS_DEV="opus" + check_package_version_ge_ARCH $OPUS_DEV $OPUS_VERSION_MIN + if [ $? -eq 0 ]; then + OPUS_USE=true fi @@ -5862,6 +6032,9 @@ install_ARCH() { if [ "$VPX_USE" = true ]; then _packages="$_packages $VPX_DEV" fi + if [ "$AOM_USE" = true ]; then + _packages="$_packages $AOM_DEV" + fi if [ "$OPUS_USE" = true ]; then _packages="$_packages $OPUS_DEV" fi @@ -5894,6 +6067,18 @@ install_ARCH() { PRINT "" compile_Level_Zero fi + + PRINT "" + if [ "$OPENPGL_SKIP" = true ]; then + WARNING "Skipping OpenPGL installation, as requested..." + elif [ "$OPENPGL_FORCE_BUILD" = true ]; then + INFO "Forced OpenPGL building, as requested..." + compile_OpenPGL + else + # No package currently! + PRINT "" + compile_OpenPGL + fi } @@ -6076,6 +6261,14 @@ install_OTHER() { INFO "Forced Level Zero building, as requested..." compile_Level_Zero fi + + PRINT "" + if [ "$OPENPGL_SKIP" = true ]; then + WARNING "Skipping OpenPGL installation, as requested..." + elif [ "$OPENPGL_FORCE_BUILD" = true ]; then + INFO "Forced OpenPGL building, as requested..." + compile_OpenPGL + fi } # ---------------------------------------------------------------------------- @@ -6093,7 +6286,7 @@ print_info() { _buildargs="-U *SNDFILE* -U PYTHON* -U *BOOST* -U *Boost* -U *TBB*" _buildargs="$_buildargs -U *OPENCOLORIO* -U *OPENEXR* -U *OPENIMAGEIO* -U *LLVM* -U *CLANG* -U *CYCLES*" _buildargs="$_buildargs -U *OPENSUBDIV* -U *OPENVDB* -U *BLOSC* -U *COLLADA* -U *FFMPEG* -U *ALEMBIC* -U *USD*" - _buildargs="$_buildargs -U *EMBREE* -U *OPENIMAGEDENOISE* -U *OPENXR*" + _buildargs="$_buildargs -U *EMBREE* -U *OPENIMAGEDENOISE* -U *OPENXR* -U *OPENPGL*" _1="-D WITH_CODEC_SNDFILE=ON" PRINT " $_1" @@ -6290,12 +6483,6 @@ 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" PRINT " $_1" @@ -6330,6 +6517,16 @@ print_info() { #~ fi #~ fi + if [ "$OPENPGL_SKIP" = false ]; then + if [ -d $INST/openpgl ]; then + _1="-D openpgl_DIR=$INST/openpgl/lib/cmake/openpgl-$OPENPGL_VERSION" + _2="-D WITH_CYCLES_PATH_GUIDING=ON" + PRINT " $_1" + PRINT " $_2" + _buildargs="$_buildargs $_1 $_2" + fi + fi + PRINT "" PRINT "Or even simpler, just run (in your blender-source dir):" PRINT " make -j$THREADS BUILD_CMAKE_ARGS=\"$_buildargs\"" diff --git a/build_files/build_environment/linux/linux-centos7-setup.sh b/build_files/build_environment/linux/linux-centos7-setup.sh new file mode 100644 index 00000000000..84c14a1d2be --- /dev/null +++ b/build_files/build_environment/linux/linux-centos7-setup.sh @@ -0,0 +1,65 @@ +#!/bin/sh + +set -e + +if [ `id -u` -ne 0 ]; then + echo "This script must be run as root" + exit 1 +fi + +# yum-config-manager does not come in the default minimal install, +# so make sure it is installed and available. +yum -y update +yum -y install yum-utils + +# Install all the packages needed for a new toolchain. +# +# NOTE: Keep this separate from the packages install, since otherwise +# older toolchain will be installed. +yum -y update +yum -y install epel-release +yum -y install centos-release-scl +yum -y install devtoolset-9 + +# Install packages needed for Blender's dependencies. +yum -y install -y \ + git subversion bzip2 tar cmake3 patch make autoconf automake libtool \ + meson ninja-build \ + libXrandr-devel libXinerama-devel libXcursor-devel libXi-devel \ + libX11-devel libXt-devel \ + mesa-libEGL-devel mesa-libGL-devel mesa-libGLU-devel \ + zlib-devel \ + rubygem-asciidoctor \ + wget tcl yasm python36 python-setuptools bison flex \ + ncurses-devel \ + wayland-devel libwayland-client libwayland-server \ + + +# Dependencies for Mesa +yum -y install expat-devel +python3 -m pip install mako + +# Dependencies for pip (needed for buildbot-worker). +yum -y install python36-pip python36-devel + +# Dependencies for asound. +yum -y install -y \ + alsa-lib-devel pulseaudio-libs-devel + +alternatives --install /usr/local/bin/cmake cmake /usr/bin/cmake 10 \ + --slave /usr/local/bin/ctest ctest /usr/bin/ctest \ + --slave /usr/local/bin/cpack cpack /usr/bin/cpack \ + --slave /usr/local/bin/ccmake ccmake /usr/bin/ccmake \ + --family cmake + +alternatives --install /usr/local/bin/cmake cmake /usr/bin/cmake3 20 \ + --slave /usr/local/bin/ctest ctest /usr/bin/ctest3 \ + --slave /usr/local/bin/cpack cpack /usr/bin/cpack3 \ + --slave /usr/local/bin/ccmake ccmake /usr/bin/ccmake3 \ + --family cmake + +alternatives --install /usr/local/bin/cmake cmake /usr/bin/cmake3 20 \ + --slave /usr/local/bin/ctest ctest /usr/bin/ctest3 \ + --slave /usr/local/bin/cpack cpack /usr/bin/cpack3 \ + --slave /usr/local/bin/ccmake ccmake /usr/bin/ccmake3 \ + --family cmake diff --git a/build_files/build_environment/patches/cmakelists_glew.txt b/build_files/build_environment/patches/cmakelists_glew.txt deleted file mode 100644 index ec36d4bde63..00000000000 --- a/build_files/build_environment/patches/cmakelists_glew.txt +++ /dev/null @@ -1,2 +0,0 @@ -cmake_minimum_required (VERSION 2.4) -add_subdirectory(build/cmake)
\ No newline at end of file diff --git a/build_files/build_environment/patches/dpcpp.diff b/build_files/build_environment/patches/dpcpp.diff new file mode 100644 index 00000000000..4a65a6c6cf0 --- /dev/null +++ b/build_files/build_environment/patches/dpcpp.diff @@ -0,0 +1,36 @@ +diff -Naur llvm-sycl-nightly-20220501.orig\opencl/CMakeLists.txt llvm-sycl-nightly-20220501\opencl/CMakeLists.txt +--- llvm-sycl-nightly-20220501.orig/opencl/CMakeLists.txt 2022-04-29 13:47:11 -0600 ++++ llvm-sycl-nightly-20220501/opencl/CMakeLists.txt 2022-05-21 15:25:06 -0600 +@@ -11,6 +11,11 @@ + ) + endif() + ++# Blender code below is determined to use FetchContent_Declare ++# temporarily allow it (but feed it our downloaded tarball ++# in the OpenCL_HEADERS variable ++set(FETCHCONTENT_FULLY_DISCONNECTED OFF) ++ + # Repo URLs + + set(OCL_HEADERS_REPO +@@ -77,5 +82,6 @@ + + FetchContent_MakeAvailable(ocl-icd) + add_library(OpenCL-ICD ALIAS OpenCL) ++set(FETCHCONTENT_FULLY_DISCONNECTED ON) + + add_subdirectory(opencl-aot) +diff -Naur llvm-sycl-nightly-20220208.orig/libdevice/cmake/modules/SYCLLibdevice.cmake llvm-sycl-nightly-20220208/libdevice/cmake/modules/SYCLLibdevice.cmake +--- llvm-sycl-nightly-20220208.orig/libdevice/cmake/modules/SYCLLibdevice.cmake 2022-02-08 09:17:24 -0700 ++++ llvm-sycl-nightly-20220208/libdevice/cmake/modules/SYCLLibdevice.cmake 2022-05-24 11:35:51 -0600 +@@ -36,7 +36,9 @@ + add_custom_target(libsycldevice-obj) + add_custom_target(libsycldevice-spv) + +-add_custom_target(libsycldevice DEPENDS ++# Blender: add ALL here otherwise this target will not build ++# and cause an error due to missing files during the install phase. ++add_custom_target(libsycldevice ALL DEPENDS + libsycldevice-obj + libsycldevice-spv) + diff --git a/build_files/build_environment/patches/embree.diff b/build_files/build_environment/patches/embree.diff index e83d754a465..e448fe5ee2e 100644 --- a/build_files/build_environment/patches/embree.diff +++ b/build_files/build_environment/patches/embree.diff @@ -1,30 +1,37 @@ -diff -Naur orig/common/sys/platform.h external_embree/common/sys/platform.h ---- orig/common/sys/platform.h 2020-05-13 23:08:53 -0600 -+++ external_embree/common/sys/platform.h 2020-06-13 17:40:26 -0600 -@@ -84,8 +84,8 @@ - //////////////////////////////////////////////////////////////////////////////// +diff -Naur org/kernels/rtcore_config.h.in embree-3.13.4/kernels/rtcore_config.h.in +--- org/kernels/rtcore_config.h.in 2022-06-14 22:13:52 -0600 ++++ embree-3.13.4/kernels/rtcore_config.h.in 2022-06-24 15:20:12 -0600 +@@ -14,6 +14,7 @@ + #cmakedefine01 EMBREE_MIN_WIDTH + #define RTC_MIN_WIDTH EMBREE_MIN_WIDTH + ++#cmakedefine EMBREE_STATIC_LIB + #cmakedefine EMBREE_API_NAMESPACE + + #if defined(EMBREE_API_NAMESPACE) +diff --git a/kernels/CMakeLists.txt b/kernels/CMakeLists.txt +index 7c2f43d..106b1d5 100644 +--- a/kernels/CMakeLists.txt ++++ b/kernels/CMakeLists.txt +@@ -201,6 +201,12 @@ embree_files(EMBREE_LIBRARY_FILES_AVX512 ${AVX512}) + #message("AVX2: ${EMBREE_LIBRARY_FILES_AVX2}") + #message("AVX512: ${EMBREE_LIBRARY_FILES_AVX512}") - #ifdef __WIN32__ --#define dll_export __declspec(dllexport) --#define dll_import __declspec(dllimport) -+#define dll_export -+#define dll_import - #else - #define dll_export __attribute__ ((visibility ("default"))) - #define dll_import -diff --git orig/common/tasking/CMakeLists.txt external_embree/common/tasking/CMakeLists.txt ---- orig/common/tasking/CMakeLists.txt -+++ external_embree/common/tasking/CMakeLists.txt -@@ -27,7 +27,11 @@ - else() - # If not found try getting older TBB via module (FindTBB.cmake) - unset(TBB_DIR CACHE) -- find_package(TBB 4.1 REQUIRED tbb) -+ if (TBB_STATIC_LIB) -+ find_package(TBB 4.1 REQUIRED tbb_static) -+ else() -+ find_package(TBB 4.1 REQUIRED tbb) -+ endif() - if (TBB_FOUND) - TARGET_LINK_LIBRARIES(tasking PUBLIC TBB) - TARGET_INCLUDE_DIRECTORIES(tasking PUBLIC "${TBB_INCLUDE_DIRS}") ++# Bundle Neon2x into the main static library. ++IF(EMBREE_ISA_NEON2X AND EMBREE_STATIC_LIB) ++ LIST(APPEND EMBREE_LIBRARY_FILES ${EMBREE_LIBRARY_FILES_AVX2}) ++ LIST(REMOVE_DUPLICATES EMBREE_LIBRARY_FILES) ++ENDIF() ++ + # replaces all .cpp files with a dummy file that includes that .cpp file + # this is to work around an ICC name mangling issue related to lambda functions under windows + MACRO (CreateISADummyFiles list isa) +@@ -277,7 +283,7 @@ IF (EMBREE_ISA_AVX AND EMBREE_LIBRARY_FILES_AVX) + ENDIF() + ENDIF() + +-IF (EMBREE_ISA_AVX2 AND EMBREE_LIBRARY_FILES_AVX2) ++IF (EMBREE_ISA_AVX2 AND EMBREE_LIBRARY_FILES_AVX2 AND NOT (EMBREE_ISA_NEON2X AND EMBREE_STATIC_LIB)) + DISABLE_STACK_PROTECTOR_FOR_INTERSECTORS(${EMBREE_LIBRARY_FILES_AVX2}) + ADD_LIBRARY(embree_avx2 STATIC ${EMBREE_LIBRARY_FILES_AVX2}) + TARGET_LINK_LIBRARIES(embree_avx2 PRIVATE tasking) diff --git a/build_files/build_environment/patches/epoxy.diff b/build_files/build_environment/patches/epoxy.diff new file mode 100644 index 00000000000..b0c3d7ea1dc --- /dev/null +++ b/build_files/build_environment/patches/epoxy.diff @@ -0,0 +1,19 @@ +--- a/src/dispatch_wgl.c 2022-08-04 17:45:13.144924705 +0200 ++++ b/src/dispatch_wgl.c 2022-08-04 17:45:47.657482971 +0200 +@@ -78,6 +78,8 @@ + if (!first_context_current) { + first_context_current = true; + } else { ++ /* BLENDER: disable slow dispatch table switching. */ ++#if 0 + if (!already_switched_to_dispatch_table) { + already_switched_to_dispatch_table = true; + gl_switch_to_dispatch_table(); +@@ -86,6 +88,7 @@ + + gl_init_dispatch_table(); + wgl_init_dispatch_table(); ++#endif + } + } + diff --git a/build_files/build_environment/patches/igc_opencl_clang.diff b/build_files/build_environment/patches/igc_opencl_clang.diff new file mode 100644 index 00000000000..adc592dd8b2 --- /dev/null +++ b/build_files/build_environment/patches/igc_opencl_clang.diff @@ -0,0 +1,44 @@ +diff -Naur external_igc_opencl_clang.orig/CMakeLists.txt external_igc_opencl_clang/CMakeLists.txt +--- external_igc_opencl_clang.orig/CMakeLists.txt 2022-03-16 05:51:10 -0600 ++++ external_igc_opencl_clang/CMakeLists.txt 2022-05-23 10:40:09 -0600 +@@ -126,22 +126,24 @@ + ) + endif() + +- +- set(SPIRV_BASE_REVISION llvm_release_110) +- set(TARGET_BRANCH "ocl-open-110") +- get_filename_component(LLVM_MONOREPO_DIR ${LLVM_SOURCE_DIR} DIRECTORY) +- set(LLVM_PATCHES_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/patches/llvm +- ${CMAKE_CURRENT_SOURCE_DIR}/patches/clang) +- apply_patches(${LLVM_MONOREPO_DIR} +- "${LLVM_PATCHES_DIRS}" +- ${LLVM_BASE_REVISION} +- ${TARGET_BRANCH} +- ret) +- apply_patches(${SPIRV_SOURCE_DIR} +- ${CMAKE_CURRENT_SOURCE_DIR}/patches/spirv +- ${SPIRV_BASE_REVISION} +- ${TARGET_BRANCH} +- ret) ++ # ++ # Blender: Why apply these manually in igc.cmake ++ # ++ #set(SPIRV_BASE_REVISION llvm_release_110) ++ #set(TARGET_BRANCH "ocl-open-110") ++ #get_filename_component(LLVM_MONOREPO_DIR ${LLVM_SOURCE_DIR} DIRECTORY) ++ #set(LLVM_PATCHES_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/patches/llvm ++ # ${CMAKE_CURRENT_SOURCE_DIR}/patches/clang) ++ #apply_patches(${LLVM_MONOREPO_DIR} ++ # "${LLVM_PATCHES_DIRS}" ++ # ${LLVM_BASE_REVISION} ++ # ${TARGET_BRANCH} ++ # ret) ++ #apply_patches(${SPIRV_SOURCE_DIR} ++ # ${CMAKE_CURRENT_SOURCE_DIR}/patches/spirv ++ # ${SPIRV_BASE_REVISION} ++ # ${TARGET_BRANCH} ++ # ret) + endif(NOT USE_PREBUILT_LLVM) + + # diff --git a/build_files/build_environment/patches/opencolorio.diff b/build_files/build_environment/patches/opencolorio.diff index 2255cbc02ed..278dfe0d857 100644 --- a/build_files/build_environment/patches/opencolorio.diff +++ b/build_files/build_environment/patches/opencolorio.diff @@ -14,3 +14,15 @@ index 7b894a45..92618215 100644 ) if(CMAKE_TOOLCHAIN_FILE) set(pystring_CMAKE_ARGS +--- a/src/OpenColorIO/FileRules.cpp ++++ b/src/OpenColorIO/FileRules.cpp +@@ -7,6 +7,9 @@ + #include <regex> + #include <sstream> + ++/* NOTE: this has been applied up-stream, this edit can be removed after upgrading OpenColorIO. */ ++#include <cstring> ++ + #include <OpenColorIO/OpenColorIO.h> + + #include "CustomKeys.h" diff --git a/build_files/build_environment/patches/python_windows.diff b/build_files/build_environment/patches/python_windows.diff new file mode 100644 index 00000000000..f9c89a90fde --- /dev/null +++ b/build_files/build_environment/patches/python_windows.diff @@ -0,0 +1,24 @@ +diff -Naur orig/PCbuild/get_externals.bat Python-3.10.2/PCbuild/get_externals.bat +--- orig/PCbuild/get_externals.bat 2022-01-13 11:52:14 -0700 ++++ Python-3.10.2/PCbuild/get_externals.bat 2022-08-17 11:24:42 -0600 +@@ -51,7 +51,7 @@ + echo.Fetching external libraries... + + set libraries= +-set libraries=%libraries% bzip2-1.0.6 ++set libraries=%libraries% bzip2-1.0.8 + if NOT "%IncludeLibffiSrc%"=="false" set libraries=%libraries% libffi-3.3.0 + if NOT "%IncludeSSLSrc%"=="false" set libraries=%libraries% openssl-1.1.1m + set libraries=%libraries% sqlite-3.35.5.0 + diff -Naur orig/PCbuild/python.props external_python/PCbuild/python.props +--- orig/PCbuild/python.props 2022-01-13 11:52:14 -0700 ++++ external_python/PCbuild/python.props 2022-08-17 11:38:38 -0600 +@@ -58,7 +58,7 @@ + <ExternalsDir Condition="$(ExternalsDir) == ''">$([System.IO.Path]::GetFullPath(`$(PySourcePath)externals`))</ExternalsDir> + <ExternalsDir Condition="!HasTrailingSlash($(ExternalsDir))">$(ExternalsDir)\</ExternalsDir> + <sqlite3Dir>$(ExternalsDir)sqlite-3.35.5.0\</sqlite3Dir> +- <bz2Dir>$(ExternalsDir)bzip2-1.0.6\</bz2Dir> ++ <bz2Dir>$(ExternalsDir)bzip2-1.0.8\</bz2Dir> + <lzmaDir>$(ExternalsDir)xz-5.2.2\</lzmaDir> + <libffiDir>$(ExternalsDir)libffi-3.3.0\</libffiDir> + <libffiOutDir>$(ExternalsDir)libffi-3.3.0\$(ArchName)\</libffiOutDir> diff --git a/build_files/build_environment/patches/vpx_windows.diff b/build_files/build_environment/patches/vpx_windows.diff new file mode 100644 index 00000000000..13e3b06d95d --- /dev/null +++ b/build_files/build_environment/patches/vpx_windows.diff @@ -0,0 +1,11 @@ +diff -Naur orig/configure external_vpx/configure +--- orig/configure 2022-07-06 09:22:04 -0600 ++++ external_vpx/configure 2022-07-06 09:24:12 -0600 +@@ -270,7 +270,6 @@ + HAVE_LIST=" + ${ARCH_EXT_LIST} + vpx_ports +- pthread_h + unistd_h + " + EXPERIMENT_LIST=" diff --git a/build_files/build_environment/patches/wayland.diff b/build_files/build_environment/patches/wayland.diff new file mode 100644 index 00000000000..c080b7b2964 --- /dev/null +++ b/build_files/build_environment/patches/wayland.diff @@ -0,0 +1,11 @@ +--- meson.build.orig 2022-06-30 22:59:11.000000000 +0100 ++++ meson.build 2022-09-27 13:21:26.428517668 +0100 +@@ -2,7 +2,7 @@ + 'wayland', 'c', + version: '1.21.0', + license: 'MIT', +- meson_version: '>= 0.56.0', ++ meson_version: '>= 0.55.1', + default_options: [ + 'warning_level=2', + 'buildtype=debugoptimized', diff --git a/build_files/build_environment/windows/build_deps.cmd b/build_files/build_environment/windows/build_deps.cmd index d836a6a3a50..d3879f3d6ae 100644 --- a/build_files/build_environment/windows/build_deps.cmd +++ b/build_files/build_environment/windows/build_deps.cmd @@ -48,10 +48,13 @@ if "%4" == "nobuild" set dobuild=0 REM If Python is be available certain deps may try to REM to use this over the version we build, to prevent that -REM make sure python is NOT in the path -for %%X in (python.exe) do (set PYTHON=%%~$PATH:X) -if EXIST "%PYTHON%" ( - echo PYTHON found at %PYTHON% dependencies cannot be build with python available in the path +REM make sure pythonw is NOT in the path. We look for pythonw.exe +REM since windows apparently ships a python.exe that just opens up +REM the windows store but does not ship any actual python files that +REM could cause issues. +for %%X in (pythonw.exe) do (set PYTHONW=%%~$PATH:X) +if EXIST "%PYTHONW%" ( + echo PYTHON found at %PYTHONW% dependencies cannot be build with python available in the path goto exit ) |