1 2AC_DEFUN([HPL_BLAS], [ 3 4AC_PREREQ(2.69) 5 6hpl_blas_ok=no 7 8dnl FIXME: add --with-blas="<library spec>" 9 10current_LIBS="$LIBS" 11 12cat <<HPLEOF > hplvars.txt 13name1=OpenBLAS 14rout1=dgemm_ 15libs1=-lopenblas -lm 16 17name2=Atlas Fortran BLAS 18rout2=dgemm_ 19libs2=-lf77blas -latlas 20 21name3=Sequential Intel MKL LP64 (group) 22rout3=dgemm_ 23libs3=-Wl,--start-group -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -Wl,--end-group -lpthread 24 25name4=Sequential Intel MKL LP64 26rout4=dgemm_ 27libs4=-lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lpthread 28 29name5=AMD's ACML 30rout5=dgemm_ 31libs5=-lacml -lm 32 33name6=Accelerate 34rout6=dgemm_ 35libs6=-framework Accelerate 36 37name7=Apple VecLib 38rout7=dgemm_ 39libs7=-framework vecLib 40 41name8=IBM ESSL 42rout8=dgemm_ 43libs8=-lessl 44 45name9=NVIDIA nvblas 46rout9=dgemm_ 47libs9=-lnvblas 48 49name10=Generic BLAS 50rout10=dgemm_ 51libs10=-lblas 52 53HPLEOF 54for hpl_i in 1 2 3 4 5 6 7 8 9 10; 55do 56if test x$hpl_blas_ok = xno; then 57 name="`grep ^name${hpl_i}= hplvars.txt | sed s/^name${hpl_i}=//`" 58 rout="`grep ^rout${hpl_i}= hplvars.txt | sed s/^rout${hpl_i}=//`" 59 libs="`grep ^libs${hpl_i}= hplvars.txt | sed s/^libs${hpl_i}=//`" 60 AC_MSG_CHECKING([for [$]rout in [$]name]) 61 62 LIBS="[$]libs" 63 AC_TRY_LINK_FUNC([$]rout, [hpl_blas_ok=yes;BLAS_LIBS="[$]libs"]) 64 LIBS="$current_LIBS" 65 66 AC_MSG_RESULT($hpl_blas_ok) 67fi 68done 69rm hplvars.txt 70 71if test x$hpl_blas_ok = xno; then 72dnl 73AC_MSG_CHECKING([for dgemm_ in OpenBLAS]) 74AC_CHECK_LIB(openblas, dgemm_, [hpl_blas_ok=yes;BLAS_LIBS="-lopenblas"]) 75AC_MSG_RESULT($hpl_blas_ok) 76dnl 77fi 78 79AC_SUBST(BLAS_LIBS) 80 81# If present, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: 82if test x"$hpl_blas_ok" = xyes; then 83 ifelse([$1],,AC_DEFINE(HAVE_BLAS,1,[Define if you have a BLAS library.]),[$1]) 84 : 85else 86 hpl_blas_ok=no 87 $2 88fi 89 90])dnl HPL_BLAS 91