forked from micropython/micropython
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild-ml.sh
More file actions
executable file
·30 lines (24 loc) · 793 Bytes
/
Copy pathbuild-ml.sh
File metadata and controls
executable file
·30 lines (24 loc) · 793 Bytes
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
#!/usr/bin/env bash
# Build and test the ml unix variant (ulab + scipy + torch_c).
# Safe to run from any working directory.
set -euo pipefail
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
NUMERIC="${ROOT}/lib/numeric-modules"
UNIX="${ROOT}/ports/unix"
MPY="${UNIX}/build-ml/micropython"
TEST="${ROOT}/tests/ml/integration.py"
MPL_TEST="${ROOT}/tests/ml/matplotlib_integration.py"
mkdir -p "${NUMERIC}"
ln -sfn ../../micropython-ulab/code "${NUMERIC}/ulab"
ln -sfn ../cml-micropython/cml "${NUMERIC}/cml"
if [[ ! -d "${UNIX}" ]]; then
echo "error: expected unix port at ${UNIX}" >&2
exit 1
fi
make -C "${UNIX}" VARIANT=ml submodules
make -C "${UNIX}" VARIANT=ml "$@"
if [[ "${1:-}" != "clean" ]]; then
cd "${ROOT}"
"${MPY}" "${TEST}"
"${MPY}" "${MPL_TEST}"
fi