File: Dockerfile

package info (click to toggle)
ispc 1.28.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 97,620 kB
  • sloc: cpp: 77,067; python: 8,303; yacc: 3,337; lex: 1,126; ansic: 631; sh: 475; makefile: 17
file content (45 lines) | stat: -rw-r--r-- 1,542 bytes parent folder | download
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
#
#  Copyright (c) 2017-2025, Intel Corporation
#
#  SPDX-License-Identifier: BSD-3-Clause

FROM fedora:39
LABEL maintainer="Nurmukhametov, Aleksei <aleksei.nurmukhametov@intel.com>"
SHELL ["/bin/bash", "-c"]

ARG REPO=ispc/ispc
ARG SHA=main

# If you are behind a proxy, you need to configure dnf to use it.
RUN if [ -v http_proxy ]; then echo "proxy=$http_proxy" >> /etc/dnf/dnf.conf; fi

# Packages required to build ISPC.
RUN dnf install -y git cmake python3-setuptools python3-devel && \
    dnf install -y clang-devel llvm-devel glibc-devel.i686 && \
    dnf install -y flex bison tbb-devel && \
    dnf clean -y all

# If you are behind a proxy, you need to configure git to use it.
RUN if [ -v http_proxy ]; then git config --global --add http.proxy "$http_proxy"; fi

# LLVM
# We don't build llvm here because we use system shared libraries.

WORKDIR /usr/local/src

# Create new non-root user and switch to it
RUN useradd -m -d /home/ispc_user -s /bin/bash -U ispc_user && \
    chown -R ispc_user:ispc_user /usr

USER ispc_user

# Clone, configure and build ISPC
# Some check-all tests may fail because we use system LLVM here
RUN git clone --depth=1 https://github.com/$REPO.git ispc && \
    git -C ispc checkout $SHA && \
    cmake ispc -B build-ispc -DCMAKE_INSTALL_PREFIX=/usr && \
    cmake --build build-ispc -v -j "$(nproc)" && \
    (cmake --build build-ispc --target check-all || true) && \
    (echo "shared libs deps of ispc" && ldd ./build-ispc/bin/ispc) && \
    cmake --install build-ispc && \
    rm -rf build ispc