Skip to content

Commit

Permalink
cmake: workaround find_package bug that overrides forced cache BLAS_L…
Browse files Browse the repository at this point in the history
…IBRARIES

the symptom was that CMake needed to be configured twice if BLAS wasn't found.
  • Loading branch information
scivision committed Nov 21, 2022
1 parent 4517933 commit a973de6
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ else(LAPACK_FOUND)
find_package(LAPACK)
ENDIF(USE_OPTIMIZED_LAPACK_BLAS)
if(NOT LAPACK_FOUND)
unset(BLAS_LIBRARIES) # override "FALSE" variable that leaks from find_package(LAPACK) and Cache by defintion doesn't override
message(STATUS "--> LAPACK and BLAS were not found. Reference LAPACK and BLAS will be downloaded and installed")
SET(LAPACK_LIBRARIES ${SCALAPACK_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}/liblapack${CMAKE_STATIC_LIBRARY_SUFFIX} CACHE STRING "LAPACK library" FORCE)
SET(BLAS_LIBRARIES ${SCALAPACK_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}/libblas${CMAKE_STATIC_LIBRARY_SUFFIX} CACHE STRING "BLAS library" FORCE)
Expand Down

0 comments on commit a973de6

Please sign in to comment.