From 9feb1e81f79e28b78b803abde4dacaca820dafe8 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Mon, 15 Feb 2021 09:37:22 +0100 Subject: [PATCH] check for openblas headers --- ext/config.m4 | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/ext/config.m4 b/ext/config.m4 index ae03d9c..2b130c0 100644 --- a/ext/config.m4 +++ b/ext/config.m4 @@ -1,8 +1,24 @@ PHP_ARG_ENABLE(tensor, whether to enable tensor, [ --enable-tensor Enable Tensor]) +PHP_ARG_WITH(openblas, libopenblas directory, +[ --with-openblas=DIR libopenblas directory], no, no) + if test "$PHP_TENSOR" = "yes"; then - + AC_MSG_CHECKING([Check openblas headers]) + for i in $PHP_OPENBLAS /usr/local/include /usr/include/openblas /usr/include; do + if test -r $i/cblas.h; then + OPENBLAS_DIR=$i + AC_MSG_RESULT([found in $i]) + break + fi + done + + if test -z "$OPENBLAS_DIR"; then + AC_MSG_ERROR([openblas headers not found]) + else + PHP_ADD_INCLUDE($OPENBLAS_DIR) + fi if ! test "x-lopenblas -llapacke -lgfortran" = "x"; then PHP_EVAL_LIBLINE(-lopenblas -llapacke -lgfortran, TENSOR_SHARED_LIBADD)