Revision | 9e5319cd67323d997f9d59ede691c46b7268f027 (tree) |
---|---|
Zeit | 2012-12-19 04:45:29 |
Autor | Katsuhiko Nishimra <ktns.87@gmai...> |
Commiter | Katsuhiko Nishimra |
Downloaded latest version of ax_blas.m4. #28588
see http://www.gnu.org/software/autoconf-archive/ax_blas.html.
@@ -63,12 +63,13 @@ | ||
63 | 63 | # modified version of the Autoconf Macro, you may extend this special |
64 | 64 | # exception to the GPL to apply to your modified version as well. |
65 | 65 | |
66 | -#serial 12 | |
66 | +#serial 14 | |
67 | 67 | |
68 | 68 | AU_ALIAS([ACX_BLAS], [AX_BLAS]) |
69 | 69 | AC_DEFUN([AX_BLAS], [ |
70 | 70 | AC_PREREQ(2.50) |
71 | 71 | AC_REQUIRE([AC_F77_LIBRARY_LDFLAGS]) |
72 | +AC_REQUIRE([AC_CANONICAL_HOST]) | |
72 | 73 | ax_blas_ok=no |
73 | 74 | |
74 | 75 | AC_ARG_WITH(blas, |
@@ -107,6 +108,12 @@ if test $ax_blas_ok = no; then | ||
107 | 108 | LIBS="$save_LIBS" |
108 | 109 | fi |
109 | 110 | |
111 | +# BLAS in OpenBLAS library? (http://xianyi.github.com/OpenBLAS/) | |
112 | +if test $ax_blas_ok = no; then | |
113 | + AC_CHECK_LIB(openblas, $sgemm, [ax_blas_ok=yes | |
114 | + BLAS_LIBS="-lopenblas"]) | |
115 | +fi | |
116 | + | |
110 | 117 | # BLAS in ATLAS library? (http://math-atlas.sourceforge.net/) |
111 | 118 | if test $ax_blas_ok = no; then |
112 | 119 | AC_CHECK_LIB(atlas, ATL_xerbla, |
@@ -130,6 +137,36 @@ fi | ||
130 | 137 | |
131 | 138 | # BLAS in Intel MKL library? |
132 | 139 | if test $ax_blas_ok = no; then |
140 | + # MKL for gfortran | |
141 | + if test x"$ac_cv_fc_compiler_gnu" = xyes; then | |
142 | + # 64 bit | |
143 | + if test $host_cpu = x86_64; then | |
144 | + AC_CHECK_LIB(mkl_gf_lp64, $sgemm, | |
145 | + [ax_blas_ok=yes;BLAS_LIBS="-lmkl_gf_lp64 -lmkl_sequential -lmkl_core -lpthread"],, | |
146 | + [-lmkl_gf_lp64 -lmkl_sequential -lmkl_core -lpthread]) | |
147 | + # 32 bit | |
148 | + elif test $host_cpu = i686; then | |
149 | + AC_CHECK_LIB(mkl_gf, $sgemm, | |
150 | + [ax_blas_ok=yes;BLAS_LIBS="-lmkl_gf -lmkl_sequential -lmkl_core -lpthread"],, | |
151 | + [-lmkl_gf -lmkl_sequential -lmkl_core -lpthread]) | |
152 | + fi | |
153 | + # MKL for other compilers (Intel, PGI, ...?) | |
154 | + else | |
155 | + # 64-bit | |
156 | + if test $host_cpu = x86_64; then | |
157 | + AC_CHECK_LIB(mkl_intel_lp64, $sgemm, | |
158 | + [ax_blas_ok=yes;BLAS_LIBS="-lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lpthread"],, | |
159 | + [-lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lpthread]) | |
160 | + # 32-bit | |
161 | + elif test $host_cpu = i686; then | |
162 | + AC_CHECK_LIB(mkl_intel, $sgemm, | |
163 | + [ax_blas_ok=yes;BLAS_LIBS="-lmkl_intel -lmkl_sequential -lmkl_core -lpthread"],, | |
164 | + [-lmkl_intel -lmkl_sequential -lmkl_core -lpthread]) | |
165 | + fi | |
166 | + fi | |
167 | +fi | |
168 | +# Old versions of MKL | |
169 | +if test $ax_blas_ok = no; then | |
133 | 170 | AC_CHECK_LIB(mkl, $sgemm, [ax_blas_ok=yes;BLAS_LIBS="-lmkl -lguide -lpthread"],,[-lguide -lpthread]) |
134 | 171 | fi |
135 | 172 |