diff --git a/config/FindScaLAPACK.cmake b/config/FindScaLAPACK.cmake index 745fa95..f375976 100644 --- a/config/FindScaLAPACK.cmake +++ b/config/FindScaLAPACK.cmake @@ -76,10 +76,16 @@ unset(_SCALAPACK_LIBRARIES) if(SCALAPACK_FOUND) list(APPEND SCALAPACK_LIBRARIES ${_SCALAPACK_LIBRARY}) if(DEFINED BLAS_mkl_core_LIBRARY) + # For CMake <3.10, we need to set MPI_CXX_INCLUDE_DIRS + if((NOT MPI_CXX_INCLUDE_DIRS) AND MPI_CXX_INCLUDE_PATH) + set(MPI_CXX_INCLUDE_DIRS ${MPI_CXX_INCLUDE_PATH}) + endif() # Check whether SGI MPT is used try_compile(_SGI_MPT ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/config/check_sgimpt.cc + CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:STRING=${MPI_CXX_INCLUDE_DIRS}" + LINK_LIBRARIES ${MPI_CXX_LIBRARIES} OUTPUT_VARIABLE LOG) if(_SGI_MPT) find_library(_SCALAPACK_BLACS_LIBRARY @@ -91,6 +97,8 @@ if(SCALAPACK_FOUND) try_compile(_OPENMPI ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/config/check_openmpi.cc + CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:STRING=${MPI_CXX_INCLUDE_DIRS}" + LINK_LIBRARIES ${MPI_CXX_LIBRARIES} OUTPUT_VARIABLE LOG) if(_OPENMPI) find_library(_SCALAPACK_BLACS_LIBRARY @@ -108,9 +116,9 @@ if(SCALAPACK_FOUND) endif(_SGI_MPT) if(_SCALAPACK_BLACS_LIBRARY) list(APPEND SCALAPACK_LIBRARIES ${_SCALAPACK_BLACS_LIBRARY}) + message(STATUS "Add BLACS to ScaLAPACK: ${_SCALAPACK_BLACS_LIBRARY}") endif(_SCALAPACK_BLACS_LIBRARY) - else(DEFINED BLAS_mkl_core_LIBRARY) find_library(_BLACS_LIBRARY NAMES blacs blacs-openmpi blacs-mpich @@ -118,6 +126,7 @@ if(SCALAPACK_FOUND) DOC "The ScaLAPACK BLACS library") if(_BLACS_LIBRARY) list(APPEND SCALAPACK_LIBRARIES ${_BLACS_LIBRARY}) + message(STATUS "Add BLACS to ScaLAPACK: ${_BLACS_LIBRARY}") endif(_BLACS_LIBRARY) find_library(_BLACSCINIT_LIBRARY @@ -126,8 +135,8 @@ if(SCALAPACK_FOUND) DOC "The ScaLAPACK BLACS Cinit library") if(_BLACSCINIT_LIBRARY) list(APPEND SCALAPACK_LIBRARIES ${_BLACSCINIT_LIBRARY}) + message(STATUS "Add blacsCinit to ScaLAPACK: ${_BLACSCINIT_LIBRARY}") endif(_BLACSCINIT_LIBRARY) endif(DEFINED BLAS_mkl_core_LIBRARY) endif(SCALAPACK_FOUND) -