diff --git a/modules/find/FindBLASEXT.cmake b/modules/find/FindBLASEXT.cmake index aa65c9e4e60df10fb2453071ac748d52b88a3f8b..c8ce0833e7b62baa53e972cfb5bbb444350f17c7 100644 --- a/modules/find/FindBLASEXT.cmake +++ b/modules/find/FindBLASEXT.cmake @@ -1,9 +1,10 @@ ### # -# @copyright (c) 2012-2020 Inria. All rights reserved. +# @copyright (c) 2012-2024 Inria. All rights reserved. # @copyright (c) 2012-2014 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, Univ. Bordeaux. All rights reserved. # -# Copyright 2021 Florent Pruvost +# Copyright 2012-2024 Mathieu Faverge +# Copyright 2013-2024 Florent Pruvost # # Distributed under the OSI-approved BSD License (the "License"); # see accompanying file MORSE-Copyright.txt for details. @@ -113,6 +114,23 @@ if (BLAS_FOUND) endif(BLAS_LIBRARIES MATCHES "libmkl") + # number of theads function detection + if(BLAS_LIBRARIES MATCHES "libblis|libmkl|libopenblas") + include(CheckFortranFunctionExists) + set(CMAKE_REQUIRED_LIBRARIES "${BLAS_LIBRARIES}") + if(BLAS_LIBRARIES MATCHES "libblis") + unset(HAVE_BLI_THREAD_SET_NUM_THREADS CACHE) + check_fortran_function_exists(bli_thread_set_num_threads HAVE_BLI_THREAD_SET_NUM_THREADS) + elseif(BLAS_LIBRARIES MATCHES "libmkl") + unset(HAVE_MKL_SET_NUM_THREADS CACHE) + check_fortran_function_exists(mkl_set_num_threads HAVE_MKL_SET_NUM_THREADS) + elseif(BLAS_LIBRARIES MATCHES "libopenblas") + unset(HAVE_OPENBLAS_SET_NUM_THREADS CACHE) + check_fortran_function_exists(openblas_set_num_threads HAVE_OPENBLAS_SET_NUM_THREADS) + endif() + set(CMAKE_REQUIRED_LIBRARIES) + endif() + else(BLAS_FOUND) if(NOT BLASEXT_FIND_QUIETLY) message(STATUS "FindBLASEXT: BLAS not found or BLAS_LIBRARIES does not match mkl") diff --git a/modules/find/FindCBLAS.cmake b/modules/find/FindCBLAS.cmake index 0991c66b7f7ce6d88c6b433555e3c2ad73c2b24c..afede06003dfd8513235872a14be956c91d45d98 100644 --- a/modules/find/FindCBLAS.cmake +++ b/modules/find/FindCBLAS.cmake @@ -1,12 +1,12 @@ ### # -# @copyright (c) 2012-2020 Inria. All rights reserved. +# @copyright (c) 2012-2024 Inria. All rights reserved. # @copyright (c) 2012-2014 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, Univ. Bordeaux. All rights reserved. # # Copyright 2012-2013 Emmanuel Agullo -# Copyright 2012-2013 Mathieu Faverge +# Copyright 2012-2024 Mathieu Faverge # Copyright 2012 Cedric Castagnede -# Copyright 2013-2020 Florent Pruvost +# Copyright 2013-2024 Florent Pruvost # # Distributed under the OSI-approved BSD License (the "License"); # see accompanying file MORSE-Copyright.txt for details. @@ -171,8 +171,12 @@ macro(cblas_check_include) # Try to find the cblas header in the given paths # ------------------------------------------------- - if (CBLAS_LIBRARIES MATCHES "libmkl") - set(CBLAS_hdrs_to_find "mkl.h") + if (CBLAS_LIBRARIES MATCHES "libblis") + set(CBLAS_hdrs_to_find "blis.h;cblas.h") + elseif(CBLAS_LIBRARIES MATCHES "libmkl") + set(CBLAS_hdrs_to_find "mkl.h;mkl_cblas.h;mkl_service.h") + elseif(CBLAS_LIBRARIES MATCHES "libopenblas") + set(CBLAS_hdrs_to_find "cblas.h;openblas_config.h") else() set(CBLAS_hdrs_to_find "cblas.h") endif() @@ -181,7 +185,7 @@ macro(cblas_check_include) # ---------------------------------------- morse_find_path(CBLAS HEADERS ${CBLAS_hdrs_to_find} - SUFFIXES "include" "include/cblas") + SUFFIXES "include" "include/blis" "include/cblas" "include/mkl") endif() diff --git a/modules/find/FindLAPACKEXT.cmake b/modules/find/FindLAPACKEXT.cmake index d42f0d01316ca44710d04576b3b349b188d6abde..1ed4308567e4f3b88a4df2f6e68c2734b66fc65e 100644 --- a/modules/find/FindLAPACKEXT.cmake +++ b/modules/find/FindLAPACKEXT.cmake @@ -3,7 +3,8 @@ # @copyright (c) 2012-2020 Inria. All rights reserved. # @copyright (c) 2012-2014 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, Univ. Bordeaux. All rights reserved. # -# Copyright 2021 Florent Pruvost +# Copyright 2012-2024 Mathieu Faverge +# Copyright 2013-2024 Florent Pruvost # # Distributed under the OSI-approved BSD License (the "License"); # see accompanying file MORSE-Copyright.txt for details.