Skip to content

Commit

Permalink
Updates for Scotch, now require >= 7.0.4.
Browse files Browse the repository at this point in the history
New scotch uses CMake installation.
  • Loading branch information
pghysels committed Jun 20, 2024
1 parent 0dd6012 commit 099e350
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 582 deletions.
51 changes: 17 additions & 34 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -441,46 +441,27 @@ if(NOT DEFINED metis_LIBRARIES)
endif()
find_package(METIS REQUIRED)


if(TPL_ENABLE_SCOTCH)
list(APPEND CMAKE_PREFIX_PATH
${TPL_SCOTCH_PREFIX} $ENV{SCOTCH_DIR} $ENV{SCOTCH_ROOT})
if(NOT DEFINED scotch_INCLUDE_DIR)
set(scotch_INCLUDE_DIR ${TPL_SCOTCH_INCLUDE_DIRS})
endif()
if(NOT DEFINED scotch_LIBRARY_DIR)
set(scotch_LIBRARY_DIR ${TPL_SCOTCH_LIBRARY_DIR})
endif()
if(NOT DEFINED scotch_LIBRARIES)
set(scotch_LIBRARIES ${TPL_SCOTCH_LIBRARIES})
endif()
${TPL_SCOTCH_PREFIX} $ENV{SCOTCH_DIR} $ENV{SCOTCH_ROOT}
${TPL_PTSCOTCH_PREFIX} $ENV{PTSCOTCH_DIR} $ENV{PTSCOTCH_ROOT})
find_package(SCOTCH)
if(SCOTCH_FOUND)
message("-- Found SCOTCH")
option(STRUMPACK_USE_SCOTCH "" ON)
if(SCOTCH_USES_PTHREADS)
message(STATUS "Scotch was compiled with pthread support, "
"looking for pthreads.")
find_package(Threads)
endif()
if(TPL_ENABLE_PTSCOTCH)
list(APPEND CMAKE_PREFIX_PATH
${TPL_PTSCOTCH_PREFIX} $ENV{PTSCOTCH_DIR} $ENV{PTSCOTCH_ROOT})
if(NOT DEFINED ptscotch_INCLUDE_DIR)
set(ptscotch_INCLUDE_DIR ${TPL_PTSCOTCH_INCLUDE_DIRS})
endif()
if(NOT DEFINED ptscotch_LIBRARY_DIR)
set(ptscotch_LIBRARY_DIR ${TPL_PTSCOTCH_LIBRARY_DIR})
endif()
if(NOT DEFINED ptscotch_LIBRARIES)
set(ptscotch_LIBRARIES ${TPL_PTSCOTCH_LIBRARIES})
endif()
find_package(PTSCOTCH)
if(PTSCOTCH_FOUND)
if(TARGET SCOTCH::ptscotch)
message("-- Found PTSCOTCH")
option(STRUMPACK_USE_PTSCOTCH "" ON)
else()
message(WARNING "SCOTCH was found, but does not contain PTSOTCH")
endif()
endif()
endif()
endif()


if(TPL_ENABLE_PARMETIS)
list(APPEND CMAKE_PREFIX_PATH
${TPL_PARMETIS_PREFIX} $ENV{PARMETIS_DIR} $ENV{PARMETIS_ROOT}
Expand All @@ -500,6 +481,7 @@ if(TPL_ENABLE_PARMETIS)
endif()
endif()


if(TPL_ENABLE_ZFP)
list(APPEND CMAKE_PREFIX_PATH ${TPL_ZFP_PREFIX}
$ENV{ZFP_ROOT} $ENV{ZFP_DIR})
Expand Down Expand Up @@ -672,14 +654,15 @@ if(ParMETIS_FOUND)
target_link_libraries(strumpack PUBLIC ParMETIS::parmetis)
endif()
target_link_libraries(strumpack PUBLIC METIS::metis)

if(SCOTCH_FOUND)
target_link_libraries(strumpack PUBLIC SCOTCH::scotch)
if(SCOTCH_USES_PTHREADS)
target_link_libraries(strumpack PUBLIC Threads::Threads)
target_link_libraries(strumpack PUBLIC SCOTCH::scotch SCOTCH::scotcherr)
if(STRUMPACK_USE_PTSCOTCH)
target_link_libraries(strumpack PUBLIC SCOTCH::ptscotch SCOTCH::ptscotcherr)
endif()
endif()
if(PTSCOTCH_FOUND)
target_link_libraries(strumpack PUBLIC PTSCOTCH::ptscotch)
# if(SCOTCH_USES_PTHREADS)
# target_link_libraries(strumpack PUBLIC Threads::Threads)
# endif()
endif()

if(ZFP_FOUND)
Expand Down
246 changes: 0 additions & 246 deletions cmake/Modules/FindPTSCOTCH.cmake

This file was deleted.

Loading

0 comments on commit 099e350

Please sign in to comment.