-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathcpp-sysroot.dockerfile
More file actions
94 lines (85 loc) · 2.51 KB
/
cpp-sysroot.dockerfile
File metadata and controls
94 lines (85 loc) · 2.51 KB
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# llvm image is not re-built often, so the tag may be behind
FROM ghcr.io/faasm/llvm:0.7.0 AS llvm
# Start from a fresh ubuntu image, cpp-sysroot has little built deps.
FROM ubuntu:24.04
RUN apt update \
&& apt install -y --no-install-recommends \
autoconf \
automake \
autopoint \
autotools-dev \
clang-17 \
clang-format-17 \
cmake \
dpkg-dev \
gawk \
gettext \
git \
libltdl-dev \
libtool \
llvm-17 \
make \
m4 \
ninja-build \
pkg-config \
python3-pip \
python3-venv \
vim-tiny \
&& apt autoremove \
&& rm -rf /var/lib/apt/lists/*
SHELL ["/bin/bash", "-c"]
ENV CPP_DOCKER="on"
# Copy the toolchain and LLVM OpenMP sources necessary to build libfaasmp
COPY --from=llvm /usr/local/faasm /usr/local/faasm
COPY --from=llvm \
/opt/llvm-project/build/llvm/projects/openmp/runtime/src \
/opt/llvm-project/build/llvm/projects/openmp/runtime/src
# Get the code and submodules
ARG SYSROOT_VERSION
RUN mkdir -p /code \
&& git clone -b v${SYSROOT_VERSION} \
https://github.com/faasm/cpp \
/code/cpp \
&& cd /code/cpp \
&& git submodule update --init -f third-party/faabric \
&& git submodule update --init -f third-party/faasm-clapack \
&& git submodule update --init -f third-party/libffi \
&& git submodule update --init -f third-party/wasi-libc \
&& git submodule update --init -f third-party/zlib
# Python set-up
RUN cd /code/cpp \
&& ./bin/create_venv.sh
# Build all the targets
RUN cd /code/cpp \
&& source venv/bin/activate \
# Build native Faasm libraries (static and shared)
&& inv \
libfaasm --native \
libfaasmp --native \
libfaasmpi --native \
libfaasm --native --shared \
libfaasmp --native --shared \
libfaasmpi --native --shared \
# Install toolchain files
&& inv install \
# Build Faasm WASM libraries for wasm32-wasi target
&& inv \
libfaasm \
libemscripten \
libfaasmpi \
# Build Faasm WASM libraries for wasm32-wasi-threads target
&& inv \
libfaasm --threads \
libemscripten --threads \
libfaasmp \
# Lastly, build the libraries that populate the sysroot
&& inv \
libffi \
libffi --threads \
zlib \
zlib --threads
# CLI setup
WORKDIR /code/cpp
ENV TERM=xterm-256color
RUN echo ". /code/cpp/bin/workon.sh" >> ~/.bashrc
CMD ["/bin/bash", "-l"]