From df05afb7bbece5aeefd2edac120639e5898ecb4e Mon Sep 17 00:00:00 2001 From: Pietro Incardona <incardon@mpi-cbg.de> Date: Sun, 30 Jul 2017 14:38:59 +0200 Subject: [PATCH] fixing python2 installation --- script/install_PETSC.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/script/install_PETSC.sh b/script/install_PETSC.sh index 2edc2db3..fed8e283 100755 --- a/script/install_PETSC.sh +++ b/script/install_PETSC.sh @@ -312,7 +312,17 @@ cd petsc-3.6.4 echo "./configure --with-cxx-dialect=C++11 $petsc_openmp --with-mpi-dir=$mpi_dir $configure_options --with-mumps-lib="$MUMPS_extra_lib" --prefix=$1/PETSC --with-debugging=0" -./configure --with-cxx-dialect=C++11 $petsc_openmp --with-mpi-dir=$mpi_dir $configure_options --with-mumps-lib="$MUMPS_extra_lib" --prefix=$1/PETSC --with-debugging=0 +function haveProg() { + [ -x "$(command -v $1)" ] +} + +if haveProg python2; then + python_command=python2 +else + python_command=python +fi + +$python_command ./configure --with-cxx-dialect=C++11 $petsc_openmp --with-mpi-dir=$mpi_dir $configure_options --with-mumps-lib="$MUMPS_extra_lib" --prefix=$1/PETSC --with-debugging=0 make all test make install -- GitLab