-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.sh
65 lines (56 loc) · 1.5 KB
/
setup.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
55
56
57
58
59
60
61
62
63
64
#!/bin/bash
# Setup nothing on savio
if [[ ${HOSTNAME} == *.brc ]]; then
exit
fi
PENV=python-env
if [[ ${HOSTNAME} == thebe ]]; then
export TMPDIR=/volumes/selene/tmp
fi
if [ -d ${PENV} ]; then
rm -r ./${PENV}
fi
python3 -m venv ${PENV}
if [ "$?" != "0" ]; then exit 1; fi
. ${PENV}/bin/activate
if [ "$?" != "0" ]; then exit 1; fi
# Upgrade pip
python3 -m pip install --upgrade pip
if [ "$?" != "0" ]; then exit 1; fi
# Install tensorflow & torch the special way
if [ "$(uname -s)" == "Darwin" ]; then
# HDF5 is troublesome, thus do this first
P=$(which port); P=${P%/bin/port}
if [[ -f ${P}/lib/libhdf5.dylib ]]; then
export HDF5_DIR=/opt/local/
pip3 install h5py
if [ "$?" != "0" ]; then exit 1; fi
else
P=$(which brew)
if [[ -f ${P} ]]; then
export HDF5_DIR=$(brew --prefix hdf5)
pip install h5py
if [ "$?" != "0" ]; then exit 1; fi
else
echo "ERROR: hdf5 must be installed either via macports or brew"
exit 1
fi
fi
pip3 install tensorflow-macos
if [ "$?" != "0" ]; then exit 1; fi
else
if [[ ${HOSTNAME} == thebe ]] || [[ ${HOSTNAME} == despina ]]; then
pip3 install tensorflow-gpu==2.3
if [ "$?" != "0" ]; then exit 1; fi
pip3 install torch
if [ "$?" != "0" ]; then exit 1; fi
else
pip3 install tensorflow
if [ "$?" != "0" ]; then exit 1; fi
pip3 install torch
if [ "$?" != "0" ]; then exit 1; fi
fi
fi
# All the default installations
pip3 install -r Requirements.txt
if [ "$?" != "0" ]; then exit 1; fi