forked from codeplaysoftware/portDNN
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
63 lines (49 loc) · 2.06 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
FROM ubuntu:artful
# Default values for the build
ARG git_branch
ARG git_slug
ARG c_compiler
ARG cxx_compiler
ARG impl
ARG target
RUN apt-get -yq update
# Utilities
RUN apt-get install -yq --allow-downgrades --allow-remove-essential \
--allow-change-held-packages git wget apt-utils cmake unzip \
libboost-all-dev software-properties-common python-software-properties
RUN add-apt-repository -y ppa:ubuntu-toolchain-r/test
RUN apt-get -yq update
# Clang 5.0
RUN if [ "${c_compiler}" = 'clang-5.0' ]; then apt-get install -yq \
--allow-downgrades --allow-remove-essential --allow-change-held-packages \
clang-5.0 libomp-dev; fi
# GCC 7
RUN if [ "${c_compiler}" = 'gcc-7' ]; then apt-get install -yq \
--allow-downgrades --allow-remove-essential --allow-change-held-packages \
g++-7 gcc-7; fi
# OpenCL ICD Loader
RUN apt-get install -yq --allow-downgrades --allow-remove-essential \
--allow-change-held-packages ocl-icd-opencl-dev ocl-icd-dev opencl-headers
# Install build tools
RUN apt-get install -yq --allow-downgrades --allow-remove-essential \
--allow-change-held-packages mercurial doxygen graphviz
RUN git clone https://github.com/${git_slug}.git -b ${git_branch} /SYCL-DNN
# Intel OpenCL Runtime
RUN if [ "${target}" = 'opencl' ]; then bash /SYCL-DNN/.travis/install_intel_opencl.sh; fi
# SYCL
RUN if [ "${impl}" = 'COMPUTECPP' ]; then cd /SYCL-DNN && bash /SYCL-DNN/.travis/build_computecpp.sh; fi
ENV CC=${c_compiler}
ENV CXX=${cxx_compiler}
ENV SYCL_IMPL=${impl}
ENV TARGET=${target}
CMD cd /SYCL-DNN && \
if [ "${SYCL_IMPL}" = 'COMPUTECPP' ]; then \
if [ "${TARGET}" = 'host' ]; then \
COMPUTECPP_TARGET="host" CMAKE_ARGS="-DSNN_BUILD_DOCUMENTATION=OFF " ./build.sh /tmp/ComputeCpp; \
else \
/tmp/ComputeCpp/bin/computecpp_info && \
COMPUTECPP_TARGET="intel:cpu" CMAKE_ARGS="-DSNN_BUILD_DOCUMENTATION=OFF " ./build.sh /tmp/ComputeCpp; \
fi \
else \
echo "Unknown SYCL implementation ${SYCL_IMPL}"; return 1; \
fi