Dockerfile 1.14 KB
Newer Older
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
FROM ubuntu:16.04

# nGraph dependencies
RUN apt-get update && apt-get install -y \
  build-essential \
  cmake \
  clang-3.9 \
  clang-format-3.9 \
  git \
  curl \
  zlib1g \
  zlib1g-dev \
  libtinfo-dev && \
  apt-get clean autoclean && apt-get autoremove -y

# Python dependencies
RUN apt-get update && apt-get install -y \
  python \
  python3 \
  python-dev \
  python3-dev \
  python-pip && \
  apt-get clean autoclean && apt-get autoremove -y
RUN pip install --upgrade pip setuptools wheel
RUN pip install tox

# Prepare nGraph
COPY . /root/ngraph
RUN mkdir /root/ngraph/build
WORKDIR /root/ngraph/build
31
RUN cmake ../ -DNGRAPH_USE_PREBUILT_LLVM=TRUE -DCMAKE_INSTALL_PREFIX="~/ngraph_dist"
32
RUN make style-check
33
RUN make 
34 35 36
RUN make install

# Prepare nGraph Python API
37 38
WORKDIR /root/ngraph/python
RUN git clone --recursive -b allow-nonconstructible-holders https://github.com/jagerman/pybind11.git
39 40
ENV NGRAPH_CPP_BUILD_PATH /root/ngraph_dist
ENV LD_LIBRARY_PATH /root/ngraph_dist/lib
41
ENV PYBIND_HEADERS_PATH /root/ngraph/python/pybind11
42

43 44
RUN df -k 

45 46
# Test nGraph and nGraph Python API
CMD cd /root/ngraph/build && make check ; cd /root/ngraph/python && tox