Skip to content

Commit

Permalink
src/CMakeList.txt: moved all about ACCELERATE_NEW_LAPACK here
Browse files Browse the repository at this point in the history
  • Loading branch information
remkos committed Nov 28, 2023
1 parent 8aaccd1 commit c852931
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
8 changes: 0 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -204,14 +204,6 @@ else (GSHHG_PATH)
set (GMT_CONFIG_GSHHG_MESSAGE "${GSHHG_PATH} (GMT will download on demand)")
endif (GSHHG_PATH)

# Need to know if macOS and kernel is >= 22.4.0 for newLapack syntax
if (CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin")
execute_process (COMMAND bash "-c" "echo ${CMAKE_HOST_SYSTEM_VERSION} | awk -F. '{if ($1 > 22 || ($1 == 22 && $2 > 3)) {print 1} else {print 0}}'"
OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE ACCELERATE_NEW_LAPACK)
else (CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin")
set (ACCELERATE_NEW_LAPACK 0)
endif (CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin")

# Configuration done
message(
"*\n"
Expand Down
6 changes: 0 additions & 6 deletions cmake/ConfigUserAdvancedTemplate.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -237,12 +237,6 @@ set (GMT_ENABLE_OPENMP TRUE)
# message("Add Xcode definition for GMT")
#endif()

#if (NEW_ACCELERATE_LAPACK GREATER 0)
# Recent macOS with Aarwin kernal > 22.4 needs this compiler flag:
add_definitions(-DACCELERATE_NEW_LAPACK)
message("-- Must add compiler flag -DACCELERATE_NEW_LAPACK definition for macOS kernel version ${CMAKE_HOST_SYSTEM_VERSION}")
#endif (NEW_ACCELERATE_LAPACK GREATER 0)

# Uncomment these two statements if you are a developer debugging GMT:
#add_definitions(-DDEBUG)
#add_definitions(-DMEMDEBUG) # Turn on memory tracking; see gmt_memory .c on MEMDEBUG for information
Expand Down
14 changes: 14 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,20 @@ else (LAPACK_FOUND)
endif (LAPACK_LIBRARY)
endif (LAPACK_FOUND)

# Need to know if macOS and kernel is >= 22.4.0 for newLapack syntax
if (CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin")
execute_process (COMMAND bash "-c" "echo ${CMAKE_HOST_SYSTEM_VERSION} | awk -F. '{if ($1 > 22 || ($1 == 22 && $2 > 3)) {print 1} else {print 0}}'"
OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE ACCELERATE_NEW_LAPACK)
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)
# Recent macOS with Aarwin 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)

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

0 comments on commit c852931

Please sign in to comment.