Skip to content

Commit 3aa892b

Browse files
authored
Clarify split for cross-compiled applications (#104)
* lammps: add task and submodule to cross-compile lammps in the sysroot * lammps: track right submodule branch * lulesh: add task to cross-compile * lulesh: finish tasks * gh: bump code version so that lammps and lulesh are available in the container image * docker: build libfaasmp and libfaasmpi before lulesh and lammps * kernels: update submodule to remove hardcoded paths from makefile * python: format code * kernels: fixes for running tests in faasm * cleanup repo after refactor to faasm/examples * tasks: remove dangling mention of lammps task * tasks: remove tf and ffmpeg from func.local
1 parent 84e91b2 commit 3aa892b

File tree

22 files changed

+17
-481
lines changed

22 files changed

+17
-481
lines changed

.env

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
SYSROOT_VERSION=0.1.11
2-
SYSROOT_CLI_IMAGE=faasm/cpp-sysroot:0.1.11
1+
SYSROOT_VERSION=0.1.12
2+
SYSROOT_CLI_IMAGE=faasm/cpp-sysroot:0.1.12
33
COMPOSE_PROJECT_NAME=cpp-dev

.github/workflows/tests.yml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
if: github.event.pull_request.draft == false
2020
runs-on: ubuntu-20.04
2121
container:
22-
image: faasm/cpp-sysroot:0.1.11
22+
image: faasm/cpp-sysroot:0.1.12
2323
steps:
2424
# --- Update code ---
2525
- name: "Checkout code"
@@ -44,16 +44,8 @@ jobs:
4444
run: ./bin/inv_wrapper.sh libfake
4545
- name: "Build libemscripten"
4646
run: ./bin/inv_wrapper.sh libemscripten
47-
- name: "Build FFmpeg"
48-
run: ./bin/inv_wrapper.sh ffmpeg
4947
- name: "Build zlib"
5048
run: ./bin/inv_wrapper.sh zlib
51-
- name: "Build libpng"
52-
run: ./bin/inv_wrapper.sh libpng
53-
- name: "Build ImageMagick"
54-
run: ./bin/inv_wrapper.sh imagemagick
55-
- name: "Build Tensorflow lite"
56-
run: ./bin/inv_wrapper.sh tensorflow
5749
# --- Build functions to wasm ---
5850
- name: "Build the functions"
5951
run: ./bin/inv_wrapper.sh func.local --clean

.gitmodules

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,7 @@
1616
[submodule "third-party/faabric"]
1717
path = third-party/faabric
1818
url = https://github.com/faasm/faabric.git
19-
[submodule "third-party/FFmpeg"]
20-
path = third-party/FFmpeg
21-
url = https://github.com/faasm/FFmpeg.git
22-
branch = faasm
23-
[submodule "third-party/ImageMagick"]
24-
path = third-party/ImageMagick
25-
url = https://github.com/faasm/ImageMagick.git
26-
branch = faasm
27-
[submodule "third-party/libpng"]
28-
path = third-party/libpng
29-
url = https://github.com/faasm/libpng.git
30-
branch = faasm
3119
[submodule "third-party/zlib"]
3220
path = third-party/zlib
3321
url = https://github.com/faasm/zlib.git
3422
branch = faasm
35-
[submodule "third-party/tensorflow"]
36-
path = third-party/tensorflow
37-
url = https://github.com/faasm/tensorflow.git
38-
branch = faasm

Makefile.envs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ export WASM_RANLIB=${FAASM_WASM_RANLIB}
1616
export WASM_LD=${FAASM_WASM_CC}
1717
export WASM_LDSHARED=${FAASM_WASM_CC}
1818
export WASM_LDFLAGS="${FAASM_WASM_STATIC_LINKER_FLAGS}"
19+
export WASM_EXE_LDFLAGS="${FAASM_WASM_EXE_LINKER_FLAGS}"
20+
export WASM_EXE_LDFLAGS_NO_QUOTES=${FAASM_WASM_EXE_LINKER_FLAGS}
1921

2022
export WASM_BUILD=wasm32
2123
export WASM_HOST=${FAASM_WASM_HOST_SHARED}

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.1.11
1+
0.1.12

docker/cpp-sysroot.dockerfile

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ COPY --from=llvm /usr/local/faasm /usr/local/faasm
1010

1111
# Update APT dependencies
1212
RUN apt update && apt install -y autotools-dev
13-
1413
# Get the code and submodules
1514
ARG SYSROOT_VERSION
1615
RUN mkdir -p /code \
@@ -23,11 +22,7 @@ RUN mkdir -p /code \
2322
&& git submodule update --init -f third-party/faasm-clapack \
2423
&& git submodule update --init -f third-party/libffi \
2524
&& git submodule update --init -f third-party/wasi-libc \
26-
&& git submodule update --init -f third-party/FFmpeg \
27-
&& git submodule update --init -f third-party/zlib \
28-
&& git submodule update --init -f third-party/libpng \
29-
&& git submodule update --init -f third-party/ImageMagick \
30-
&& git submodule update --init -f third-party/tensorflow
25+
&& git submodule update --init -f third-party/zlib
3126

3227
# Install the faasmtools Python lib
3328
RUN cd /code/cpp \
@@ -49,25 +44,19 @@ RUN cd /code/cpp \
4944
libfaasmpi --native --shared \
5045
# Install toolchain files
5146
&& inv install \
52-
# Build ported third-pary WASM libraries (libc first as it is needed in the
53-
# others)
54-
&& inv \
55-
libc \
56-
clapack \
57-
clapack --clean --shared \
58-
ffmpeg \
59-
libffi \
60-
# To build imagemagick, we need to build zlib and libpng
61-
zlib \
62-
libpng \
63-
imagemagick \
64-
tensorflow \
6547
# Build Faasm WASM libraries
6648
&& inv \
6749
libemscripten \
6850
libfaasm \
6951
libfaasmp \
70-
libfaasmpi
52+
libfaasmpi \
53+
# Lastly, build the libraries that populate the sysroot
54+
&& inv \
55+
libc \
56+
clapack \
57+
clapack --clean --shared \
58+
libffi \
59+
zlib
7160

7261
# CLI setup
7362
WORKDIR /code/cpp

faasmtools/build.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
# Toolchain files
2525
CMAKE_TOOLCHAIN_FILE = join(WASM_TOOLCHAIN_TOOLS, "WasiToolchain.cmake")
26+
MAKE_TOOLCHAIN_FILE = join(WASM_TOOLCHAIN_TOOLS, "Makefile.envs")
2627

2728
# Executables
2829
WASM_CC = join(WASM_TOOLCHAIN_BIN, "clang")
@@ -161,6 +162,7 @@
161162
FAASM_BUILD_ENV_DICT = {
162163
"CMAKE_ROOT": FAASM_CMAKE_ROOT,
163164
"FAASM_NATIVE_INSTALL_DIR": FAASM_NATIVE_DIR,
165+
"FAASM_WASM_MAKE_TOOLCHAIN_FILE": MAKE_TOOLCHAIN_FILE,
164166
"FAASM_WASM_CC": WASM_CC,
165167
"FAASM_WASM_CXX": WASM_CXX,
166168
"FAASM_WASM_AR": WASM_AR,

func/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,5 @@ endif ()
7373
add_subdirectory(errors)
7474
add_subdirectory(demo)
7575
add_subdirectory(dynlink)
76-
add_subdirectory(ffmpeg)
7776
add_subdirectory(mpi)
7877
add_subdirectory(omp)
79-
add_subdirectory(tf)

func/ffmpeg/CMakeLists.txt

Lines changed: 0 additions & 25 deletions
This file was deleted.

func/ffmpeg/check.cpp

Lines changed: 0 additions & 32 deletions
This file was deleted.

0 commit comments

Comments
 (0)