From e4338d24bacc7fba0628d663119c0473daa15c9e Mon Sep 17 00:00:00 2001 From: Sameer Sheorey Date: Wed, 14 Aug 2024 14:09:27 -0700 Subject: [PATCH] try fix arm64 TLS error Add TCM_ENABLE=1 to python --- CMakeLists.txt | 2 +- python/open3d/__init__.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 00f300f3e6f..dc2bdc62e15 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -505,7 +505,7 @@ endmacro() if (LINUX_AARCH64) # Fix for ImportError: ... /pybind.cpython-310-aarch64-linux-gnu.so: cannot allocate memory in static TLS block # https://bugs.launchpad.net/ubuntu/+source/mysql-8.0/+bug/1889851 - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ftls-model=global-dynamic") + add_compile_options("-ftls-model=global-dynamic") endif() # Include convenience functions diff --git a/python/open3d/__init__.py b/python/open3d/__init__.py index b5102eea50d..e8bf7ad2245 100644 --- a/python/open3d/__init__.py +++ b/python/open3d/__init__.py @@ -16,6 +16,9 @@ import os import sys os.environ["KMP_DUPLICATE_LIB_OK"] = "True" +# Enable thread composability manager to coordinate Intel OpenMP and TBB threads. Only works with Intel OpenMP. +# TBB must not be already loaded. +os.environ["TCM_ENABLE"] = "1" from ctypes import CDLL from ctypes.util import find_library from pathlib import Path