Skip to content

Commit

Permalink
Fail at build time if magma asked for but not found
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanlucf22 authored and nicolasbock committed Jul 11, 2022
1 parent 58c45cf commit 0360a4c
Showing 1 changed file with 20 additions and 21 deletions.
41 changes: 20 additions & 21 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -325,28 +325,27 @@ SET(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")


if(BML_MAGMA)
FIND_PACKAGE(MAGMA)
endif()

if (MAGMA_FOUND)
add_definitions(-DBML_USE_MAGMA)
message(STATUS
"MAGMA was found:\n"
" MAGMA_INCLUDE_DIRS: ${MAGMA_INCLUDE_DIRS}\n"
" MAGMA_LIBRARY_DIRS: ${MAGMA_LIBRARY_DIRS}\n"
" MAGMA_LIBRARIES: ${MAGMA_LIBRARIES}"
)
include_directories(${MAGMA_INCLUDE_DIRS})
if(BML_CUSOLVER)
add_definitions(-DBML_USE_CUSOLVER)
endif()
if(BML_ROCSOLVER)
add_definitions(-DBML_USE_ROCSOLVER)
message(STATUS "Search for MAGMA...")
find_package(MAGMA)

if (MAGMA_FOUND)
add_definitions(-DBML_USE_MAGMA)
message(STATUS
"MAGMA was found:\n"
" MAGMA_INCLUDE_DIRS: ${MAGMA_INCLUDE_DIRS}\n"
" MAGMA_LIBRARY_DIRS: ${MAGMA_LIBRARY_DIRS}\n"
" MAGMA_LIBRARIES: ${MAGMA_LIBRARIES}"
)
include_directories(${MAGMA_INCLUDE_DIRS})
if(BML_CUSOLVER)
add_definitions(-DBML_USE_CUSOLVER)
endif()
if(BML_ROCSOLVER)
add_definitions(-DBML_USE_ROCSOLVER)
endif()
else()
message(FATAL_ERROR "MAGMA was not found")
endif()
else()
message(STATUS
"MAGMA not found"
)
endif()

set(BML_SCALAPACK FALSE CACHE BOOL "Whether to use ScaLAPACK library")
Expand Down

0 comments on commit 0360a4c

Please sign in to comment.