From 1e44b28fdd9e5096d320e95904323769df0647d0 Mon Sep 17 00:00:00 2001 From: Timo Heister Date: Wed, 19 Apr 2023 21:32:20 -0400 Subject: [PATCH] switch to python3 by default --- candi.sh | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/candi.sh b/candi.sh index b798c4e..6d0c2a3 100755 --- a/candi.sh +++ b/candi.sh @@ -1012,17 +1012,20 @@ cecho ${GOOD} "Platform: ${PLATFORM}" echo -# Figure out what binary to use for python support. Note that older PETSc ./configure only supports python2. For now, prefer -# using python2 but use what the user supplies as PYTHON_INTERPRETER. +# Figure out what binary to use for python support. Prefer +# using python3 but use what the user supplies as PYTHON_INTERPRETER. +if builtin command -v python3 --version > /dev/null; then + default PYTHON_INTERPRETER="python3" +fi +if builtin command -v python --version > /dev/null; then + default PYTHON_INTERPRETER="python" +fi if builtin command -v python2 --version > /dev/null; then default PYTHON_INTERPRETER="python2" fi if builtin command -v python2.7 --version > /dev/null; then default PYTHON_INTERPRETER="python2.7" fi -if builtin command -v python3 --version > /dev/null; then - default PYTHON_INTERPRETER="python3" -fi default PYTHON_INTERPRETER="python" # Figure out the version of the existing python: -- 2.39.5