]> https://gitweb.dealii.org/ - dealii.git/commitdiff
CMake: Bugfix: Also pick up cblas for the gsl link interface
authorMatthias Maier <tamiko@43-1.org>
Fri, 29 Jul 2016 01:27:47 +0000 (20:27 -0500)
committerMatthias Maier <tamiko@43-1.org>
Tue, 2 Aug 2016 00:00:04 +0000 (19:00 -0500)
cmake/modules/FindGSL.cmake

index f45dd91064c69ca3f558ccee64634a1057785b0b..744d56677f87c93f71b0af75d867484b7d98f2f8 100644 (file)
 #
 # 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
   )

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.