Build: Changes for make deps to work on Linux arm64 again

This is not an officially supported platform, but it was working before
so might as well keep it up to date.

* Tweak logic for various BLENDER_PLATFORM_ARM checks
* Use linux_arm64 name for folders, matching Windows and macOS
* CUDA is enabled, SYCL and HIP are not
* Tested to work on Rocky Linux 8
This commit is contained in:
Brecht Van Lommel
2024-07-12 12:01:29 +02:00
parent f068b6c6d4
commit b74dfa8cfc
10 changed files with 59 additions and 33 deletions

View File

@@ -161,6 +161,9 @@ CPU:=$(shell uname -m)
ifeq ($(CPU),x86_64) ifeq ($(CPU),x86_64)
CPU:=x64 CPU:=x64
endif endif
ifeq ($(CPU),aarch64)
CPU:=arm64
endif
ifeq ($(OS_NCASE),darwin) ifeq ($(OS_NCASE),darwin)
OS_LIBDIR:=macos OS_LIBDIR:=macos
else else

View File

@@ -91,15 +91,13 @@ if(NOT APPLE)
include(cmake/xr_openxr.cmake) include(cmake/xr_openxr.cmake)
if(NOT BLENDER_PLATFORM_ARM) if(NOT BLENDER_PLATFORM_ARM)
include(cmake/hiprt.cmake) include(cmake/hiprt.cmake)
endif()
if(NOT BLENDER_PLATFORM_WINDOWS_ARM)
include(cmake/dpcpp.cmake) include(cmake/dpcpp.cmake)
include(cmake/dpcpp_deps.cmake) include(cmake/dpcpp_deps.cmake)
endif() if(NOT WIN32)
if(NOT WIN32) include(cmake/igc.cmake)
include(cmake/igc.cmake) include(cmake/gmmlib.cmake)
include(cmake/gmmlib.cmake) include(cmake/ocloc.cmake)
include(cmake/ocloc.cmake) endif()
endif() endif()
endif() endif()
include(cmake/ispc.cmake) include(cmake/ispc.cmake)

View File

@@ -36,7 +36,7 @@ if(NOT BLENDER_PLATFORM_ARM)
) )
endif() endif()
if(NOT APPLE) if(NOT APPLE AND NOT BLENDER_PLATFORM_ARM)
if(WIN32) if(WIN32)
# Levels below -O2 don't work well for Embree+SYCL. # 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}) 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 INSTALL_DIR ${LIBDIR}/embree
) )
if(NOT APPLE) if(NOT APPLE AND NOT BLENDER_PLATFORM_ARM)
add_dependencies( add_dependencies(
external_embree external_embree
external_tbb external_tbb

View File

@@ -56,17 +56,13 @@ else()
set(GMP_OPTIONS --enable-static --disable-shared ) set(GMP_OPTIONS --enable-static --disable-shared )
endif() endif()
if(APPLE AND NOT BLENDER_PLATFORM_ARM) if(UNIX)
set(GMP_OPTIONS if(NOT (APPLE AND BLENDER_PLATFORN_ARM))
${GMP_OPTIONS} set(GMP_OPTIONS ${GMP_OPTIONS} --with-pic)
--with-pic endif()
) if(NOT (APPLE OR BLENDER_PLATFORM_ARM))
elseif(UNIX AND NOT APPLE) set(GMP_OPTIONS ${GMP_OPTIONS} --enable-fat)
set(GMP_OPTIONS endif()
${GMP_OPTIONS}
--with-pic
--enable-fat
)
endif() endif()
# Boolean crashes with Arm assembly, see #103423. # Boolean crashes with Arm assembly, see #103423.

View File

@@ -21,18 +21,22 @@ else()
-DLEVEL_ZERO_ROOT=${LIBDIR}/level-zero -DLEVEL_ZERO_ROOT=${LIBDIR}/level-zero
) )
# x64 platforms support SyCL, ARM64 don't # x64 platforms support SyCL and HIP, ARM64 doesn't
if(NOT BLENDER_PLATFORM_WINDOWS_ARM) if(NOT BLENDER_PLATFORM_ARM)
set(OIDN_EXTRA_ARGS set(OIDN_EXTRA_ARGS
${OIDN_EXTRA_ARGS} ${OIDN_EXTRA_ARGS}
-DOIDN_DEVICE_SYCL=ON -DOIDN_DEVICE_SYCL=ON
-DOIDN_DEVICE_SYCL_AOT=OFF -DOIDN_DEVICE_SYCL_AOT=OFF
-DOIDN_DEVICE_CUDA=ON -DOIDN_DEVICE_CUDA=ON
-DOIDN_DEVICE_HIP=ON) -DOIDN_DEVICE_HIP=ON)
elseif(UNIX)
set(OIDN_EXTRA_ARGS
${OIDN_EXTRA_ARGS}
-DOIDN_DEVICE_CUDA=ON)
endif() endif()
endif() endif()
if(WIN32 AND NOT BLENDER_PLATFORM_WINDOWS_ARM) if(WIN32 AND NOT BLENDER_PLATFORM_ARM)
set(OIDN_EXTRA_ARGS set(OIDN_EXTRA_ARGS
${OIDN_EXTRA_ARGS} ${OIDN_EXTRA_ARGS}
-DTBB_DEBUG_LIBRARY=${LIBDIR}/tbb/lib/tbb.lib -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" -DCMAKE_EXE_LINKER_FLAGS=-L"${LIBDIR}/dpcpp/lib"
) )
else() else()
if(NOT (APPLE OR BLENDER_PLATFORM_WINDOWS_ARM)) if(NOT (APPLE OR BLENDER_PLATFORM_ARM))
set(OIDN_EXTRA_ARGS set(OIDN_EXTRA_ARGS
${OIDN_EXTRA_ARGS} ${OIDN_EXTRA_ARGS}
-DCMAKE_CXX_COMPILER=${LIBDIR}/dpcpp/bin/clang++ -DCMAKE_CXX_COMPILER=${LIBDIR}/dpcpp/bin/clang++
@@ -99,7 +103,7 @@ add_dependencies(
external_python external_python
) )
if(UNIX AND NOT APPLE) if(NOT (APPLE OR BLENDER_PLATFORM_ARM))
add_dependencies( add_dependencies(
external_openimagedenoise external_openimagedenoise
external_dpcpp external_dpcpp

View File

@@ -40,7 +40,15 @@ yum -y install scl-utils-build
yum -y install gcc-toolset-11 yum -y install gcc-toolset-11
# Repository for CUDA (`nvcc`). # 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. # Install packages needed for Blender's dependencies.
PACKAGES_FOR_LIBS=( PACKAGES_FOR_LIBS=(

View File

@@ -16,3 +16,15 @@
| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | 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

View File

@@ -16,7 +16,11 @@ else()
set(LIBDIR_NATIVE_ABI ${CMAKE_SOURCE_DIR}/../lib/${LIBDIR_NAME}) set(LIBDIR_NATIVE_ABI ${CMAKE_SOURCE_DIR}/../lib/${LIBDIR_NAME})
# Path to precompiled libraries with known glibc 2.28 ABI. # 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. # Choose the best suitable libraries.
if(EXISTS ${LIBDIR_NATIVE_ABI}) if(EXISTS ${LIBDIR_NATIVE_ABI})

View File

@@ -108,6 +108,8 @@ def get_effective_architecture(args: argparse.Namespace) -> str:
# Normalize the architecture name. # Normalize the architecture name.
if architecture in {"x86_64", "amd64"}: if architecture in {"x86_64", "amd64"}:
architecture = "x64" architecture = "x64"
if architecture == "aarch64":
architecture = "arm64"
assert (architecture in {"x64", "arm64"}) assert (architecture in {"x64", "arm64"})

View File

@@ -102,12 +102,11 @@ else()
endif() endif()
# Keep until APPLE/ARM libraries are updated. # Keep until APPLE/ARM libraries are updated.
if(APPLE OR WIN32) if((APPLE AND CMAKE_OSX_ARCHITECTURES MATCHES arm64) OR
if(CMAKE_OSX_ARCHITECTURES MATCHES arm64 OR CMAKE_SYSTEM_PROCESSOR STREQUAL "ARM64") (CMAKE_SYSTEM_PROCESSOR MATCHES "ARM64|aarch64"))
list(APPEND INC_SYS list(APPEND INC_SYS
${IMATH_INCLUDE_DIRS} ${IMATH_INCLUDE_DIRS}
) )
endif()
endif() endif()
if(WITH_IMAGE_OPENJPEG) if(WITH_IMAGE_OPENJPEG)