diff --git a/GNUmakefile b/GNUmakefile index 333afe353b6..724a76b03a8 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -161,6 +161,9 @@ CPU:=$(shell uname -m) ifeq ($(CPU),x86_64) CPU:=x64 endif +ifeq ($(CPU),aarch64) + CPU:=arm64 +endif ifeq ($(OS_NCASE),darwin) OS_LIBDIR:=macos else diff --git a/build_files/build_environment/CMakeLists.txt b/build_files/build_environment/CMakeLists.txt index 926a04852d0..879c3f086b8 100644 --- a/build_files/build_environment/CMakeLists.txt +++ b/build_files/build_environment/CMakeLists.txt @@ -91,15 +91,13 @@ if(NOT APPLE) include(cmake/xr_openxr.cmake) if(NOT BLENDER_PLATFORM_ARM) include(cmake/hiprt.cmake) - endif() - if(NOT BLENDER_PLATFORM_WINDOWS_ARM) 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) + if(NOT WIN32) + include(cmake/igc.cmake) + include(cmake/gmmlib.cmake) + include(cmake/ocloc.cmake) + endif() endif() endif() include(cmake/ispc.cmake) diff --git a/build_files/build_environment/cmake/embree.cmake b/build_files/build_environment/cmake/embree.cmake index e194fcf29de..eaa35c1bdd3 100644 --- a/build_files/build_environment/cmake/embree.cmake +++ b/build_files/build_environment/cmake/embree.cmake @@ -36,7 +36,7 @@ if(NOT BLENDER_PLATFORM_ARM) ) endif() -if(NOT APPLE) +if(NOT APPLE AND NOT BLENDER_PLATFORM_ARM) if(WIN32) # Levels below -O2 don't work well for Embree+SYCL. string(REGEX REPLACE "-O[A-Za-z0-9]" "" EMBREE_CLANG_CMAKE_CXX_FLAGS_DEBUG ${BLENDER_CLANG_CMAKE_C_FLAGS_DEBUG}) @@ -99,7 +99,7 @@ ExternalProject_Add(external_embree INSTALL_DIR ${LIBDIR}/embree ) -if(NOT APPLE) +if(NOT APPLE AND NOT BLENDER_PLATFORM_ARM) add_dependencies( external_embree external_tbb diff --git a/build_files/build_environment/cmake/gmp.cmake b/build_files/build_environment/cmake/gmp.cmake index e03c50d8140..830767efe58 100644 --- a/build_files/build_environment/cmake/gmp.cmake +++ b/build_files/build_environment/cmake/gmp.cmake @@ -56,17 +56,13 @@ else() set(GMP_OPTIONS --enable-static --disable-shared ) endif() -if(APPLE AND NOT BLENDER_PLATFORM_ARM) - set(GMP_OPTIONS - ${GMP_OPTIONS} - --with-pic - ) -elseif(UNIX AND NOT APPLE) - set(GMP_OPTIONS - ${GMP_OPTIONS} - --with-pic - --enable-fat - ) +if(UNIX) + if(NOT (APPLE AND BLENDER_PLATFORN_ARM)) + set(GMP_OPTIONS ${GMP_OPTIONS} --with-pic) + endif() + if(NOT (APPLE OR BLENDER_PLATFORM_ARM)) + set(GMP_OPTIONS ${GMP_OPTIONS} --enable-fat) + endif() endif() # Boolean crashes with Arm assembly, see #103423. diff --git a/build_files/build_environment/cmake/openimagedenoise.cmake b/build_files/build_environment/cmake/openimagedenoise.cmake index 7fde62c5cde..e295c17325d 100644 --- a/build_files/build_environment/cmake/openimagedenoise.cmake +++ b/build_files/build_environment/cmake/openimagedenoise.cmake @@ -21,18 +21,22 @@ else() -DLEVEL_ZERO_ROOT=${LIBDIR}/level-zero ) - # x64 platforms support SyCL, ARM64 don't - if(NOT BLENDER_PLATFORM_WINDOWS_ARM) + # x64 platforms support SyCL and HIP, ARM64 doesn't + if(NOT BLENDER_PLATFORM_ARM) set(OIDN_EXTRA_ARGS ${OIDN_EXTRA_ARGS} -DOIDN_DEVICE_SYCL=ON -DOIDN_DEVICE_SYCL_AOT=OFF -DOIDN_DEVICE_CUDA=ON -DOIDN_DEVICE_HIP=ON) + elseif(UNIX) + set(OIDN_EXTRA_ARGS + ${OIDN_EXTRA_ARGS} + -DOIDN_DEVICE_CUDA=ON) endif() endif() -if(WIN32 AND NOT BLENDER_PLATFORM_WINDOWS_ARM) +if(WIN32 AND NOT BLENDER_PLATFORM_ARM) set(OIDN_EXTRA_ARGS ${OIDN_EXTRA_ARGS} -DTBB_DEBUG_LIBRARY=${LIBDIR}/tbb/lib/tbb.lib @@ -48,7 +52,7 @@ if(WIN32 AND NOT BLENDER_PLATFORM_WINDOWS_ARM) -DCMAKE_EXE_LINKER_FLAGS=-L"${LIBDIR}/dpcpp/lib" ) else() - if(NOT (APPLE OR BLENDER_PLATFORM_WINDOWS_ARM)) + if(NOT (APPLE OR BLENDER_PLATFORM_ARM)) set(OIDN_EXTRA_ARGS ${OIDN_EXTRA_ARGS} -DCMAKE_CXX_COMPILER=${LIBDIR}/dpcpp/bin/clang++ @@ -99,7 +103,7 @@ add_dependencies( external_python ) -if(UNIX AND NOT APPLE) +if(NOT (APPLE OR BLENDER_PLATFORM_ARM)) add_dependencies( external_openimagedenoise external_dpcpp diff --git a/build_files/build_environment/linux/linux_rocky8_setup.sh b/build_files/build_environment/linux/linux_rocky8_setup.sh index 82e7651c46b..37e370055cc 100644 --- a/build_files/build_environment/linux/linux_rocky8_setup.sh +++ b/build_files/build_environment/linux/linux_rocky8_setup.sh @@ -40,7 +40,15 @@ yum -y install scl-utils-build yum -y install gcc-toolset-11 # Repository for CUDA (`nvcc`). -dnf config-manager --add-repo http://developer.download.nvidia.com/compute/cuda/repos/rhel8/$(uname -i)/cuda-rhel8.repo +CUDA_ARCH=$(uname -i) + +# For RHEL8 there is no aarch64 repo, instead use sbsa which works for device binaries. +# For RHEL9 there is an aarch64 repo, and this fallback will no longer be needed. +if [ "$CUDA_ARCH" = "aarch64" ]; then + CUDA_ARCH="sbsa" +fi + +dnf config-manager --add-repo http://developer.download.nvidia.com/compute/cuda/repos/rhel8/$CUDA_ARCH/cuda-rhel8.repo # Install packages needed for Blender's dependencies. PACKAGES_FOR_LIBS=( diff --git a/build_files/build_environment/patches/theora.diff b/build_files/build_environment/patches/theora.diff index 4436577816e..ecc48201125 100644 --- a/build_files/build_environment/patches/theora.diff +++ b/build_files/build_environment/patches/theora.diff @@ -16,3 +16,15 @@ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ +--- config.guess 2024-07-11 13:42:08.171028863 +0200 ++++ config.guess 2024-07-11 13:41:13.921323750 +0200 +@@ -861,6 +861,9 @@ + x86_64:Linux:*:*) + echo x86_64-unknown-linux-gnu + exit 0 ;; ++ aarch64:Linux:*:*) ++ echo aarch64-unknown-linux-gnu ++ exit 0 ;; + i*86:Linux:*:*) + # The BFD linker knows what the default object file format is, so + # first see if it will tell us. cd to the root directory to prevent diff --git a/build_files/cmake/platform/platform_unix.cmake b/build_files/cmake/platform/platform_unix.cmake index f6fd9f252db..c33b46d6d8e 100644 --- a/build_files/cmake/platform/platform_unix.cmake +++ b/build_files/cmake/platform/platform_unix.cmake @@ -16,7 +16,11 @@ else() set(LIBDIR_NATIVE_ABI ${CMAKE_SOURCE_DIR}/../lib/${LIBDIR_NAME}) # Path to precompiled libraries with known glibc 2.28 ABI. - set(LIBDIR_GLIBC228_ABI ${CMAKE_SOURCE_DIR}/lib/linux_x64) + if(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "aarch64") + set(LIBDIR_GLIBC228_ABI ${CMAKE_SOURCE_DIR}/lib/linux_arm64) + else() + set(LIBDIR_GLIBC228_ABI ${CMAKE_SOURCE_DIR}/lib/linux_x64) + endif() # Choose the best suitable libraries. if(EXISTS ${LIBDIR_NATIVE_ABI}) diff --git a/build_files/utils/make_update.py b/build_files/utils/make_update.py index cff7ecc3531..21e1c07b342 100755 --- a/build_files/utils/make_update.py +++ b/build_files/utils/make_update.py @@ -108,6 +108,8 @@ def get_effective_architecture(args: argparse.Namespace) -> str: # Normalize the architecture name. if architecture in {"x86_64", "amd64"}: architecture = "x64" + if architecture == "aarch64": + architecture = "arm64" assert (architecture in {"x64", "arm64"}) diff --git a/source/blender/imbuf/CMakeLists.txt b/source/blender/imbuf/CMakeLists.txt index 0f72ad12be6..ad5676cc40b 100644 --- a/source/blender/imbuf/CMakeLists.txt +++ b/source/blender/imbuf/CMakeLists.txt @@ -102,12 +102,11 @@ else() endif() # Keep until APPLE/ARM libraries are updated. -if(APPLE OR WIN32) - if(CMAKE_OSX_ARCHITECTURES MATCHES arm64 OR CMAKE_SYSTEM_PROCESSOR STREQUAL "ARM64") - list(APPEND INC_SYS - ${IMATH_INCLUDE_DIRS} - ) - endif() +if((APPLE AND CMAKE_OSX_ARCHITECTURES MATCHES arm64) OR + (CMAKE_SYSTEM_PROCESSOR MATCHES "ARM64|aarch64")) + list(APPEND INC_SYS + ${IMATH_INCLUDE_DIRS} + ) endif() if(WITH_IMAGE_OPENJPEG)