forked from pytorch/executorch
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild_wasm_tests.sh
More file actions
38 lines (33 loc) · 1.29 KB
/
build_wasm_tests.sh
File metadata and controls
38 lines (33 loc) · 1.29 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
#!/usr/bin/env bash
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
for arg in "$@"; do
if [ "$arg" == "--enable-etdump" ]; then
ETDUMP_OPTS="-DEXECUTORCH_ENABLE_EVENT_TRACER=ON \
-DEXECUTORCH_BUILD_DEVTOOLS=ON \
-DFLATCC_ALLOW_WERROR=OFF"
# FlatCC generates warnings depending on the compiler version.
# This may be removed once the warnings are fixed.
fi
done
CMAKE_OUT=cmake-out-wasm
cd "$(dirname "${BASH_SOURCE[0]}")/../"
emcmake cmake . -DEXECUTORCH_BUILD_WASM=ON \
-DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON \
-DEXECUTORCH_BUILD_EXTENSION_FLAT_TENSOR=ON \
-DEXECUTORCH_BUILD_EXTENSION_MODULE=ON \
-DEXECUTORCH_BUILD_EXTENSION_NAMED_DATA_MAP=ON \
-DEXECUTORCH_BUILD_EXTENSION_TENSOR=ON \
-DEXECUTORCH_SELECT_OPS_LIST="aten::mm.out,aten::add.out" \
-DEXECUTORCH_BUILD_TESTS=ON \
-DCMAKE_BUILD_TYPE=Release \
${ETDUMP_OPTS} -B"${CMAKE_OUT}"
if [ "$(uname)" == "Darwin" ]; then
CMAKE_JOBS=$(( $(sysctl -n hw.ncpu) - 1 ))
else
CMAKE_JOBS=$(( $(nproc) - 1 ))
fi
cmake --build ${CMAKE_OUT} --target executorch_wasm_tests -j ${CMAKE_JOBS}