Skip to content

Commit

Permalink
[open3d] fix finding of blas/lapack libraries
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya committed Oct 29, 2024
1 parent 4738138 commit 240ed42
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 3 deletions.
41 changes: 41 additions & 0 deletions ports/open3d/0002-blas.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
diff --git a/3rdparty/find_dependencies.cmake b/3rdparty/find_dependencies.cmake
index d694621ad..a2b45e8ff 100644
--- a/3rdparty/find_dependencies.cmake
+++ b/3rdparty/find_dependencies.cmake
@@ -1597,11 +1597,29 @@ else(OPEN3D_USE_ONEAPI_PACKAGES)
find_package(LAPACKE)
if(BLAS_FOUND AND LAPACK_FOUND AND LAPACKE_FOUND)
message(STATUS "System BLAS/LAPACK/LAPACKE found.")
- list(APPEND Open3D_3RDPARTY_PRIVATE_TARGETS_FROM_SYSTEM
- ${BLAS_LIBRARIES}
- ${LAPACK_LIBRARIES}
- ${LAPACKE_LIBRARIES}
- )
+ if("${BLAS_LIBRARIES}" MATCHES ".*openblas.*")
+ find_package(OpenBLAS)
+ if(OpenBLAS_FOUND)
+ list(APPEND Open3D_3RDPARTY_PRIVATE_TARGETS_FROM_SYSTEM OpenBLAS::OpenBLAS)
+ endif()
+ endif()
+ if(NOT TARGET OpenBlas::OpenBLAS)
+ if(TARGET BLAS::BLAS)
+ list(APPEND Open3D_3RDPARTY_PRIVATE_TARGETS_FROM_SYSTEM BLAS::BLAS)
+ else()
+ list(APPEND Open3D_3RDPARTY_PRIVATE_TARGETS_FROM_SYSTEM ${BLAS_LIBRARIES})
+ endif()
+ endif()
+ if(TARGET LAPACK::LAPACK)
+ list(APPEND Open3D_3RDPARTY_PRIVATE_TARGETS_FROM_SYSTEM LAPACK::LAPACK)
+ else()
+ list(APPEND Open3D_3RDPARTY_PRIVATE_TARGETS_FROM_SYSTEM ${LAPACK_LIBRARIES})
+ endif()
+ if(TARGET LAPACK::LAPACKE)
+ list(APPEND Open3D_3RDPARTY_PRIVATE_TARGETS_FROM_SYSTEM LAPACK::LAPACKE)
+ else()
+ list(APPEND Open3D_3RDPARTY_PRIVATE_TARGETS_FROM_SYSTEM ${LAPACKE_LIBRARIES})
+ endif()
else()
message(STATUS "System BLAS/LAPACK/LAPACKE not found, setting USE_SYSTEM_BLAS=OFF.")
set(USE_SYSTEM_BLAS OFF)
--
2.45.2
1 change: 1 addition & 0 deletions ports/open3d/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions ports/open3d/vcpkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,9 @@
]
},
"blas": {
"description": "Use BLAS/LAPACK/LAPACKE instead of MKL",
"description": "Use BLAS, LAPACK, and LAPACKE",
"dependencies": [
"blas",
"lapack",
{
"name": "lapack-reference",
"features": [
Expand Down
2 changes: 1 addition & 1 deletion versions/o-/open3d.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"versions": [
{
"git-tree": "d9454d03d3c0f08fbd18f29cc4715b031f824bd9",
"git-tree": "91ea7e67e84d7a715f9945b103b5f8f47ee04563",
"version-semver": "0.18.0",
"port-version": 0
}
Expand Down

0 comments on commit 240ed42

Please sign in to comment.