diff --git a/install.sh b/install.sh index e0bbf938..6abce072 100755 --- a/install.sh +++ b/install.sh @@ -1,17 +1,14 @@ #!/bin/bash - -# Install MC/DC module -pip install -e . - - -# Install MC/DC dependencies, reply "y" to conda prompt -conda install numpy numba matplotlib scipy h5py pytest colorama <<< "y" - -# Installing visualization dependencies (required via pip for osx-arm64) -pip install ngsolve distinctipy - -bash patch_numba.sh +# Check python version +if ! { python3 -c 'import sys; assert sys.version_info < (3,12)' > /dev/null 2>&1 && python3 -c 'import sys; assert sys.version_info >= (3,9)' > /dev/null 2>&1; }; then + v=$(python3 --version) + p=$(which python) + echo "ERROR: Python version must be < 3.12 and >= 3.9." + echo " Found $v at $p." + echo "ERROR: Installation failed." + exit 1 +fi # Install or build mpi4py if [ $# -eq 0 ]; then @@ -44,3 +41,15 @@ while [ $# -gt 0 ]; do shift done +# Install MC/DC module +pip install -e . + + +# Install MC/DC dependencies, reply "y" to conda prompt +conda install numpy numba matplotlib scipy h5py pytest colorama <<< "y" + +# Installing visualization dependencies (required via pip for osx-arm64) +pip install ngsolve distinctipy + +bash patch_numba.sh +