Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 37 additions & 1 deletion test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,43 @@ if (NOT DEFINED SCALAPACK_LIBRARIES)
set( SCALAPACK_LIBRARIES "mkl_scalapack_${int_};mkl_blacs_openmpi_${int_}" )
endif()
else()
set( SCALAPACK_LIBRARIES "scalapack" )
# Try to find ScaLAPACK on the local machine.
# First try find_package (some distributions provide a
# FindScaLAPACK.cmake or ScaLAPACKConfig.cmake).
find_package( ScaLAPACK QUIET )
if (SCALAPACK_FOUND)
if (TARGET ScaLAPACK::ScaLAPACK)
set( SCALAPACK_LIBRARIES ScaLAPACK::ScaLAPACK )
else()
set( SCALAPACK_LIBRARIES ${SCALAPACK_LIBRARIES} )
endif()
else()
# Fall back to find_library for scalapack.
find_library( SCALAPACK_LIBRARY
Comment thread
mgates3 marked this conversation as resolved.
Outdated
NAMES scalapack scalapack-openmpi scalapack-mpich
HINTS ${SCALAPACK_ROOT} $ENV{SCALAPACK_ROOT}
PATH_SUFFIXES lib lib64
)
Comment thread
axiomwang marked this conversation as resolved.
if (SCALAPACK_LIBRARY)
set( SCALAPACK_LIBRARIES ${SCALAPACK_LIBRARY} )
# Also look for BLACS library, which may be separate on
# some systems (e.g., older ScaLAPACK or custom builds).
get_filename_component( _scalapack_dir ${SCALAPACK_LIBRARY} DIRECTORY )
Comment thread
mgates3 marked this conversation as resolved.
Outdated
find_library( BLACS_LIBRARY
NAMES blacs blacs-openmpi blacs-mpich blacsCinit
HINTS ${_scalapack_dir}
NO_DEFAULT_PATH
)
if (BLACS_LIBRARY)
list( APPEND SCALAPACK_LIBRARIES ${BLACS_LIBRARY} )
endif()
unset( _scalapack_dir )
unset( BLACS_LIBRARY )
else()
set( SCALAPACK_LIBRARIES "none" )
endif()
unset( SCALAPACK_LIBRARY CACHE )
endif()
endif()
endif()
if (SCALAPACK_LIBRARIES STREQUAL "none")
Expand Down
Loading