Skip to content

Commit

Permalink
Add prebuilt arm64 filament binaries
Browse files Browse the repository at this point in the history
  • Loading branch information
sitic committed Mar 24, 2024
1 parent 3977efb commit 857ba22
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 15 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ jobs:
# fix gfortran not found issue
ln -s $(which gfortran-13) /usr/local/bin/gfortran
# default Xcode 15.0.1 linker causes build issues
sudo xcode-select -switch /Applications/Xcode_15.2.app
# default Xcode 15.0.1 linker causes build issues, embree recommends clang <= 14 for arm64
sudo xcode-select -switch /Applications/Xcode_14.3.1.app
# arm64 big_sur (11.0) bottle
export LIBOMP_BOTTLE_HASH=f87f7841eb8b72650fa771af39642361aec371ea1a1f94f081ecc0e8168a0e75
Expand Down Expand Up @@ -214,8 +214,8 @@ jobs:
# fix gfortran not found issue
ln -s $(which gfortran-13) /usr/local/bin/gfortran
# default Xcode 15.0.1 linker causes build issues
sudo xcode-select -switch /Applications/Xcode_15.2.app
# default Xcode 15.0.1 linker causes build issues, embree recommends clang <= 14 for arm64
sudo xcode-select -switch /Applications/Xcode_14.3.1.app
# arm64 big_sur (11.0) bottle
export LIBOMP_BOTTLE_HASH=f87f7841eb8b72650fa771af39642361aec371ea1a1f94f081ecc0e8168a0e75
Expand Down
16 changes: 13 additions & 3 deletions 3rdparty/filament/filament_download.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,19 @@ else()
string(APPEND lib_dir /x86_64/md)
endif()
elseif(APPLE)
set(FILAMENT_URL https://github.com/google/filament/releases/download/v1.9.19/filament-v1.9.19-mac.tgz)
set(FILAMENT_SHA256 2765d0ce60647fc17d1880c4618cf7d6b5343d8be4dad87978c3917d9c723b4e)
string(APPEND lib_dir /x86_64)
if (APPLE_AARCH64)
## TODO: Update url
set(FILAMENT_URL https://github.com/sitic/filament/releases/download/filament/filament-v1.9.19-macos_arm64.tgz)
# set(FILAMENT_URL https://github.com/isl-org/open3d_downloads/releases/download/filament/filament-v1.9.19-macos_arm64.tgz)
set(FILAMENT_SHA256 3422bdff451d90144fbb69e625d8dcaeaf3222dc2c28879536067937955bc362)
string(APPEND lib_dir /arm64)
# Our arm64 builds use FILAMENT_SUPPORTS_VULKAN=OFF
list(REMOVE_ITEM filament_LIBRARIES bluevk)
else()
set(FILAMENT_URL https://github.com/google/filament/releases/download/v1.9.19/filament-v1.9.19-mac.tgz)
set(FILAMENT_SHA256 2765d0ce60647fc17d1880c4618cf7d6b5343d8be4dad87978c3917d9c723b4e)
string(APPEND lib_dir /x86_64)
endif()
else() # Linux: Check glibc version and use open3d filament binary if new (Ubuntu 20.04 and similar)
execute_process(COMMAND ldd --version OUTPUT_VARIABLE ldd_version)
string(REGEX MATCH "([0-9]+\.)+[0-9]+" glibc_version ${ldd_version})
Expand Down
17 changes: 10 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@ cmake_minimum_required(VERSION 3.20)
# CMake 3.20+ is required to:
# - detect IntelLLVM compiler for SYCL

if (APPLE)
set (CMAKE_OSX_DEPLOYMENT_TARGET "11.0" CACHE STRING
"Minimum OS X deployment version" FORCE)
endif()

# CMAKE_HOST_SYSTEM_PROCESSOR is only available after calling project(),
# which depends on ${OPEN3D_VERSION}, which depends on ${DEVELOPER_BUILD}.
if(UNIX AND NOT APPLE)
Expand All @@ -35,6 +30,11 @@ if(APPLE)
)
if(PROCESSOR_ARCH STREQUAL "arm64")
set(APPLE_AARCH64 TRUE)
set (CMAKE_OSX_DEPLOYMENT_TARGET "11.0" CACHE STRING
"Minimum OS X deployment version" FORCE)
else()
set (CMAKE_OSX_DEPLOYMENT_TARGET "10.15" CACHE STRING
"Minimum OS X deployment version" FORCE)
endif()
endif()

Expand Down Expand Up @@ -117,9 +117,12 @@ option(USE_SYSTEM_VTK "Use system pre-installed VTK" OFF
option(USE_SYSTEM_ZEROMQ "Use system pre-installed ZeroMQ" OFF)
if(LINUX_AARCH64 OR APPLE_AARCH64)
option(BUILD_VTK_FROM_SOURCE "Build VTK from source" ON )
option(BUILD_FILAMENT_FROM_SOURCE "Build filament from source" ON )
else()
option(BUILD_VTK_FROM_SOURCE "Build VTK from source" OFF)
endif()
if(LINUX_AARCH64)
option(BUILD_FILAMENT_FROM_SOURCE "Build filament from source" ON )
else()
option(BUILD_FILAMENT_FROM_SOURCE "Build filament from source" OFF)
endif()

Expand Down Expand Up @@ -198,7 +201,7 @@ cmake_policy(GET CMP0072 CMP0072_VALUE)
if ((LINUX_AARCH64 OR APPLE_AARCH64) AND BUILD_ISPC_MODULE)
message(FATAL_ERROR "ISPC module is not yet supported on ARM Linux")
endif()
if ((LINUX_AARCH64 OR APPLE_AARCH64) AND NOT BUILD_FILAMENT_FROM_SOURCE)
if (LINUX_AARCH64 AND NOT BUILD_FILAMENT_FROM_SOURCE)
message(FATAL_ERROR "ARM CPU detected, you must set BUILD_FILAMENT_FROM_SOURCE=ON.")
endif()
if ((LINUX_AARCH64 OR APPLE_AARCH64) AND NOT USE_BLAS)
Expand Down
2 changes: 1 addition & 1 deletion util/ci_utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ build_pip_package() {
echo "Building Open3D wheel"
options="$(echo "$@" | tr ' ' '|')"

BUILD_FILAMENT_FROM_SOURCE=ON
BUILD_FILAMENT_FROM_SOURCE=OFF
set +u
if [ -f "${OPEN3D_ML_ROOT}/set_open3d_ml_root.sh" ]; then
echo "Open3D-ML available at ${OPEN3D_ML_ROOT}. Bundling Open3D-ML in wheel."
Expand Down

0 comments on commit 857ba22

Please sign in to comment.