gnuastro-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnuastro-commits] master 0babfd12: Configure: warning is activated if N


From: Mohammad Akhlaghi
Subject: [gnuastro-commits] master 0babfd12: Configure: warning is activated if Numpy+Python3 not found
Date: Sat, 3 Sep 2022 20:12:19 -0400 (EDT)

branch: master
commit 0babfd1223047af35df1ac9daf2503afd64b0b68
Author: Mohammad Akhlaghi <mohammad@akhlaghi.org>
Commit: Mohammad Akhlaghi <mohammad@akhlaghi.org>

    Configure: warning is activated if Numpy+Python3 not found
    
    Until now, the 'anywarnings' variable wasn't set when Numpy+Python3
    couldn't be found. Also, when '--without-python' was called, the 'no' from
    the output of the check for Numpy would still be printed!
    
    With this commit, 'anywarnings' has been added after the Numpy check,
    allowing warnings to be printed if they aren't found. Also, the printing of
    'yes' or 'no' is printed when the check for Numpy is actually done.
---
 configure.ac | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/configure.ac b/configure.ac
index e02abf6d..8a302305 100644
--- a/configure.ac
+++ b/configure.ac
@@ -13,6 +13,7 @@
 #     Mohammad Akhlaghi <mohammad@akhlaghi.org>
 # Contributing author(s):
 #     Pedram Ashofteh Ardakani <pedramardakani@pm.me>
+#     Jash Shah <jash28582@gmail.com>
 # Copyright (C) 2015-2022 Free Software Foundation, Inc.
 #
 # Gnuastro is free software: you can redistribute it and/or modify it
@@ -781,19 +782,19 @@ AS_IF([test "x$with_python" != xno],
         [
           AC_DEFINE(HAVE_PYTHON, [1],
                     [Define to 1 if you have Python3.])
-          AC_MSG_CHECKING(if numpy is available in the $PYTHON installation)
+          AC_MSG_CHECKING(if Numpy is available in the $PYTHON installation)
           AS_IF([$PYTHON -c "$py_check_cmd" &> /dev/null],
                 [python_includedir="$($PYTHON -c "$py_check_cmd")"
                  AS_IF([$PYTHON -c "$np_check_cmd" &> /dev/null],
-                       [numpy_includedir="$($PYTHON -c "$np_check_cmd")"])
-                ])
+                       [numpy_includedir="$($PYTHON -c "$np_check_cmd")"])])
+          AS_IF([test "x$numpy_includedir" = x],
+                [AC_MSG_RESULT([no])], [AC_MSG_RESULT([yes])])
         ])
         AC_SUBST(NUMPY_INCLUDE_DIR, [$numpy_includedir])
         AC_SUBST(PYTHON_INCLUDE_DIR, [$python_includedir])
       ])
 AS_IF([test "x$numpy_includedir" = x],
-      [has_numpy=no; AC_MSG_RESULT([no])],
-      [has_numpy=yes; AC_MSG_RESULT([yes])])
+      [has_numpy=no; anywarnings=yes;], [has_numpy=yes;])
 AM_CONDITIONAL([COND_NUMPY], [test "x$numpy_includedir" != x])
 
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]