Skip to content

Commit 48429da

Browse files
authored
Fix compilation errors of workload xnnpack and meshoptimizer (#2081)
1 parent 403ccf0 commit 48429da

File tree

5 files changed

+27
-15
lines changed

5 files changed

+27
-15
lines changed

.github/workflows/build_iwasm_release.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,7 @@ jobs:
4848
./core/deps/llvm/build/libexec
4949
./core/deps/llvm/build/share
5050
key: ${{ inputs.llvm_cache_key }}
51-
52-
- name: Quit if cache miss
53-
if: steps.retrieve_llvm_libs.outputs.cache-hit != 'true'
54-
run: echo "::error::can not get prebuilt llvm libraries" && exit 1
51+
fail-on-cache-miss: true
5552

5653
- name: generate iwasm binary release
5754
run: |

.github/workflows/build_wamrc.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,7 @@ jobs:
4848
./core/deps/llvm/build/libexec
4949
./core/deps/llvm/build/share
5050
key: ${{ inputs.llvm_cache_key }}
51-
52-
- name: Quit if cache miss
53-
if: steps.retrieve_llvm_libs.outputs.cache-hit != 'true'
54-
run: echo "::error::can not get prebuilt llvm libraries" && exit 1
51+
fail-on-cache-miss: true
5552

5653
- name: generate wamrc binary release
5754
run: |

samples/workload/XNNPACK/CMakeLists.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,10 @@ include(ExternalProject)
1111
ExternalProject_Add(xnnpack
1212
PREFIX xnnpack
1313
GIT_REPOSITORY https://github.com/google/XNNPACK.git
14-
GIT_TAG master
14+
GIT_TAG 4570a7151aa4f3e57eca14a575eeff6bb13e26be
1515
GIT_PROGRESS ON
1616
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/xnnpack
17-
UPDATE_COMMAND git checkout .
18-
&& git reset --hard 4570a7151aa4f3e57eca14a575eeff6bb13e26be
17+
UPDATE_COMMAND git restore .
1918
&& cmake -E copy ${CMAKE_CURRENT_SOURCE_DIR}/xnnpack/google3/third_party/XNNPACK/microkernels.bzl
2019
${CMAKE_CURRENT_SOURCE_DIR}/xnnpack/
2120
&& git apply ${CMAKE_CURRENT_SOURCE_DIR}/xnnpack.patch

samples/workload/XNNPACK/xnnpack.patch

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,22 @@ index 688279da1..376996885 100644
1515
+build:wasm --crosstool_top=@emsdk//emscripten_toolchain:everything
1616
+build:wasm --host_crosstool_top=@bazel_tools//tools/cpp:toolchain
1717
diff --git a/WORKSPACE b/WORKSPACE
18-
index cd8960ffa..5d3e685f4 100644
18+
index cd8960ffa..787e03ca8 100644
1919
--- a/WORKSPACE
2020
+++ b/WORKSPACE
21-
@@ -92,8 +92,25 @@ http_archive(
21+
@@ -29,8 +29,9 @@ http_archive(
22+
# Google Benchmark library, used in micro-benchmarks.
23+
http_archive(
24+
name = "com_google_benchmark",
25+
- strip_prefix = "benchmark-main",
26+
- urls = ["https://github.com/google/benchmark/archive/main.zip"],
27+
+ sha256 = "1ba14374fddcd9623f126b1a60945e4deac4cdc4fb25a5f25e7f779e36f2db52",
28+
+ strip_prefix = "benchmark-d2a8a4ee41b923876c034afb939c4fc03598e622",
29+
+ urls = ["https://github.com/google/benchmark/archive/d2a8a4ee41b923876c034afb939c4fc03598e622.zip"],
30+
)
31+
32+
# FP16 library, used for half-precision conversions
33+
@@ -92,8 +93,25 @@ http_archive(
2234
],
2335
)
2436

@@ -47,7 +59,7 @@ index cd8960ffa..5d3e685f4 100644
4759
-android_sdk_repository(name = "androidsdk")
4860
+#android_sdk_repository(name = "androidsdk")
4961
diff --git a/build_defs.bzl b/build_defs.bzl
50-
index b8217a18d..da232966e 100644
62+
index b8217a18d..6f2d1675e 100644
5163
--- a/build_defs.bzl
5264
+++ b/build_defs.bzl
5365
@@ -380,7 +380,7 @@ def xnnpack_benchmark(name, srcs, copts = [], deps = [], tags = []):
@@ -59,6 +71,13 @@ index b8217a18d..da232966e 100644
5971
srcs = srcs,
6072
copts = xnnpack_std_cxxopts() + [
6173
"-Iinclude",
74+
@@ -405,5 +405,5 @@ def xnnpack_benchmark(name, srcs, copts = [], deps = [], tags = []):
75+
":emscripten": xnnpack_emscripten_deps(),
76+
"//conditions:default": [],
77+
}),
78+
- tags = tags,
79+
+ tags = tags,
80+
)
6281
diff --git a/emscripten.bzl b/emscripten.bzl
6382
index f1557a7b1..7f964a094 100644
6483
--- a/emscripten.bzl

samples/workload/meshoptimizer/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ ExternalProject_Add(codecbench
2222
PREFIX codecbench
2323
GIT_REPOSITORY https://github.com/zeux/meshoptimizer.git
2424
GIT_TAG f734fd572aed5bf76e84d9ed62ca6f4f6c47d84e
25-
GIT_SHALLOW ON
25+
GIT_SHALLOW OFF
2626
GIT_PROGRESS ON
2727
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/meshoptimizer
2828
UPDATE_COMMAND git clean -fd && git checkout -- *

0 commit comments

Comments
 (0)