Line 0
Link Here
|
|
|
1 |
AC_DEFUN([ACX_CBLAS],[ |
2 |
use_cblas=no |
3 |
use_cblas_libs="-L/opt/intel/mkl/10.0.5.025/lib/32 -liomp5 -lpthread -lcblas -lblas" |
4 |
use_cblas_cflags="" |
5 |
|
6 |
AC_ARG_WITH(cblas, |
7 |
[AS_HELP_STRING([--with-cblas], [use external CBLAS library (default is no)])]) |
8 |
|
9 |
case $with_cblas in |
10 |
yes) use_cblas=yes ;; |
11 |
no | "" ) use_cblas=no ;; |
12 |
-* | */* | *.a | *.so | *.so.* | *.o) use_cblas_libs="$with_cblas" ;; |
13 |
*) use_cblas_libs="-l$with_cblas" ;; |
14 |
esac |
15 |
|
16 |
AC_ARG_WITH(cblas-libs, |
17 |
[AS_HELP_STRING([--with-cblas-libs=<libs>], |
18 |
[external cblas libraries to link with (default is "$use_cblas_libs")])], |
19 |
[use_cblas_libs=$withval], []) |
20 |
|
21 |
AC_ARG_WITH(cblas-cflags, |
22 |
[AS_HELP_STRING([--with-cblas-cflags=<flags>], |
23 |
[extra cflags to compile with external cblas ("-I<dir>")])], |
24 |
[use_cblas_cflags=$withval], []) |
25 |
|
26 |
if test x$use_cblas != xno; then |
27 |
if test "x$CBLAS_LIBS" = x; then |
28 |
CBLAS_LIBS="$use_cblas_libs" |
29 |
fi |
30 |
if test "x$CBLAS_FLAGS" = x; then |
31 |
CBLAS_CFLAGS="$use_cblas_cflags" |
32 |
fi |
33 |
|
34 |
CFLAGS_sav="$CFLAGS" |
35 |
CFLAGS="$CFLAGS $CBLAS_CFLAGS" |
36 |
AC_CHECK_HEADER(cblas.h, , |
37 |
[AC_MSG_ERROR([ |
38 |
*** Header file cblas.h not found. |
39 |
*** If you installed cblas header in a non standard place, |
40 |
*** specify its install prefix using the following option |
41 |
*** --with-cblas-cflags="-I<include_dir>"]) |
42 |
]) |
43 |
CFLAGS="$CFLAGS_sav" |
44 |
|
45 |
LIBS_sav="$LIBS" |
46 |
LIBS="$LIBS $CBLAS_LIBS -lm" |
47 |
AC_MSG_CHECKING([for cblas_sgemm in $CBLAS_LIBS]) |
48 |
AC_TRY_LINK_FUNC(cblas_sgemm, [use_cblas=yes], |
49 |
[AC_MSG_ERROR([ |
50 |
*** Linking with cblas with $LIBS failed. |
51 |
*** If you installed cblas library in a non standard place, |
52 |
*** specify its install prefix using the following option |
53 |
*** --with-cblas-libs="-L<lib_dir> -l<lib>"]) |
54 |
]) |
55 |
AC_MSG_RESULT($use_cblas) |
56 |
LIBS="$LIBS_sav" |
57 |
AC_SUBST(CBLAS_CFLAGS) |
58 |
AC_SUBST(CBLAS_LIBS) |
59 |
fi |
60 |
]) |