Browse Source

Fix getting cblas_sgemv definition when it is available in the blas lib

Samuel Thibault 5 years ago
parent
commit
c66f457e96
4 changed files with 12 additions and 9 deletions
  1. 7 5
      configure.ac
  2. 2 2
      examples/common/blas.h
  3. 2 2
      examples/spmv/dw_block_spmv.h
  4. 1 0
      include/starpu_config.h.in

+ 7 - 5
configure.ac

@@ -3012,11 +3012,13 @@ if test x$blas_lib = xmaybe; then
     fi
 fi
 
-SAVED_LIBS="${LIBS}"
-LIBS="$LIBS $STARPU_BLAS_LDFLAGS"
-AC_CHECK_FUNC([cblas_sgemv], have_cblas_sgemv=yes)
-AM_CONDITIONAL(BLAS_LIB_HAS_CBLAS_SGEMV, test x$have_cblas_sgemv = xyes)
-LIBS="${SAVED_LIBS}"
+if test x$blas_lib = xsystem; then
+    AC_CHECK_HEADER([cblas.h], [have_cblas_h=yes], [have_cblas_h=no])
+fi
+AM_CONDITIONAL(BLAS_LIB_HAS_CBLAS_SGEMV, test x$have_cblas_h = xyes)
+if test x$have_cblas_h = xyes; then
+    AC_DEFINE(STARPU_BLAS_LIB_HAS_CBLAS_SGEMV, [1], [The blas library has cblas_sgemv])
+fi
 
 AM_CONDITIONAL(ATLAS_BLAS_LIB, test x$blas_lib = xatlas)
 AM_CONDITIONAL(GOTO_BLAS_LIB, test x$blas_lib = xgoto)

+ 2 - 2
examples/common/blas.h

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2009-2011,2014,2018                      Université de Bordeaux
+ * Copyright (C) 2009-2011,2014,2018,2020                 Université de Bordeaux
  * Copyright (C) 2012                                     Inria
  * Copyright (C) 2010,2015,2017                           CNRS
  *
@@ -21,7 +21,7 @@
 
 #include <starpu.h>
 
-#ifdef STARPU_ATLAS
+#if defined(STARPU_ATLAS) || defined(STARPU_BLAS_LIB_HAS_CBLAS_SGEMV)
 #include <cblas.h>
 #endif
 

+ 2 - 2
examples/spmv/dw_block_spmv.h

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2008-2011,2014,2017                      Université de Bordeaux
+ * Copyright (C) 2008-2011,2014,2017,2020                 Université de Bordeaux
  * Copyright (C) 2010,2013,2015,2017                      CNRS
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -24,7 +24,7 @@
 #include <math.h>
 #include <sys/types.h>
 #include <signal.h>
-#include <cblas.h>
+#include <common/blas.h>
 
 #include <starpu.h>
 

+ 1 - 0
include/starpu_config.h.in

@@ -71,6 +71,7 @@
 #undef STARPU_MKL
 #undef STARPU_ARMPL
 #undef STARPU_SYSTEM_BLAS
+#undef STARPU_BLAS_LIB_HAS_CBLAS_SGEMV
 
 #undef STARPU_OPENCL_DATADIR
 #undef STARPU_HAVE_MAGMA