@@ -11,12 +11,23 @@ make_conda() {
11
11
source activate $VIRTUALENV
12
12
}
13
13
14
+ setup_ccache () {
15
+ echo " Setting up ccache"
16
+ mkdir /tmp/ccache/
17
+ which ccache
18
+ for name in gcc g++ cc c++ x86_64-linux-gnu-gcc x86_64-linux-gnu-c++; do
19
+ ln -s $( which ccache) " /tmp/ccache/${name} "
20
+ done
21
+ export PATH=" /tmp/ccache/:${PATH} "
22
+ ccache -M 256M
23
+ }
24
+
14
25
# imports get_dep
15
26
source build_tools/shared.sh
16
27
17
28
if [[ " $DISTRIB " == " conda" ]]; then
18
29
19
- TO_INSTALL=" python=$PYTHON_VERSION pip blas[build=$BLAS ]"
30
+ TO_INSTALL=" python=$PYTHON_VERSION ccache pip blas[build=$BLAS ]"
20
31
21
32
TO_INSTALL=" $TO_INSTALL $( get_dep numpy $NUMPY_VERSION ) "
22
33
TO_INSTALL=" $TO_INSTALL $( get_dep scipy $SCIPY_VERSION ) "
@@ -38,43 +49,48 @@ if [[ "$DISTRIB" == "conda" ]]; then
38
49
fi
39
50
fi
40
51
make_conda $TO_INSTALL
52
+ setup_ccache
41
53
42
54
elif [[ " $DISTRIB " == " ubuntu" ]]; then
43
55
sudo add-apt-repository --remove ppa:ubuntu-toolchain-r/test
44
56
sudo apt-get update
45
- sudo apt-get install python3-scipy python3-matplotlib libatlas3-base libatlas-base-dev python3-virtualenv
57
+ sudo apt-get install python3-scipy python3-matplotlib libatlas3-base libatlas-base-dev python3-virtualenv ccache
46
58
python3 -m virtualenv --system-site-packages --python=python3 $VIRTUALENV
47
59
source $VIRTUALENV /bin/activate
60
+ setup_ccache
48
61
python -m pip install $( get_dep cython $CYTHON_VERSION ) \
49
62
$( get_dep joblib $JOBLIB_VERSION )
50
63
51
64
elif [[ " $DISTRIB " == " ubuntu-32" ]]; then
52
65
apt-get update
53
- apt-get install -y python3-dev python3-scipy python3-matplotlib libatlas3-base libatlas-base-dev python3-virtualenv python3-pandas
66
+ apt-get install -y python3-dev python3-scipy python3-matplotlib libatlas3-base libatlas-base-dev python3-virtualenv python3-pandas ccache
54
67
55
68
python3 -m virtualenv --system-site-packages --python=python3 $VIRTUALENV
56
69
source $VIRTUALENV /bin/activate
70
+ setup_ccache
57
71
python -m pip install $( get_dep cython $CYTHON_VERSION ) \
58
72
$( get_dep joblib $JOBLIB_VERSION )
59
73
60
74
elif [[ " $DISTRIB " == " conda-pip-latest" ]]; then
61
75
# Since conda main channel usually lacks behind on the latest releases,
62
76
# we use pypi to test against the latest releases of the dependencies.
63
77
# conda is still used as a convenient way to install Python and pip.
64
- make_conda " python=$PYTHON_VERSION "
78
+ make_conda " ccache python=$PYTHON_VERSION "
79
+ setup_ccache
65
80
python -m pip install -U pip
66
81
67
82
python -m pip install pandas matplotlib pyamg scikit-image
68
83
# do not install dependencies for lightgbm since it requires scikit-learn
69
84
# and install a version less than 3.0.0 until the issue #18316 is solved.
70
85
python -m pip install " lightgbm<3.0.0" --no-deps
71
86
elif [[ " $DISTRIB " == " conda-pip-scipy-dev" ]]; then
72
- make_conda " python=$PYTHON_VERSION "
87
+ make_conda " ccache python=$PYTHON_VERSION "
73
88
python -m pip install -U pip
74
89
echo " Installing numpy and scipy master wheels"
75
90
dev_anaconda_url=https://pypi.anaconda.org/scipy-wheels-nightly/simple
76
91
pip install --pre --upgrade --timeout=60 --extra-index $dev_anaconda_url numpy scipy pandas
77
92
pip install --pre cython
93
+ setup_ccache
78
94
echo " Installing joblib master"
79
95
pip install https://github.com/joblib/joblib/archive/master.zip
80
96
echo " Installing pillow master"
123
139
python setup.py build_ext --inplace -j 3
124
140
python setup.py develop
125
141
fi
142
+
143
+ ccache -s
0 commit comments