2017 |
02 Aug 09 |
peter |
## $Id$ |
2017 |
02 Aug 09 |
peter |
2 |
|
2952 |
11 Jan 13 |
peter |
3 |
# |
3728 |
16 Mar 18 |
peter |
# serial 3 (yat 0.16) |
2952 |
11 Jan 13 |
peter |
5 |
# |
2952 |
11 Jan 13 |
peter |
6 |
|
2017 |
02 Aug 09 |
peter |
# SYNOPSIS |
2017 |
02 Aug 09 |
peter |
8 |
# |
2017 |
02 Aug 09 |
peter |
# YAT_LIB_CBLAS([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) |
2017 |
02 Aug 09 |
peter |
10 |
# |
2017 |
02 Aug 09 |
peter |
# DESCRIPTION |
2017 |
02 Aug 09 |
peter |
12 |
# |
2017 |
02 Aug 09 |
peter |
# This macro looks for a library that implements the BLAS C API. The |
2017 |
02 Aug 09 |
peter |
# macro adds a configure option --with-cblas=LIB that can be used to |
2017 |
02 Aug 09 |
peter |
# select a specific CBLAS library. |
2017 |
02 Aug 09 |
peter |
16 |
# |
2017 |
02 Aug 09 |
peter |
# On success it sets the YAT_CBLAS_LIB variable and execute |
2017 |
02 Aug 09 |
peter |
# ACTION-IF-FOUND. Otherise ACTION-IF-NOT-FOUND is executed. |
2017 |
02 Aug 09 |
peter |
19 |
# |
2017 |
02 Aug 09 |
peter |
# COPYLEFT |
2017 |
02 Aug 09 |
peter |
21 |
# |
4359 |
23 Aug 23 |
peter |
# Copyright (C) 2009, 2013, 2015, 2018 Peter Johansson |
2017 |
02 Aug 09 |
peter |
23 |
# |
2017 |
02 Aug 09 |
peter |
# This file is part of the yat library, http://dev.thep.lu.se/yat |
2017 |
02 Aug 09 |
peter |
25 |
# |
2017 |
02 Aug 09 |
peter |
# The yat library is free software; you can redistribute it and/or |
2017 |
02 Aug 09 |
peter |
# modify it under the terms of the GNU General Public License as |
2017 |
02 Aug 09 |
peter |
# published by the Free Software Foundation; either version 3 of the |
2017 |
02 Aug 09 |
peter |
# License, or (at your option) any later version. |
2017 |
02 Aug 09 |
peter |
30 |
# |
2017 |
02 Aug 09 |
peter |
# The yat library is distributed in the hope that it will be useful, |
2017 |
02 Aug 09 |
peter |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
2017 |
02 Aug 09 |
peter |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
2017 |
02 Aug 09 |
peter |
# General Public License for more details. |
2017 |
02 Aug 09 |
peter |
35 |
# |
2017 |
02 Aug 09 |
peter |
# You should have received a copy of the GNU General Public License |
2017 |
02 Aug 09 |
peter |
# along with yat. If not, see <http://www.gnu.org/licenses/>. |
2017 |
02 Aug 09 |
peter |
38 |
# |
2017 |
02 Aug 09 |
peter |
39 |
|
2017 |
02 Aug 09 |
peter |
# This macro is a slimmed and modified version of the ACX_BLAS macro |
2017 |
02 Aug 09 |
peter |
# available from http://autoconf-archive.cryp.to/acx_blas.html |
2017 |
02 Aug 09 |
peter |
# written by Steven G. Johnson <stevenj@alum.mit.edu> |
2017 |
02 Aug 09 |
peter |
43 |
|
2017 |
02 Aug 09 |
peter |
44 |
|
2017 |
02 Aug 09 |
peter |
45 |
|
2952 |
11 Jan 13 |
peter |
46 |
AC_DEFUN([YAT_LIB_CBLAS], |
2952 |
11 Jan 13 |
peter |
47 |
[ |
2093 |
24 Oct 09 |
peter |
48 |
AC_PREREQ([2.60]) dnl we use AS_CASE |
2017 |
02 Aug 09 |
peter |
49 |
yat_cblas_ok=no; |
2017 |
02 Aug 09 |
peter |
50 |
save_LIBS=$LIBS; |
2017 |
02 Aug 09 |
peter |
51 |
|
2017 |
02 Aug 09 |
peter |
52 |
AC_ARG_WITH([cblas], |
2044 |
01 Sep 09 |
peter |
53 |
[AS_HELP_STRING([--with-cblas=LIB], [use CBLAS library LIB])]) |
2017 |
02 Aug 09 |
peter |
54 |
|
2017 |
02 Aug 09 |
peter |
55 |
AS_CASE([$with_cblas], |
2017 |
02 Aug 09 |
peter |
56 |
[yes | ""], , |
2017 |
02 Aug 09 |
peter |
57 |
[no], [yat_cblas_ok=disable], |
2017 |
02 Aug 09 |
peter |
58 |
[-* | */* | *.a | *.so | *.so.* | *.o], [CBLAS_LIB="$with_blas"], |
2017 |
02 Aug 09 |
peter |
59 |
[CBLAS_LIB="-l$with_blas"]) |
2017 |
02 Aug 09 |
peter |
60 |
|
2017 |
02 Aug 09 |
peter |
# First, check CBLAS_LIB environment variable |
2017 |
02 Aug 09 |
peter |
62 |
AS_IF([test $yat_cblas_ok = no && test "x$CBLAS_LIB" != x], |
2017 |
02 Aug 09 |
peter |
63 |
[AC_LINK_IFELSE([AC_LANG_CALL(,[cblas_sgemm])], |
2017 |
02 Aug 09 |
peter |
64 |
[yat_cblas_ok=yes], |
2017 |
02 Aug 09 |
peter |
65 |
[CBLAS_LIB=""])]) |
2017 |
02 Aug 09 |
peter |
66 |
|
3453 |
08 Dec 15 |
peter |
# Find library that implements cblas; search in the following order |
3453 |
08 Dec 15 |
peter |
# - CBLAS linked by default (or with current $LIBS) |
3453 |
08 Dec 15 |
peter |
# - CBLAS in ATLAS library? (http://math-atlas.sourceforge.net/) |
3453 |
08 Dec 15 |
peter |
# - tatlas |
3453 |
08 Dec 15 |
peter |
# - satlas |
3453 |
08 Dec 15 |
peter |
# - CBLAS as -lcblas |
3453 |
08 Dec 15 |
peter |
# - Openblas available from http://xianyi.github.com/OpenBLAS/ |
3453 |
08 Dec 15 |
peter |
# - CBLAS in Intel MKL library? |
3453 |
08 Dec 15 |
peter |
# - CBLAS in SCSL library (SGI/Cray Scientific Library) |
3453 |
08 Dec 15 |
peter |
76 |
AS_IF([test $yat_cblas_ok = no], [ |
3728 |
16 Mar 18 |
peter |
77 |
YAT_SEARCH_LIBS([cblas_sgemm], |
3453 |
08 Dec 15 |
peter |
78 |
[tatlas satlas cblas opencblas mkl_core scs], |
3453 |
08 Dec 15 |
peter |
79 |
[yat_cblas_ok=yes; |
3728 |
16 Mar 18 |
peter |
80 |
CBLAS_LIB=$yat_cv_search_cblas_sgemm |
3453 |
08 Dec 15 |
peter |
81 |
]) |
3453 |
08 Dec 15 |
peter |
82 |
]) |
2017 |
02 Aug 09 |
peter |
83 |
|
2017 |
02 Aug 09 |
peter |
# CBLAS in ATLAS library? (http://math-atlas.sourceforge.net/) |
3453 |
08 Dec 15 |
peter |
# Old atlas is linked in with -latlas -lcblas |
3453 |
08 Dec 15 |
peter |
86 |
AS_IF([test $yat_cblas_ok = no], [ |
3453 |
08 Dec 15 |
peter |
87 |
AC_CHECK_LIB([ATL_xerbla], [atlas], |
3453 |
08 Dec 15 |
peter |
88 |
[AC_CHECK_LIB([cblas_sgemm], [cblas], |
3453 |
08 Dec 15 |
peter |
89 |
[yat_cblas_ok=yes; |
3453 |
08 Dec 15 |
peter |
90 |
CBLAS_LIB="-lcblas -latlas"]) |
3453 |
08 Dec 15 |
peter |
91 |
]) |
2017 |
02 Aug 09 |
peter |
92 |
LIBS=$save_LIBS; |
3453 |
08 Dec 15 |
peter |
93 |
]) |
2017 |
02 Aug 09 |
peter |
94 |
|
2952 |
11 Jan 13 |
peter |
# Execute ACTION-IF-FOUND or ACTION-IF-NOT-FOUND |
3453 |
08 Dec 15 |
peter |
96 |
AS_IF([test x"$yat_cblas_ok" = x"yes"], |
2017 |
02 Aug 09 |
peter |
97 |
[m4_default([$1], [:])], |
2017 |
02 Aug 09 |
peter |
98 |
[yat_cblas_ok=no; m4_default([$2], [:])]) |
2017 |
02 Aug 09 |
peter |
99 |
])dnl YAT_CBLAS |