|
1 | 1 | SAGE_SPKG_CONFIGURE([openblas], [
|
2 | 2 | SAGE_SPKG_DEPCHECK([gfortran], [
|
3 | 3 | PKG_CHECK_MODULES([OPENBLAS], [openblas >= 0.2.20], [
|
| 4 | + SAVE_LIBS="$LIBS" |
| 5 | + LIBS="$OPENBLAS_LIBS $LIBS" |
| 6 | + SAVE_CFLAGS="$CFLAGS" |
| 7 | + CFLAGS="$OPENBLAS_CFLAGS $CFLAGS" |
4 | 8 | PKG_CHECK_VAR([OPENBLASPCDIR], [openblas], [pcfiledir], [
|
5 | 9 | sage_install_blas_pc=yes
|
6 |
| - AC_SEARCH_LIBS([cblas_dgemm], [openblas], [dnl openblas works as cblas |
| 10 | + AC_CHECK_FUNC([cblas_dgemm], [dnl openblas works as cblas |
7 | 11 | sage_install_cblas_pc=yes
|
8 | 12 | ], [
|
9 |
| - dnl openblas does not work as cblas; try to use system's cblas as is |
| 13 | + dnl openblas does not work as cblas; try to use system cblas as is |
10 | 14 | PKG_CHECK_MODULES([CBLAS], [cblas], [], [sage_spkg_install_openblas=yes])
|
11 | 15 | ])
|
12 |
| - AC_FC_FREEFORM([AC_FC_FUNC([dgeqrf])]) |
13 |
| - AC_SEARCH_LIBS([$dgeqrf], [openblas], [dnl openblas works as lapack |
| 16 | + dnl Check all name manglings that AC_FC_FUNC could check based on the |
| 17 | + dnl characteristics of the Fortran compiler |
| 18 | + m4_foreach([dgeqrf_mangled], [dgeqrf, dgeqrf_, DGEQRF, DGEQRF_], [ |
| 19 | + AC_CHECK_FUNC(dgeqrf_mangled, [ |
| 20 | + AS_VAR_SET([HAVE_DGEQRF], [yes]) |
| 21 | + ]) |
| 22 | + ]) |
| 23 | + AS_IF([test x$HAVE_DGEQRF = xyes], [dnl openblas works as lapack |
14 | 24 | sage_install_lapack_pc=yes
|
15 | 25 | ], [
|
16 |
| - dnl openblas does not work as lapack; try to use system's lapack as is |
| 26 | + dnl openblas does not work as lapack; try to use system lapack as is |
17 | 27 | PKG_CHECK_MODULES([LAPACK], [lapack], [], [sage_spkg_install_openblas=yes])
|
18 | 28 | ])
|
19 | 29 | ], [
|
20 | 30 | AC_MSG_WARN([Unable to locate the directory of openblas.pc. This should not happen!])
|
21 | 31 | sage_spkg_install_openblas=yes
|
22 | 32 | ])
|
| 33 | + LIBS="$SAVE_LIBS" |
| 34 | + CFLAGS="$SAVE_CFLAGS" |
23 | 35 | ], [sage_spkg_install_openblas=yes])
|
24 | 36 | AS_IF([test x$sage_spkg_install_openblas != xyes], [
|
25 | 37 | m4_foreach([blaslibnam], [blas, cblas, lapack], [
|
|
0 commit comments