-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathcpp-sysroot.dockerfile
More file actions
70 lines (63 loc) · 2.13 KB
/
cpp-sysroot.dockerfile
File metadata and controls
70 lines (63 loc) · 2.13 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
# llvm image is not re-built often, so the tag may be behind
FROM ghcr.io/faasm/llvm:0.7.0 AS llvm
# faabric-base image is not re-built often, so tag may be behind
FROM ghcr.io/faasm/faabric-base:0.21.0
SHELL ["/bin/bash", "-c"]
ENV CPP_DOCKER="on"
# Copy the toolchain and LLVM sources from the LLVM container
COPY --from=llvm /usr/local/faasm /usr/local/faasm
COPY --from=llvm /opt/llvm-project /opt/llvm-project
# Update APT dependencies
RUN apt update && apt install -y autotools-dev
# 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 wasi-libc and reset the sysroot. The second call to LLVM just
# installs some headers that are purged
&& inv llvm.libc --purge llvm \
# 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"]