summaryrefslogtreecommitdiffstats
path: root/tensor-headers.patch
diff options
context:
space:
mode:
Diffstat (limited to 'tensor-headers.patch')
-rw-r--r--tensor-headers.patch39
1 files changed, 39 insertions, 0 deletions
diff --git a/tensor-headers.patch b/tensor-headers.patch
new file mode 100644
index 0000000..e2fed73
--- /dev/null
+++ b/tensor-headers.patch
@@ -0,0 +1,39 @@
+From 9feb1e81f79e28b78b803abde4dacaca820dafe8 Mon Sep 17 00:00:00 2001
+From: Remi Collet <remi@remirepo.net>
+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 -lpthread" = "x"; then
+ PHP_EVAL_LIBLINE(-lopenblas -llapacke -lgfortran -lpthread, TENSOR_SHARED_LIBADD)