-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbootstrap.sh
76 lines (55 loc) · 2.22 KB
/
bootstrap.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
71
72
73
#!/usr/bin/env bash
##
## This script has to be ran first when bringing up this vagrant configuration,
## sets up all essential libraries, dependencies and tools.
##
# To display detailed information when executing this script
set -ex
###### Apt-Get #########
# PTI stands for Programs To Install
PTI=''
# Git
PTI="${PTI} git"
# Vim
PTI="${PTI} vim"
# Python packages and requirements
PTI="${PTI} curl zlib1g-dev libbz2-dev libreadline-dev libgdbm-dev libssl-dev \
libsqlite3-dev python python-setuptools python-dev python-numpy python-scipy python-matplotlib \
ipython ipython-notebook python-pandas python-sympy python-nose \
g++ python-software-properties libopenblas-base libopenblas-dev liblapack-dev \
gfortran libfreetype6-dev"
# Remove libatlas because Theanos requires blas, and it is faster
apt-get --purge -y remove libatlas3gf-base libatlas-dev
# Bring apt-get up to date
apt-get update
# Install all the apt-get packages
apt-get install -y ${PTI}
####### Python ##########
# Upgrade older Ubuntu packages to most recent PyPi versions
# Sequence matters
easy_install pip
pip install --upgrade setuptools --no-use-wheel
pip install --upgrade pip
pip install --upgrade cython
# Install scimath and numpy, these components are at the bottom
# as they tend to cause problems and should crash at the end to avoid reprovisioning
pip install --upgrade numpy
/usr/local/bin/easy_install scimath
pip install --upgrade ipython[all] jinja2 vincent virtualenv pythonbrew pandas SciPy matplotlib
pip install --upgrade theano
# Switch symlink from libatlas to libopenblas
# Manually this would be done with commmand
# update-alternatives --config libblas.so.3gf < Option 2: /usr/lib/lapack/liblapack.so.3gf
rm -rf /usr/lib/liblapack.so.3gf
ln -s /usr/lib/lapack/liblapack.so.3gf /usr/lib/liblapack.so.3gf
# Insert cludge to fix Theano imports
sed -i '130iimport numpy.distutils.__config__' /usr/local/lib/python2.7/dist-packages/theano/tensor/blas.py
# Add sync folder
mkdir -p "/vagrant/sync"
sudo chown -R vagrant:vagrant "/vagrant/sync/"
# Link sync directory into home
if [[ ! -L "/home/vagrant/sync" ]]; then
ln -s "/vagrant/sync" "/home/vagrant/sync"
chown -R vagrant:vagrant /home/vagrant/sync
fi
echo "Done! Vagrant provision complete."