Dockerfile 1.24 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12
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 \
13 14 15 16 17
  libtinfo-dev \
  unzip \
  autoconf \
  automake \
  libtool && \
18 19 20 21 22 23 24 25 26 27
  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
28

29 30 31 32 33 34 35
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
36 37
RUN cmake .. -DNGRAPH_CPU_ENABLE=FALSE -DNGRAPH_USE_PREBUILT_LLVM=TRUE -DNGRAPH_ONNX_IMPORT_ENABLE=TRUE -DCMAKE_INSTALL_PREFIX="~/ngraph_dist"
RUN make -j"$(nproc)"
38 39 40
RUN make install

# Prepare nGraph Python API
41
WORKDIR /root/ngraph/python
42
RUN git clone --recursive https://github.com/pybind/pybind11.git
43 44
ENV NGRAPH_CPP_BUILD_PATH /root/ngraph_dist
ENV LD_LIBRARY_PATH /root/ngraph_dist/lib
45
ENV PYBIND_HEADERS_PATH /root/ngraph/python/pybind11
46

47
RUN df -k
48

49
# Test nGraph and nGraph Python API
50
CMD cd /root/ngraph/build && make unit-test-check ; cd /root/ngraph/python && NGRAPH_ONNX_IMPORT_ENABLE=TRUE tox