diff --git a/TPLsList.cmake b/TPLsList.cmake index 776288a4866d..0635187dcb9f 100644 --- a/TPLsList.cmake +++ b/TPLsList.cmake @@ -178,3 +178,15 @@ TRIBITS_REPOSITORY_DEFINE_TPLS( # ParMETIS include directories must come before the # Scotch include directories. # + + +# Temp hack for setting up TPL dependencies (until we support +# FindTPLDependencies.cmake files in #63). +advanced_set(LAPACK_LIB_ENABLED_DEPENDENCIES BLAS + CACHE STRING "LAPACK TPL deps") +advanced_set(ParMETIS_LIB_ENABLED_DEPENDENCIES METIS + CACHE STRING "ParMETIS TPL deps") +advanced_set(SuperLUDist_LIB_ENABLED_DEPENDENCIES ParMETIS BLAS + CACHE STRING "SuperLUDist TPL deps") +advanced_set(CUSPARSE_LIB_ENABLED_DEPENDENCIES CUBLAS + CACHE STRING "CUSPARSE TPL deps") diff --git a/cmake/TPLs/FindTPLCUBLAS.cmake b/cmake/TPLs/FindTPLCUBLAS.cmake index 8ce61e78e661..84b2cae78edc 100644 --- a/cmake/TPLs/FindTPLCUBLAS.cmake +++ b/cmake/TPLs/FindTPLCUBLAS.cmake @@ -63,8 +63,9 @@ ELSE() IF(CUDA_cublas_LIBRARY STREQUAL "CUDA_cublas_LIBRARY-NOTFOUND") MESSAGE(FATAL_ERROR "\nCUBLAS: could not find cublas library.") ENDIF() - GLOBAL_SET(TPL_CUBLAS_LIBRARY_DIRS) - GLOBAL_SET(TPL_CUBLAS_INCLUDE_DIRS ${TPL_CUDA_INCLUDE_DIRS}) - GLOBAL_SET(TPL_CUBLAS_LIBRARIES ${CUDA_cublas_LIBRARY}) + SET(TPL_CUBLAS_LIBRARIES ${CUDA_cublas_LIBRARY}) ENDIF() +tribits_tpl_find_include_dirs_and_libraries(CUBLAS REQUIRED_LIBS_NAMES cublas) + +unset(TPL_CUBLAS_LIBRARIES) diff --git a/cmake/TPLs/FindTPLCUSOLVER.cmake b/cmake/TPLs/FindTPLCUSOLVER.cmake index 7725cc028cfc..6750944c8b24 100644 --- a/cmake/TPLs/FindTPLCUSOLVER.cmake +++ b/cmake/TPLs/FindTPLCUSOLVER.cmake @@ -63,8 +63,9 @@ ELSE() IF(CUDA_cusolver_LIBRARY STREQUAL "CUDA_cusolver_LIBRARY-NOTFOUND") MESSAGE(FATAL_ERROR "\nCUSOLVER: could not find cusolver library.") ENDIF() - GLOBAL_SET(TPL_CUSOLVER_LIBRARY_DIRS) - GLOBAL_SET(TPL_CUSOLVER_INCLUDE_DIRS ${TPL_CUDA_INCLUDE_DIRS}) - GLOBAL_SET(TPL_CUSOLVER_LIBRARIES ${CUDA_cusolver_LIBRARY}) + SET(TPL_CUSOLVER_LIBRARIES ${CUDA_cusolver_LIBRARY}) ENDIF() +tribits_tpl_find_include_dirs_and_libraries(CUSOLVER REQUIRED_LIBS_NAMES cusparse) + +unset(TPL_CUSOLVER_LIBRARIES) diff --git a/cmake/TPLs/FindTPLCUSPARSE.cmake b/cmake/TPLs/FindTPLCUSPARSE.cmake index aad1e2bad762..b6a3859d1ffa 100644 --- a/cmake/TPLs/FindTPLCUSPARSE.cmake +++ b/cmake/TPLs/FindTPLCUSPARSE.cmake @@ -68,8 +68,9 @@ ELSE() MESSAGE(FATAL_ERROR "\nCUSPARSE: could not find cuspasre library.") ENDIF() ENDIF(CMAKE_VERSION VERSION_LESS "2.8.8") - GLOBAL_SET(TPL_CUSPARSE_LIBRARY_DIRS) - GLOBAL_SET(TPL_CUSPARSE_INCLUDE_DIRS ${TPL_CUDA_INCLUDE_DIRS}) - GLOBAL_SET(TPL_CUSPARSE_LIBRARIES ${CUDA_cusparse_LIBRARY}) + SET(TPL_CUSPARSE_LIBRARIES ${CUDA_cusparse_LIBRARY}) ENDIF() +tribits_tpl_find_include_dirs_and_libraries(CUSPARSE REQUIRED_LIBS_NAMES cusparse) + +unset(TPL_CUSPARSE_LIBRARIES) diff --git a/cmake/TPLs/FindTPLParMETIS.cmake b/cmake/TPLs/FindTPLParMETIS.cmake index ac97987e1713..e53218627b98 100644 --- a/cmake/TPLs/FindTPLParMETIS.cmake +++ b/cmake/TPLs/FindTPLParMETIS.cmake @@ -82,9 +82,7 @@ FUNCTION(CHECK_PARMETIS_HAS_VERSION_4_0_3 VARNAME) " ) - SET(CMAKE_REQUIRED_INCLUDES ${TPL_ParMETIS_INCLUDE_DIRS}) - SET(CMAKE_REQUIRED_LIBRARIES ${TPL_ParMETIS_LIBRARIES}) - SET(CMAKE_REQUIRED_FLAGS ${CMAKE_EXE_LINKER_FLAGS}) + SET(CMAKE_REQUIRED_LIBRARIES ParMETIS::all_libs) CHECK_C_SOURCE_COMPILES("${SOURCE}" ${VARNAME}) ENDFUNCTION() diff --git a/cmake/TPLs/FindTPLScotch.cmake b/cmake/TPLs/FindTPLScotch.cmake index f4de130a3c99..22c4c7c24860 100644 --- a/cmake/TPLs/FindTPLScotch.cmake +++ b/cmake/TPLs/FindTPLScotch.cmake @@ -94,9 +94,7 @@ FUNCTION(CHECK_SCOTCH_VERSION_6_0_3 VARNAME) } " ) - SET(CMAKE_REQUIRED_INCLUDES ${TPL_Scotch_INCLUDE_DIRS}) - SET(CMAKE_REQUIRED_LIBRARIES ${TPL_Scotch_LIBRARIES}) - SET(CMAKE_REQUIRED_FLAGS ${CMAKE_EXE_LINKER_FLAGS}) + SET(CMAKE_REQUIRED_LIBRARIES Scotch::all_libs) CHECK_C_SOURCE_COMPILES("${SOURCE}" ${VARNAME}) ENDFUNCTION() diff --git a/cmake/TPLs/FindTPLSuperLU.cmake b/cmake/TPLs/FindTPLSuperLU.cmake index 6ab392ccac8c..8446f0d4981c 100644 --- a/cmake/TPLs/FindTPLSuperLU.cmake +++ b/cmake/TPLs/FindTPLSuperLU.cmake @@ -89,9 +89,7 @@ int main() " ) - SET(CMAKE_REQUIRED_INCLUDES ${TPL_SuperLU_INCLUDE_DIRS}) - SET(CMAKE_REQUIRED_LIBRARIES ${TPL_SuperLU_LIBRARIES} ${TPL_METIS_LIBRARIES} ${TPL_BLAS_LIBRARIES}) - SET(CMAKE_REQUIRED_FLAGS ${CMAKE_EXE_LINKER_FLAGS}) + SET(CMAKE_REQUIRED_LIBRARIES SuperLU::all_libs ParMETIS::all_libs BLAS::all_libs) CHECK_C_SOURCE_COMPILES("${SOURCE}" ${VARNAME}) ENDFUNCTION() diff --git a/cmake/TPLs/FindTPLSuperLUDist.cmake b/cmake/TPLs/FindTPLSuperLUDist.cmake index 233e173b3d0e..e77da9d841c3 100644 --- a/cmake/TPLs/FindTPLSuperLUDist.cmake +++ b/cmake/TPLs/FindTPLSuperLUDist.cmake @@ -79,8 +79,7 @@ int main() " ) - SET(CMAKE_REQUIRED_INCLUDES ${TPL_SuperLUDist_INCLUDE_DIRS}) - SET(CMAKE_REQUIRED_LIBRARIES ${TPL_SuperLUDist_LIBRARIES} ${TPL_ParMETIS_LIBRARIES} ${TPL_METIS_LIBRARIES} ${TPL_BLAS_LIBRARIES}) + SET(CMAKE_REQUIRED_LIBRARIES SuperLUDist::all_libs ParMETIS::all_libs METIS::all_libs BLAS::all_libs) SET(CMAKE_REQUIRED_FLAGS ${CMAKE_EXE_LINKER_FLAGS}) CHECK_C_SOURCE_COMPILES("${SOURCE}" ${VARNAME}) ENDFUNCTION() @@ -101,8 +100,7 @@ int main() " ) - SET(CMAKE_REQUIRED_INCLUDES ${TPL_SuperLUDist_INCLUDE_DIRS}) - SET(CMAKE_REQUIRED_LIBRARIES ${TPL_SuperLUDist_LIBRARIES} ${TPL_ParMETIS_LIBRARIES} ${TPL_METIS_LIBRARIES} ${TPL_BLAS_LIBRARIES}) + SET(CMAKE_REQUIRED_LIBRARIES SuperLUDist::all_libs ParMETIS::all_libs METIS::all_libs BLAS::all_libs) SET(CMAKE_REQUIRED_FLAGS ${CMAKE_EXE_LINKER_FLAGS}) CHECK_C_SOURCE_COMPILES("${SOURCE}" ${VARNAME}) ENDFUNCTION()