-
Notifications
You must be signed in to change notification settings - Fork 24
/
install.sh
executable file
·54 lines (45 loc) · 1.28 KB
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/bash
# 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
conda install mpi4py <<< "y"
fi
while [ $# -gt 0 ]; do
case $1 in
--hpc)
# Rename legacy compiler option in conda
s=$(which python)
s=${s//bin\/python/compiler_compat}
if [ ! -f $s/ld.bak ] && [ -f $s/ld ]; then
mv $s/ld $s/ld.bak
fi
mkdir installs; cd installs
wget https://github.com/mpi4py/mpi4py/releases/download/3.1.4/mpi4py-3.1.4.tar.gz -q
tar -zxf mpi4py-3.1.4.tar.gz
cd mpi4py-3.1.4
python setup.py install
cd ../../
rm -rf installs/
;;
--config_cont_lib)
bash config_cont_energy.sh
;;
esac
shift
done
# Install MC/DC module (and the dependencies)
pip install -e .
# Patch Numba
bash patch_numba.sh
# Install pre-commit hook
pre-commit install
# Installing visualization dependencies (required via pip for osx-arm64)
pip install ngsolve distinctipy