From b19f09b73d1ad71f04802b7af69c6adbcf4526d8 Mon Sep 17 00:00:00 2001 From: Timo Heister Date: Tue, 14 Nov 2017 14:10:13 -0500 Subject: [PATCH] configure PETSc using python2 --- deal.II-toolchain/packages/petsc.package | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/deal.II-toolchain/packages/petsc.package b/deal.II-toolchain/packages/petsc.package index b0eba72..37373f9 100644 --- a/deal.II-toolchain/packages/petsc.package +++ b/deal.II-toolchain/packages/petsc.package @@ -14,6 +14,19 @@ BUILDCHAIN=custom INSTALL_PATH=${INSTALL_PATH}/${EXTRACTSTO} +# Note that PETSc ./configure currently does not support python3, but some +# distros might ship with python3 as the default "python". So select python2 +# or python2.7 if available, otherwise use python or what the user supplied in +# PYTHON_INTERPRETER. +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 +default PYTHON_INTERPRETER="python" + + ######################################################################### CONFOPTS=" @@ -76,7 +89,7 @@ package_specific_setup () { # make sure no other invalid PETSC_DIR is set: unset PETSC_DIR - ./configure --prefix=${INSTALL_PATH} ${CONFOPTS} + ${PYTHON_INTERPRETER} ./configure --prefix=${INSTALL_PATH} ${CONFOPTS} quit_if_fail "petsc ./configure failed" make all install -- 2.39.5