|
1 | 1 | FROM faasm/llvm:10.0.1 as llvm |
2 | 2 |
|
3 | 3 | # faabric-base image is not re-built often, so tag may be behind |
4 | | -FROM faasm/faabric-base:0.1.0 |
5 | | -ARG SYSROOT_VERSION |
| 4 | +FROM faasm/faabric-base:0.3.5 |
| 5 | +SHELL ["/bin/bash", "-c"] |
| 6 | +ENV CPP_DOCKER="on" |
6 | 7 |
|
7 | 8 | # Copy the toolchain in from the LLVM container |
8 | 9 | COPY --from=llvm /usr/local/faasm /usr/local/faasm |
9 | 10 |
|
10 | | -RUN apt update |
11 | | -RUN apt install -y autotools-dev |
12 | | - |
13 | | -# Get the code |
14 | | -WORKDIR /code |
15 | | -RUN git clone -b v${SYSROOT_VERSION} https://github.com/faasm/cpp |
16 | | -WORKDIR /code/cpp |
| 11 | +# Update APT dependencies |
| 12 | +RUN apt update && apt install -y autotools-dev |
17 | 13 |
|
18 | | -# Update submodules (not LLVM) |
19 | | -RUN git submodule update --init -f third-party/faabric |
20 | | -RUN git submodule update --init -f third-party/faasm-clapack |
21 | | -RUN git submodule update --init -f third-party/libffi |
22 | | -RUN git submodule update --init -f third-party/wasi-libc |
23 | | -RUN git submodule update --init -f third-party/FFmpeg |
| 14 | +# Get the code and submodules |
| 15 | +ARG SYSROOT_VERSION |
| 16 | +RUN mkdir -p /code \ |
| 17 | + && git clone -b v${SYSROOT_VERSION} \ |
| 18 | + https://github.com/faasm/cpp \ |
| 19 | + /code/cpp \ |
| 20 | + && cd /code/cpp \ |
| 21 | + # Update submodules (not LLVM) |
| 22 | + && git submodule update --init -f third-party/faabric \ |
| 23 | + && git submodule update --init -f third-party/faasm-clapack \ |
| 24 | + && git submodule update --init -f third-party/libffi \ |
| 25 | + && git submodule update --init -f third-party/wasi-libc \ |
| 26 | + && git submodule update --init -f third-party/FFmpeg |
24 | 27 |
|
25 | 28 | # Install the faasmtools Python lib |
26 | | -RUN pip3 install -r requirements.txt |
27 | | -RUN pip3 install . |
28 | | - |
29 | | -# --------------------------------- |
30 | | -# NATIVE |
31 | | -# --------------------------------- |
32 | | - |
33 | | -# Native static libraries |
34 | | -RUN inv libfaasm --native |
35 | | -RUN inv libfaasmp --native |
36 | | -RUN inv libfaasmpi --native |
37 | | - |
38 | | -# Native shared libraries |
39 | | -RUN inv libfaasm --native --shared |
40 | | -RUN inv libfaasmp --native --shared |
41 | | -RUN inv libfaasmpi --native --shared |
42 | | - |
43 | | -# --------------------------------- |
44 | | -# WASM |
45 | | -# --------------------------------- |
46 | | - |
47 | | -# Install toolchain files |
48 | | -RUN inv install |
49 | | - |
50 | | -# Libraries |
51 | | -RUN inv libc |
52 | | -RUN inv libffi |
53 | | -RUN inv ffmpeg |
54 | | - |
55 | | -# Both static and shared clapack |
56 | | -RUN inv clapack |
57 | | -RUN inv clapack --clean --shared |
58 | | - |
59 | | -# Faasm libraries to wasm |
60 | | -RUN inv libfaasm |
61 | | -RUN inv libemscripten |
62 | | -RUN inv libfaasmp |
63 | | -RUN inv libfaasmpi |
| 29 | +RUN cd /code/cpp \ |
| 30 | + && ./bin/create_venv.sh \ |
| 31 | + && source venv/bin/activate \ |
| 32 | + && pip3 install -r requirements.txt \ |
| 33 | + && pip3 install . |
| 34 | + |
| 35 | +# Build all the targets |
| 36 | +RUN cd /code/cpp \ |
| 37 | + && source venv/bin/activate \ |
| 38 | + # Build native Faasm libraries (static and shared) |
| 39 | + && inv \ |
| 40 | + libfaasm --native \ |
| 41 | + libfaasmp --native \ |
| 42 | + libfaasmpi --native \ |
| 43 | + libfaasm --native --shared \ |
| 44 | + libfaasmp --native --shared \ |
| 45 | + libfaasmpi --native --shared \ |
| 46 | + # Install toolchain files |
| 47 | + && inv install \ |
| 48 | + # Build ported third-pary WASM libraries |
| 49 | + && inv \ |
| 50 | + clapack \ |
| 51 | + clapack --clean --shared \ |
| 52 | + ffmpeg \ |
| 53 | + libc \ |
| 54 | + libffi \ |
| 55 | + # Build Faasm WASM libraries |
| 56 | + && inv \ |
| 57 | + libemscripten \ |
| 58 | + libfaasm \ |
| 59 | + libfaasmp \ |
| 60 | + libfaasmpi |
64 | 61 |
|
65 | 62 | # CLI setup |
| 63 | +WORKDIR /code/cpp |
66 | 64 | ENV TERM xterm-256color |
67 | | -SHELL ["/bin/bash", "-c"] |
68 | 65 |
|
69 | 66 | RUN echo ". /code/cpp/bin/workon.sh" >> ~/.bashrc |
70 | 67 | CMD ["/bin/bash", "-l"] |
0 commit comments