11# llvm image is not re-built often, so the tag may be behind
22FROM ghcr.io/faasm/llvm:0.7.0 AS llvm
33
4- # faabric-base image is not re-built often, so tag may be behind
5- FROM ghcr.io/faasm/faabric-base:0.22.0
4+ # Start from a fresh ubuntu image, cpp-sysroot has little built deps.
5+ FROM ubuntu:24.04
6+
7+ RUN set -eux; \
8+ apt update; \
9+ apt install -y --no-install-recommends \
10+ autoconf \
11+ automake \
12+ autopoint \
13+ autotools-dev \
14+ clang-17 \
15+ cmake \
16+ gettext \
17+ libtool \
18+ llvm-17 \
19+ m4 \
20+ ninja-build \
21+ make \
22+ pkg-config \
23+ python3-pip \
24+ python3-venv \
25+ git \
26+ vim-tiny; \
27+ apt autoremove -y; \
28+ apt clean; rm -rf /var/lib/apt/lists/*
29+
630SHELL ["/bin/bash" , "-c" ]
731ENV CPP_DOCKER="on"
832
9- # Copy the toolchain and LLVM sources from the LLVM container
33+ # Copy the toolchain and LLVM OpenMP sources necessary to build libfaasmp
1034COPY --from=llvm /usr/local/faasm /usr/local/faasm
11- # COPY --from=llvm /opt/llvm-project /opt/llvm-project
35+ COPY --from=llvm \
36+ /opt/llvm-project/build/llvm/projects/openmp/runtime/src \
37+ /opt/llvm-project/build/llvm/projects/openmp/runtime/src
1238
13- # Update APT dependencies
14- RUN apt update && apt install -y autotools-dev
1539# Get the code and submodules
1640ARG SYSROOT_VERSION
1741RUN mkdir -p /code \
@@ -42,9 +66,6 @@ RUN cd /code/cpp \
4266 libfaasmpi --native --shared \
4367 # Install toolchain files
4468 && inv install \
45- # Build wasi-libc and reset the sysroot. The second call to LLVM just
46- # installs some headers that are purged
47- && inv llvm.libc --purge llvm \
4869 # Build Faasm WASM libraries for wasm32-wasi target
4970 && inv \
5071 libfaasm \
@@ -55,12 +76,16 @@ RUN cd /code/cpp \
5576 libfaasm --threads \
5677 libemscripten --threads \
5778 libfaasmp \
58- # Lastly, build the libraries that populate the sysroot
79+ # Lastly, build the libraries that populate the sysroot. For some reason
80+ # we need to re-run apt update for libtool to work properly.
81+ && apt update \
5982 && inv \
6083 libffi \
6184 libffi --threads \
6285 zlib \
63- zlib --threads
86+ zlib --threads \
87+ && apt autoremove -y \
88+ && apt clean; rm -rf /var/lib/apt/lists/*
6489
6590# CLI setup
6691WORKDIR /code/cpp
0 commit comments