From df0039501864c5e86138af261bd10bded63c5de0 Mon Sep 17 00:00:00 2001 From: Thomas Purcell <purcell@fhi-berlin.mpg.de> Date: Wed, 8 Jul 2020 14:46:45 +0200 Subject: [PATCH] Better LAPACK finder and MPI search in CMake update those interfaces --- CMakeLists.txt | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 65e974c3..1547b6ba 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -86,28 +86,18 @@ include_directories(${Boost_INCLUDE_DIRS}) mark_as_advanced(PYTHON_INCLUDE_PATH Boost_LIBS) # Check BLAS/LAPACK -find_package(MKL REQUIRED) -if(MKL_FOUND) - include_directories(${MKL_INCLUDE_DIRS}) - set(LAPACK_LIBRARIES ${MKL_LIBRARIES}) -else() - find_package(LAPACK) - if(LPACK_FOUND) - set(LAPACK_LIBRARIES ${LAPACK_LIBRARIES}) - else() - message(FATAL_ERROR "LAPACK/BLAS not found") - endif() - target_link_libraries(mytest ${BLAS_LIBRARIES}) +set(BLA_VENDOR Intel10_64lp_seq) +find_package(LAPACK) +if(NOT LAPACK_FOUND) + set(BLA_VENDOR All) + find_package(LAPACK REQUIRED) endif() +message(STATUS "LAPACK_LIBRARIES = ${LAPACK_LIBRARIES}") # Check MPI -find_package(MPI) -if(MPI_CXX_FOUND) - include_directories(MPI_CXX_INCLUDE_DIRS) - set(MPI_LIBRARIES, MPI_CXX_LIBRARIES) -else() - message(FATAL_ERROR "MPI not found.") -endif() +find_package(MPI REQUIRED) +include_directories(MPI_CXX_INCLUDE_DIRS) +set(MPI_LIBRARIES, MPI_CXX_LIBRARIES) include_directories(${CMAKE_CURRENT_LIST_DIR}/src) add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/src) -- GitLab