From ec4d3284e5b579cf980a1407ccafaf5d7724b97c Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Tue, 29 Oct 2024 05:58:32 -0700 Subject: [PATCH] [open3d] fix finding of blas/lapack libraries --- ports/open3d/0002-blas.patch | 19 +++++++++++++++++++ ports/open3d/portfile.cmake | 5 +++-- ports/open3d/vcpkg.json | 27 +++++++++++++-------------- versions/o-/open3d.json | 2 +- 4 files changed, 36 insertions(+), 17 deletions(-) create mode 100644 ports/open3d/0002-blas.patch diff --git a/ports/open3d/0002-blas.patch b/ports/open3d/0002-blas.patch new file mode 100644 index 00000000000000..09870e04879e1d --- /dev/null +++ b/ports/open3d/0002-blas.patch @@ -0,0 +1,19 @@ +diff --git a/3rdparty/find_dependencies.cmake b/3rdparty/find_dependencies.cmake +index d694621ad..49a5f899e 100644 +--- a/3rdparty/find_dependencies.cmake ++++ b/3rdparty/find_dependencies.cmake +@@ -1597,6 +1597,12 @@ else(OPEN3D_USE_ONEAPI_PACKAGES) + find_package(LAPACKE) + if(BLAS_FOUND AND LAPACK_FOUND AND LAPACKE_FOUND) + message(STATUS "System BLAS/LAPACK/LAPACKE found.") ++ if(TARGET BLAS::BLAS) ++ list(APPEND Open3D_3RDPARTY_PRIVATE_TARGETS_FROM_SYSTEM BLAS::BLAS) ++ endif() ++ if(TARGET LAPACK) ++ list(APPEND Open3D_3RDPARTY_PRIVATE_TARGETS_FROM_SYSTEM LAPACK::LAPACK) ++ endif() + list(APPEND Open3D_3RDPARTY_PRIVATE_TARGETS_FROM_SYSTEM + ${BLAS_LIBRARIES} + ${LAPACK_LIBRARIES} +-- +2.45.2 diff --git a/ports/open3d/portfile.cmake b/ports/open3d/portfile.cmake index 8a2219edc72433..b81e510eb6dbb4 100644 --- a/ports/open3d/portfile.cmake +++ b/ports/open3d/portfile.cmake @@ -8,6 +8,7 @@ vcpkg_from_github( HEAD_REF master PATCHES 0001-uvatlas.patch + 0002-blas.patch 0003-liblzf.patch 0004-tiny_gltf.patch 0005-jsoncpp.patch @@ -22,7 +23,7 @@ vcpkg_add_to_path(PREPEND "${GIT_PATH}") vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS FEATURES "gui" BUILD_GUI - "blas" USE_BLAS + "openblas" USE_OPENBLAS "intel-oneapi" OPEN3D_USE_ONEAPI_PACKAGES "sycl" BUILD_SYCL_MODULE "openmp" WITH_OPENMP @@ -49,7 +50,7 @@ vcpkg_cmake_configure( -DBUILD_AZURE_KINECT=${BUILD_AZURE_KINECT} -DBUILD_SYCL_MODULE=${BUILD_SYCL_MODULE} -DOPEN3D_USE_ONEAPI_PACKAGES=${OPEN3D_USE_ONEAPI_PACKAGES} - -DUSE_BLAS=${USE_BLAS} + -DUSE_BLAS=${USE_OPENBLAS} -DUSE_SYSTEM_BLAS=ON -DWITH_OPENMP=${WITH_OPENMP} -DUSE_SYSTEM_ASSIMP=ON diff --git a/ports/open3d/vcpkg.json b/ports/open3d/vcpkg.json index 9144020771f3cb..d02d8248751480 100644 --- a/ports/open3d/vcpkg.json +++ b/ports/open3d/vcpkg.json @@ -36,8 +36,8 @@ "zeromq" ], "default-features": [ - "blas", "gui", + "openblas", "openmp" ], "features": { @@ -47,19 +47,6 @@ "azure-kinect-sensor-sdk" ] }, - "blas": { - "description": "Use BLAS/LAPACK/LAPACKE instead of MKL", - "dependencies": [ - "blas", - "lapack", - { - "name": "lapack-reference", - "features": [ - "lapacke" - ] - } - ] - }, "gui": { "description": "Build the new GUI for Open3D", "dependencies": [ @@ -72,6 +59,18 @@ "intel-mkl" ] }, + "openblas": { + "description": "Use OpenBLAS, LAPACK, and LAPACKE", + "dependencies": [ + { + "name": "lapack-reference", + "features": [ + "lapacke" + ] + }, + "openblas" + ] + }, "openmp": { "description": "Use OpenMP multi-threading" }, diff --git a/versions/o-/open3d.json b/versions/o-/open3d.json index 8d7e1e93551d99..2d7a3a0cd4a1b0 100644 --- a/versions/o-/open3d.json +++ b/versions/o-/open3d.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "d9454d03d3c0f08fbd18f29cc4715b031f824bd9", + "git-tree": "5ee69ec3916f25be82ebd62e6e1f9044e63a18c8", "version-semver": "0.18.0", "port-version": 0 }