forked from jupyter/docker-notebook
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild_scipy_stack.sh
62 lines (48 loc) · 1.61 KB
/
build_scipy_stack.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
#!/usr/bin/env bash
# Build OpenBLAS and clean up build dependencies
set -xe
mkdir /tmp/build
cd /tmp/build
apt-get -y update
apt-get -y install git-core build-essential gfortran python3-dev curl
# Build latest stable release from OpenBLAS from source
git clone -q --branch=master git://github.com/xianyi/OpenBLAS.git
(cd OpenBLAS \
&& make DYNAMIC_ARCH=1 NO_AFFINITY=1 NUM_THREADS=32 \
&& make install)
# Rebuild ld cache, this assumes that:
# /etc/ld.so.conf.d/openblas.conf was installed by Dockerfile
# and that the libraries are in /opt/OpenBLAS/lib
ldconfig
# System dependencies
apt-get build-dep -y python3 python3-numpy python3-scipy python3-matplotlib cython3 python3-h5py
apt-get install -y build-essential python3-dev
git clone -q --branch=v1.9.0 git://github.com/numpy/numpy.git
cp /tmp/numpy-site.cfg numpy/site.cfg
git clone -q --branch=v0.14.0 git://github.com/scipy/scipy.git
cp /tmp/scipy-site.cfg scipy/site.cfg
curl https://bootstrap.pypa.io/get-pip.py | python2
curl https://bootstrap.pypa.io/get-pip.py | python3
for PYTHONVER in 2 3 ; do
PYTHON="python$PYTHONVER"
PIP="pip$PYTHONVER"
# Build NumPy and SciPy from source against OpenBLAS installed
(cd numpy && $PYTHON setup.py install)
(cd scipy && $PYTHON setup.py install)
# The rest of the SciPy Stack
$PIP install cython
$PIP install pandas scikit-learn
$PIP install matplotlib
$PIP install seaborn
$PIP install h5py
$PIP install yt
$PIP install sympy
$PIP install patsy
$PIP install ggplot
$PIP install statsmodels
done
# Reduce the image size
apt-get autoremove -y
apt-get clean -y
cd /
rm -rf /tmp/build