summaryrefslogtreecommitdiffstats
path: root/tensor-headers.patch
blob: e2fed733838d1c2766c393abaacc9feb72e6e9aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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)