Commit 86677466 authored by Tiago Peixoto's avatar Tiago Peixoto

Fix automatic detection of numpy C API include path

parent 50cbd928
......@@ -254,12 +254,11 @@ dnl Checks for header files.
dnl numpy
AX_PYTHON_MODULE(numpy, fatal)
dnl [NUMPY_DIR="${PYTHON_SITE_PKG}/numpy"]
[NUMPY_DIR=`$PYTHON -c "import os, numpy; print(os.path.dirname(numpy.__file__))"`]
[NUMPY_DIR=`$PYTHON -c "import numpy; print(numpy.get_include())"`]
AC_ARG_WITH([numpy], [AS_HELP_STRING([--with-numpy=DIR],[directory where numpy is installed
[default=auto-detected] ])],
NUMPY_DIR=$withval)
[NUMPY_DIR="${NUMPY_DIR}/core/include/numpy"]
AC_CHECK_HEADER([${NUMPY_DIR}/arrayobject.h],
NUMPY_DIR=$withval)
AC_CHECK_HEADER([${NUMPY_DIR}/numpy/arrayobject.h],
[CPPFLAGS="${CPPFLAGS} -I${NUMPY_DIR}"],
[AC_MSG_ERROR([Numpy extension header not found])],
[#include "Python.h"])
......
......@@ -27,7 +27,7 @@
#define NO_IMPORT_ARRAY
#endif
#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
#include "arrayobject.h"
#include "numpy/arrayobject.h"
#if NPY_API_VERSION < 0x00000007
#include "numpy_bind_old.hh"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment