Skip to content

Commit

Permalink
cmake: Only add -DACCELERATE_NEW_LAPACK definition if linking the mac…
Browse files Browse the repository at this point in the history
…OS Accelerate Framework (#8626)
  • Loading branch information
seisman authored Nov 20, 2024
1 parent fa3eda0 commit 0cb6920
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -230,11 +230,11 @@ else (CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin")
set (ACCELERATE_NEW_LAPACK 0)
endif (CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin")

if (HAVE_LAPACK AND ACCELERATE_NEW_LAPACK GREATER 0)
if (HAVE_LAPACK AND ACCELERATE_NEW_LAPACK GREATER 0 AND LAPACK_LIBRARIES MATCHES ".*Accelerate.*")
# Recent macOS with Darwin kernel > 22.4 needs this compiler flag:
add_compile_definitions(ACCELERATE_NEW_LAPACK)
message("-- Must add compiler flag -DACCELERATE_NEW_LAPACK definition for macOS kernel version ${CMAKE_HOST_SYSTEM_VERSION}")
endif (HAVE_LAPACK AND ACCELERATE_NEW_LAPACK GREATER 0)
endif (HAVE_LAPACK AND ACCELERATE_NEW_LAPACK GREATER 0 AND LAPACK_LIBRARIES MATCHES ".*Accelerate.*")

if (NOT DEFINED GMT_EXCLUDE_BLAS)
find_package (BLAS)
Expand Down

0 comments on commit 0cb6920

Please sign in to comment.