forked from tatsy/lime
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
105 lines (92 loc) · 2.29 KB
/
Dockerfile
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
#
## Load docker image
#
FROM tatsy/ubuntu-cxx:opencv
#
## Environment variables
#
ENV TERM xterm
ENV BRANCH_NAME @BRANCH_NAME@
ENV PULL_REQUEST @PULL_REQUEST@
ENV CC @C_COMPILER@
ENV CXX @CXX_COMPILER@
ENV PYTHON_VERSION @PYTHON_VERSION@
#
## update/upgrade
#
RUN apt-get update -qq
RUN apt-get upgrade -qq
#
## Install Gcovr
#
RUN apt-get -qq install python-pip
RUN pip install gcovr
#
## Install cppcheck, cccc, and doxygen
#
RUN apt-get -qq install cppcheck cccc doxygen
#
## Install Python through Anaconda
#
RUN wget -q https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh
RUN bash miniconda.sh -b -p $HOME/anaconda
ENV PATH "$HOME/anaconda/bin:$PATH"
RUN conda update --yes conda
RUN conda install --yes python=$PYTHON_VERSION setuptools numpy scipy pillow six libgcc
#
## Install Boost
#
RUN wget -q https://dl.bintray.com/boostorg/release/1.64.0/source/boost_1_64_0.tar.gz
RUN tar -zxf boost_1_64_0.tar.gz
RUN \
cd boost_1_64_0 && \
./bootstrap.sh && \
./b2 address-model=64 \
include=`python -c "from __future__ import print_function; from distutils import sysconfig; print(sysconfig.get_python_inc())"` \
-d0 --with-python -j2 install .
#
## Install Google test
#
RUN git clone https://github.com/google/googletest.git
RUN \
cd googletest && \
mkdir build && cd build && \
cmake -D gtest_disable_pthreads=ON .. && \
make && make install
#
## Build lime
#
RUN git clone --depth 12 -b $BRANCH_NAME https://github.com/tatsy/lime.git #redo
RUN \
if [ $PULL_REQUEST != "false" ]; then \
cd lime && \
git fetch origin +refs/pull/$PULL_REQUEST/merge && \
git checkout --quiet --force FETCH_HEAD; \
fi
RUN \
cd lime && \
git submodule update --init --recursive
RUN \
cd lime && \
cmake \
-D CMAKE_BUILD_TYPE=Release \
-D LIME_BUILD_TESTS=ON \
-D GTEST_ROOT=/usr/local \
-D PYTHON_INCLUDE_DIR=`python -c "from __future__ import print_function; from distutils import sysconfig; print(sysconfig.get_python_inc())"` \
-D PYTHON_LIBRARY=`find $HOME/anaconda/lib -name python${PYTHON_VERSION}` \
-D LIME_BUILD_PYTHON_MODULE=ON . && \
cmake --build .
#
## Install pylime
#
RUN \
cd lime && \
python setup.py install
#
## # of threads used by OpenMP
#
ENV OMP_NUM_THREADS 4
#
## Define working direcotry
#
WORKDIR /root/lime