Skip to content

Commit

Permalink
hunter: add option WITH_OPENBLAS providing LAPACK for ceres
Browse files Browse the repository at this point in the history
OpenBLAS is expected to be built with LAPACK support.

Change-Id: I978ad27eb02ac0562eb97913a4fdb4d975df2b20
  • Loading branch information
NeroBurner committed Oct 25, 2023
1 parent a4c56f7 commit dd420bb
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ endif()
# language definition.
option(USE_CUDA "Enable use of CUDA linear algebra solvers." ON)
option(LAPACK "Enable use of LAPACK directly within Ceres." ON)
option(WITH_OPENBLAS "Build against OpenBLAS providing BLAS/LAPACK to use directly within Ceres." OFF)
# Template specializations for the Schur complement based solvers. If
# compile time, binary size or compiler performance is an issue, you
# may consider disabling this.
Expand Down Expand Up @@ -276,6 +277,13 @@ if (NOT USE_CUDA)
list(APPEND CERES_COMPILE_OPTIONS CERES_NO_CUDA)
endif (NOT USE_CUDA)

if (WITH_OPENBLAS)
hunter_add_package(OpenBLAS)
find_package(OpenBLAS CONFIG REQUIRED)
message("-- Found OpenBLAS library providing BLAS and LAPACK functionality")
set(LAPACK_FOUND ON)
set(LAPACK_LIBRARIES OpenBLAS::OpenBLAS)
else ()
if (LAPACK)
hunter_add_package(LAPACK)
find_package(LAPACK CONFIG QUIET)
Expand All @@ -292,6 +300,7 @@ else (LAPACK)
message("-- Building without LAPACK.")
list(APPEND CERES_COMPILE_OPTIONS CERES_NO_LAPACK)
endif (LAPACK)
endif()

# Set the install path for the installed CeresConfig.cmake configuration file
# relative to CMAKE_INSTALL_PREFIX.
Expand Down

0 comments on commit dd420bb

Please sign in to comment.