From 43fe8a1279ae4a7013340bb74aa9c44d26c125e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=BCtzel?= Date: Fri, 29 Dec 2023 13:08:05 +0100 Subject: [PATCH] Support setting linker flags for BLAS and LAPACK libraries manually Fixes #626. --- .../cmake_modules/SuiteSparseBLAS.cmake | 11 +++++++++++ .../cmake_modules/SuiteSparseLAPACK.cmake | 6 ++++++ 2 files changed, 17 insertions(+) diff --git a/SuiteSparse_config/cmake_modules/SuiteSparseBLAS.cmake b/SuiteSparse_config/cmake_modules/SuiteSparseBLAS.cmake index 0656826639..ca241472d8 100644 --- a/SuiteSparse_config/cmake_modules/SuiteSparseBLAS.cmake +++ b/SuiteSparse_config/cmake_modules/SuiteSparseBLAS.cmake @@ -32,6 +32,17 @@ option ( SUITESPARSE_USE_64BIT_BLAS option ( BLA_STATIC "OFF (default): dynamic linking of BLAS. ON: static linking of BLAS" OFF ) +if ( DEFINED BLAS_LIBRARIES OR DEFINED BLAS_INCLUDE_DIRS ) + # User supplied variables for libraries and/or include directories. + # Use them as-is. + if ( SUITESPARSE_USE_64BIT_BLAS ) + set ( SuiteSparse_BLAS_integer "int64_t" ) + else ( ) + set ( SuiteSparse_BLAS_integer "int32_t" ) + endif ( ) + return ( ) +endif ( ) + #------------------------------------------------------------------------------- # look for a specific BLAS library #------------------------------------------------------------------------------- diff --git a/SuiteSparse_config/cmake_modules/SuiteSparseLAPACK.cmake b/SuiteSparse_config/cmake_modules/SuiteSparseLAPACK.cmake index 2ffe536241..82366e0aa5 100644 --- a/SuiteSparse_config/cmake_modules/SuiteSparseLAPACK.cmake +++ b/SuiteSparse_config/cmake_modules/SuiteSparseLAPACK.cmake @@ -20,6 +20,12 @@ cmake_minimum_required ( VERSION 3.22 ) +if ( DEFINED LAPACK_LIBRARIES OR DEFINED LAPACK_INCLUDE_DIRS ) + # User supplied variables for libraries and/or include directories. + # Use them as-is. + return ( ) +endif ( ) + if ( BLA_VENDOR STREQUAL "FLAME" ) find_library ( LAPACK_LIBRARY