summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorDaniel M. Pelt <D.M.Pelt@cwi.nl>2015-02-24 14:19:34 +0100
committerWillem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl>2015-02-26 11:52:25 +0100
commit153b480b267a2d62e3b2d671d8018ab6e55dc8c4 (patch)
treef4d2b43178147ac7df7a72cef1fba541598b2070 /build
parentd2407fea1ed7c3c718a4c115d8c632664c2378dd (diff)
downloadastra-153b480b267a2d62e3b2d671d8018ab6e55dc8c4.tar.gz
astra-153b480b267a2d62e3b2d671d8018ab6e55dc8c4.tar.bz2
astra-153b480b267a2d62e3b2d671d8018ab6e55dc8c4.tar.xz
astra-153b480b267a2d62e3b2d671d8018ab6e55dc8c4.zip
Better Python configure checks
Diffstat (limited to 'build')
-rw-r--r--build/linux/configure.ac31
1 files changed, 24 insertions, 7 deletions
diff --git a/build/linux/configure.ac b/build/linux/configure.ac
index f4cc82e..f9755f9 100644
--- a/build/linux/configure.ac
+++ b/build/linux/configure.ac
@@ -162,17 +162,34 @@ AC_SUBST(HAVEMATLAB)
# python
-AC_ARG_WITH(python, [[ --with-python=path path of Python (optional)]],,)
+AC_ARG_WITH(python, [[ --with-python=path path of Python binary (optional)]],,)
-PY_PATH=$PATH
HAVEPYTHON=no
if test x"$with_python" != x; then
- PY_PATH="$with_python:$PY_PATH"
- AC_PATH_PROG([PYTHON], [python], [no], [$PY_PATH])
- if test x"$PYTHON" != xno; then
- HAVEPYTHON=yes
- AC_SUBST(PYTHON)
+ AC_CHECK_FILE([$with_python],[PYTHON=$with_python],[AC_PATH_PROG([PYTHON], [$with_python], [AC_MSG_ERROR(Python binary not found)], [$PATH])])
+ HAVEPYTHON=yes
+ AC_SUBST(PYTHON)
+ AC_MSG_CHECKING(for numpy module)
+ echo "import numpy" | $PYTHON -
+ if test $? -ne 0 ; then
+ AC_MSG_RESULT(not found)
+ AC_MSG_ERROR(You need the numpy module to use the ASTRA toolbox in Python)
fi
+ AC_MSG_RESULT(found)
+ AC_MSG_CHECKING(for Cython module)
+ echo "import Cython;from distutils.version import LooseVersion;assert(LooseVersion(Cython.__version__)>=LooseVersion('0.13'))" | $PYTHON -
+ if test $? -ne 0 ; then
+ AC_MSG_RESULT(not found)
+ AC_MSG_ERROR(You need the Cython module (version >=0.13) to use the ASTRA toolbox in Python)
+ fi
+ AC_MSG_RESULT(found)
+ AC_MSG_CHECKING(for six module)
+ echo "import six" | $PYTHON -
+ if test $? -ne 0 ; then
+ AC_MSG_RESULT(not found)
+ AC_MSG_ERROR(You need the six module to use the ASTRA toolbox in Python)
+ fi
+ AC_MSG_RESULT(found)
fi
AC_SUBST(HAVEPYTHON)