From c290451a7051c3205d87e8cd49e6d03c6a391584 Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Thu, 28 Jul 2016 20:27:47 -0500 Subject: [PATCH] CMake: Bugfix: Also pick up cblas for the gsl link interface --- cmake/modules/FindGSL.cmake | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/cmake/modules/FindGSL.cmake b/cmake/modules/FindGSL.cmake index f45dd91064..744d56677f 100644 --- a/cmake/modules/FindGSL.cmake +++ b/cmake/modules/FindGSL.cmake @@ -18,11 +18,23 @@ # # This module exports # +# GSL_FOUND # GSL_LIBRARIES # GSL_INCLUDE_DIRS # GSL_LINKER_FLAGS # +# +# OK... It could be all so easy by just calling FindGSL.cmake (shipped with +# CMake around 3.2 onwards). Unfortunately this module sets up imported +# targets for the library it found (a feature). Unfortunately, portions of +# the target information seem to be cached and are thus incompatible with +# our notion of disabling and clearing a feature *sigh*. +# +# Further we support CMake from version 2.8.8 onwards and would have to do +# the manual work anyway. +# + SET(GSL_DIR "" CACHE PATH "An optional hint to a GSL installation") SET_IF_EMPTY(GSL_DIR "$ENV{GSL_DIR}") @@ -32,6 +44,17 @@ DEAL_II_FIND_LIBRARY(GSL_LIBRARY PATH_SUFFIXES lib${LIB_SUFFIX} lib64 lib ) +# +# Also pick up the cblas implementation. If libgslcblas.so (or similar) is +# found we assume that gsl has to be linked against this library, +# alternatively as a fall back try known system cblas names +# +DEAL_II_FIND_LIBRARY(GSL_CBLAS_LIBRARY + NAMES gslcblas cblas refcblas + HINTS ${GSL_DIR} + PATH_SUFFIXES lib${LIB_SUFFIX} lib64 lib + ) + DEAL_II_FIND_PATH(GSL_INCLUDE_DIR gsl/gsl_version.h HINTS ${GSL_DIR} PATH_SUFFIXES include @@ -40,9 +63,10 @@ DEAL_II_FIND_PATH(GSL_INCLUDE_DIR gsl/gsl_version.h DEAL_II_PACKAGE_HANDLE(GSL LIBRARIES REQUIRED GSL_LIBRARY + OPTIONAL GSL_CBLAS_LIBRARY INCLUDE_DIRS REQUIRED GSL_INCLUDE_DIR USER_INCLUDE_DIRS REQUIRED GSL_INCLUDE_DIR - CLEAR GSL_LIBRARY GSL_INCLUDE_DIR + CLEAR GSL_LIBRARY GSL_CBLAS_LIBRARY GSL_INCLUDE_DIR ) -- 2.39.5