diff --git a/3rdparty/find_dependencies.cmake b/3rdparty/find_dependencies.cmake index 129ccce7802..19172e8b333 100644 --- a/3rdparty/find_dependencies.cmake +++ b/3rdparty/find_dependencies.cmake @@ -1328,20 +1328,15 @@ if(BUILD_GUI) # We first search for these paths, and then search CMake's default # search path. LLVM version must be >= 7 to compile Filament. if (NOT CLANG_LIBDIR) - message(STATUS "Searching /usr/lib/llvm-[7..19]/lib/ for libc++, libc++abi and libunwind") + message(STATUS "Searching /usr/lib/llvm-[7..19]/lib/ for libc++ and libc++abi") foreach(llvm_ver RANGE 7 19) set(llvm_lib_dir "/usr/lib/llvm-${llvm_ver}/lib") find_library(CPP_LIBRARY c++ PATHS ${llvm_lib_dir} NO_DEFAULT_PATH) find_library(CPPABI_LIBRARY c++abi PATHS ${llvm_lib_dir} NO_DEFAULT_PATH) if (CPP_LIBRARY AND CPPABI_LIBRARY) - # libunwind.so is in /usr/lib/ in Ubuntu 20.04, but libunwind.so is in /usr/lib/llvm-/lib in Ubuntu 22.04+ - # The LLVM folder libunwind is needed in Ubuntu 22.04+ - find_library(UNWIND_LIBRARY unwind HINTS ${llvm_lib_dir}) - if (UNWIND_LIBRARY) - set(CLANG_LIBDIR ${llvm_lib_dir}) - message(STATUS "CLANG_LIBDIR found in ubuntu-default: ${CLANG_LIBDIR}") - break() - endif() + set(CLANG_LIBDIR ${llvm_lib_dir}) + message(STATUS "CLANG_LIBDIR found in ubuntu-default: ${CLANG_LIBDIR}") + break() endif() endforeach() endif() @@ -1372,16 +1367,15 @@ if(BUILD_GUI) if (CLANG_LIBDIR) message(STATUS "Using CLANG_LIBDIR: ${CLANG_LIBDIR}") else() - message(FATAL_ERROR "Cannot find matching libc++, libc++abi and libunwind libraries with version >=7.") + message(FATAL_ERROR "Cannot find matching libc++ and libc++abi libraries with version >=7.") endif() find_library(CPP_LIBRARY c++ PATHS ${CLANG_LIBDIR} REQUIRED NO_DEFAULT_PATH) find_library(CPPABI_LIBRARY c++abi PATHS ${CLANG_LIBDIR} REQUIRED NO_DEFAULT_PATH) - find_library(UNWIND_LIBRARY unwind HINTS ${CLANG_LIBDIR} REQUIRED) # Ensure that libstdc++ gets linked first. target_link_libraries(3rdparty_filament INTERFACE -lstdc++ - ${CPP_LIBRARY} ${CPPABI_LIBRARY} ${UNIWIND_LIBRARY}) - message(STATUS "Filament C++ libraries: ${CPP_LIBRARY} ${CPPABI_LIBRARY} ${UNWIND_LIBRARY}") + ${CPP_LIBRARY} ${CPPABI_LIBRARY}) + message(STATUS "Filament C++ libraries: ${CPP_LIBRARY} ${CPPABI_LIBRARY}") endif() if (APPLE) find_library(CORE_VIDEO CoreVideo) diff --git a/cpp/pybind/CMakeLists.txt b/cpp/pybind/CMakeLists.txt index 55cc7607dc9..e7a534a3eb3 100644 --- a/cpp/pybind/CMakeLists.txt +++ b/cpp/pybind/CMakeLists.txt @@ -101,11 +101,11 @@ if (BUILD_SHARED_LIBS) ) endif() # Include additional libraries that may be absent from the user system -# eg: libc++.so, libc++abi.so, libunwind.so (needed by filament) for Linux. +# eg: libc++.so, libc++abi.so (needed by filament) for Linux. # libc++.so is a linker script including libc++.so.1 and libc++abi.so, so append 1 to libc++.so set(PYTHON_EXTRA_LIBRARIES $) if (BUILD_GUI AND CMAKE_SYSTEM_NAME STREQUAL "Linux") - list(APPEND PYTHON_EXTRA_LIBRARIES ${CPP_LIBRARY}.1 ${CPPABI_LIBRARY} ${UNWIND_LIBRARY}) + list(APPEND PYTHON_EXTRA_LIBRARIES ${CPP_LIBRARY}.1 ${CPPABI_LIBRARY}) endif() if (WITH_OPENMP AND APPLE AND NOT BUILD_SHARED_LIBS) # Package libomp v11.1.0, if it is not installed. Later version cause crash on diff --git a/python/open3d/__init__.py b/python/open3d/__init__.py index 7dc62cb28ea..141bf426c50 100644 --- a/python/open3d/__init__.py +++ b/python/open3d/__init__.py @@ -46,12 +46,10 @@ def load_cdll(path): _win32_dll_dir = os.add_dll_directory(str(Path(__file__).parent)) if _build_config["BUILD_GUI"] and not (find_library("c++abi") or - find_library("c++") or - find_library("unwind")): - try: # Preload libc++.so, libc++abi.so and libunwind.so (required by filament) + find_library("c++")): + try: # Preload libc++.so and libc++abi.so (required by filament) load_cdll(str(next((Path(__file__).parent).glob("*c++abi.*")))) load_cdll(str(next((Path(__file__).parent).glob("*c++.*")))) - load_cdll(str(next((Path(__file__).parent).glob("*unwind.*")))) except StopIteration: # Not found: check system paths while loading pass diff --git a/util/install_deps_ubuntu.sh b/util/install_deps_ubuntu.sh index a27c9ed827b..3e359a1a6e7 100755 --- a/util/install_deps_ubuntu.sh +++ b/util/install_deps_ubuntu.sh @@ -21,7 +21,6 @@ deps=( clang libc++-dev libc++abi-dev - libunwind-dev libsdl2-dev ninja-build libxi-dev @@ -41,17 +40,11 @@ eval $( echo DISTRIB_RELEASE="$DISTRIB_RELEASE" ) if [ "$DISTRIB_ID" == "Ubuntu" -a "$DISTRIB_RELEASE" == "20.04" ]; then - # Ubuntu 20.04's clang/libc++-dev/libc++abi-dev are version 10. - # To build Filament from source, we need version 12+. - deps=("${deps[@]/clang/clang-12}") - deps=("${deps[@]/libc++-dev/libc++-12-dev}") - deps=("${deps[@]/libc++abi-dev/libc++abi-12-dev}") -elif [ "$DISTRIB_ID" == "Ubuntu" ] && dpkg --compare-versions "$DISTRIB_RELEASE" gt "20.04" ; then - # Ubuntu > 20.04 have libunwind-dev breaks libunwind-14-dev !! - deps=("${deps[@]/clang/clang-14}") - deps=("${deps[@]/libc++-dev/libc++-14-dev}") - deps=("${deps[@]/libc++abi-dev/libc++abi-14-dev}") - deps=("${deps[@]/libunwind-dev/libunwind-14-dev}") + # Ubuntu 20.04's clang/libc++-dev/libc++abi-dev are version 8, 10 or 12. + # To avoid dependence on libunwind, we don't want to use versions later than 10. + deps=("${deps[@]/clang/clang-10}") + deps=("${deps[@]/libc++-dev/libc++-10-dev}") + deps=("${deps[@]/libc++abi-dev/libc++abi-10-dev}") fi # Special case for ARM64