-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.sh
70 lines (63 loc) · 1.51 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
65
66
67
68
69
70
#!/bin/sh
current_dir="$(pwd)"
macOS=false
check_requirements() {
case "$(uname -s)" in
Darwin)
printf 'Installing on macOS...'
export CFLAGS='-stdlib=libc++'
macOS=true
;;
Linux)
printf 'Installing on Linux...'
;;
Windows)
printf 'Installing on Windows...'
;;
*)
printf 'Only Linux, macOS and Windows systems are currently supported.'
exit 1
;;
esac
}
install_python_packages() {
printf '\nInstall Python packages\n'
python3 -m pip install -r requirements.txt
case "$(uname -s)" in
Linux|Darwin)
python3 -m pip install cvxpy==1.1.20
;;
Windows)
python3 -m pip install cvxpy==1.0.26
;;
*)
printf 'Only Linux, macOS and Windows systems are currently supported.'
exit 1
;;
esac
}
install_oasis() {
printf '\nInstalling OASIS...'
cd "$current_dir" || exit 1
printf '\nInstalling Gurobi...'
conda config --add channels http://conda.anaconda.org/gurobi
conda install gurobi -y
printf '\nInstalling Mosek...'
conda install -c mosek mosek -y
git clone https://github.com/j-friedrich/OASIS.git oasis
cd oasis || exit 1
python3 setup.py build_ext --inplace
python3 -m pip install -e .
}
install_elephant() {
printf '\nInstalling Elephant...'
cd "$current_dir" || exit 1
git clone git://github.com/NeuralEnsemble/elephant.git elephant
cd elephant || exit 1
python3 setup.py install
}
check_requirements
install_python_packages
install_oasis
install_elephant
printf '\nSetup completed.'