forked from KhronosGroup/SyclParallelSTL
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
52 lines (40 loc) · 1.77 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
FROM ubuntu:xenial
# Default values for the build
ARG git_branch
ARG git_slug
ARG c_compiler
ARG cxx_compiler
ARG impl
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 libcompute-dev
RUN add-apt-repository -y ppa:ubuntu-toolchain-r/test
RUN apt-get -yq update
# Clang 4.0
RUN if [ "${c_compiler}" = 'clang-4.0' ]; then apt-get install -yq \
--allow-downgrades --allow-remove-essential --allow-change-held-packages \
clang-4.0 libomp-dev; fi
# GCC 6
RUN if [ "${c_compiler}" = 'gcc-6' ]; then apt-get install -yq \
--allow-downgrades --allow-remove-essential --allow-change-held-packages \
g++-6 gcc-6; 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
RUN git clone https://github.com/${git_slug}.git -b ${git_branch} /SyclParallelSTL
# SYCL
RUN if [ "${impl}" = 'triSYCL' ]; then cd /SyclParallelSTL && bash /SyclParallelSTL/.travis/build_triSYCL.sh; fi
RUN if [ "${impl}" = 'COMPUTECPP' ]; then cd /SyclParallelSTL && bash /SyclParallelSTL/.travis/build_computecpp.sh; fi
ENV CC=${c_compiler}
ENV CXX=${cxx_compiler}
ENV SYCL_IMPL=${impl}
CMD cd /SyclParallelSTL && \
if [ "${SYCL_IMPL}" = 'triSYCL' ]; then \
./build.sh --trisycl -DTRISYCL_INCLUDE_DIR=/tmp/triSYCL-master/include; \
elif [ "${SYCL_IMPL}" = 'COMPUTECPP' ]; then \
COMPUTECPP_TARGET="host" ./build.sh /tmp/ComputeCpp-latest; \
else \
echo "Unknown SYCL implementation ${SYCL_IMPL}"; return 1; \
fi