blob: 22d96e71d7a622928e51e3d71012739f4972bf02 (
plain)
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
|
#
# NOTE this is provided as experimental Makefile to ARM32 cross building
# some modules of compiler.
#
BUILD_TYPE?=Debug
CURRENT_DIR=$(shell pwd)
BUILDFOLDER=build
ARM32_FOLDER=arm32
ROOTFS_ARM?=$(CURRENT_DIR)/tools/cross/rootfs/arm
NNCC_CFG_OPTION_EXTRA?=
TYPE_FOLDER=$(shell echo $(BUILD_TYPE) | tr A-Z a-z)
BUILD_ARM32_FOLDER=$(BUILDFOLDER)/$(ARM32_FOLDER).$(TYPE_FOLDER)
BUILD_ARM32_HOST=$(BUILDFOLDER)/$(ARM32_FOLDER).$(TYPE_FOLDER).host
ARM32_INSTALL_FOLDER=$(CURRENT_DIR)/$(BUILDFOLDER)/$(ARM32_FOLDER).$(TYPE_FOLDER).install
ARM32_INSTALL_HOST=$(CURRENT_DIR)/$(BUILDFOLDER)/$(ARM32_FOLDER).$(TYPE_FOLDER).host.install
# ARM32 build
ARM32_BUILD_ITEMS:=angkor;cwrap;pepper-str;pepper-strcast;pp
ARM32_BUILD_ITEMS+=;pepper-csv2vec;crew
ARM32_BUILD_ITEMS+=;oops;pepper-assert
ARM32_BUILD_ITEMS+=;hermes;hermes-std
ARM32_BUILD_ITEMS+=;loco;locop;logo-core;logo
ARM32_BUILD_ITEMS+=;safemain;mio-circle04;mio-tflite280
ARM32_BUILD_ITEMS+=;dio-hdf5
ARM32_BUILD_ITEMS+=;foder;circle-verify;souschef;arser;vconone
ARM32_BUILD_ITEMS+=;luci
ARM32_BUILD_ITEMS+=;luci-interpreter
ARM32_BUILD_ITEMS+=;tflite2circle
ARM32_BUILD_ITEMS+=;tflchef;circlechef
ARM32_BUILD_ITEMS+=;circle2circle;record-minmax;circle-quantizer
ARM32_BUILD_ITEMS+=;luci-eval-driver;luci-value-test
ARM32_TOOLCHAIN_FILE=cmake/buildtool/cross/toolchain_armv7l-linux.cmake
ARM32_HOST_ITEMS:=angkor;cwrap;pepper-str;pepper-strcast;pp
ARM32_HOST_ITEMS+=;pepper-csv2vec
ARM32_HOST_ITEMS+=;oops
ARM32_HOST_ITEMS+=;hermes;hermes-std
ARM32_HOST_ITEMS+=;loco;locop;logo-core;logo
ARM32_HOST_ITEMS+=;safemain;mio-circle04;mio-tflite280
ARM32_HOST_ITEMS+=;foder;circle-verify;souschef;arser;vconone
ARM32_HOST_ITEMS+=;luci
ARM32_HOST_ITEMS+=;luci-interpreter
ARM32_HOST_ITEMS+=;tflite2circle
ARM32_HOST_ITEMS+=;tflchef;circlechef
ARM32_HOST_ITEMS+=;circle-tensordump
ARM32_HOST_ITEMS+=;circle2circle
ARM32_HOST_ITEMS+=;common-artifacts
ARM32_HOST_ITEMS+=;luci-eval-driver;luci-value-test
_SPACE_:=
_SPACE_+=
ARM32_BUILD_WHITELIST=$(subst $(_SPACE_),,$(ARM32_BUILD_ITEMS))
ARM32_HOST_WHITELIST=$(subst $(_SPACE_),,$(ARM32_HOST_ITEMS))
NNCC_CFG_OPTION+= -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) -DENABLE_COVERAGE=OFF
NNCC_CFG_STRICT= -DENABLE_STRICT_BUILD=ON
INT_TARGETS:=int_configure_arm32 int_configure_arm32_host \
int_build_arm32 int_build_arm32_host int_test_arm32_host int_test
NNCC_ARM32_DEBUG= -DBUILD_WHITELIST="$(ARM32_BUILD_WHITELIST)"
NNCC_ARM32_DEBUG_HOST= -DBUILD_WHITELIST="$(ARM32_HOST_WHITELIST)"
DEF_TARGETS:=all
VAL_TARGETS:=cfg debug test_prep test
.PHONY: $(INT_TARGETS) $(DEF_TARGETS) $(VAL_TARGETS)
.DEFAULT_GOAL: help
help:
@echo "cfg : debug configure"
@echo "debug : debug build"
@echo "test_prep: debug test preparation"
@echo "test : debug test in target"
###############################################################################
# do not call int_xxxx directly as the depend on environment variables
#
# configures
#
int_configure_arm32_host:
NNCC_WORKSPACE=$(BUILD_ARM32_HOST) ./nncc configure \
$(NNCC_CFG_OPTION) \
$(NNCC_ARM32_DEBUG_HOST) $(NNCC_CFG_STRICT) \
-DCMAKE_INSTALL_PREFIX="$(ARM32_INSTALL_HOST)" \
-DENABLE_TEST=ON
int_configure_arm32:
ROOTFS_DIR=$(ROOTFS_ARM) TARGET_ARCH=armv7l \
BUILD_HOST_EXEC=$(CURRENT_DIR)/$(BUILD_ARM32_HOST) \
NNCC_WORKSPACE=$(BUILD_ARM32_FOLDER) ./nncc configure \
$(NNCC_CFG_OPTION) $(NNCC_CFG_OPTION_EXTRA) \
$(NNCC_ARM32_DEBUG) $(NNCC_CFG_STRICT) \
-DCMAKE_TOOLCHAIN_FILE=$(ARM32_TOOLCHAIN_FILE) \
-DCMAKE_INSTALL_PREFIX="$(ARM32_INSTALL_FOLDER)" \
-DENABLE_TEST=ON
#
# builds
#
int_build_arm32_host:
NNCC_WORKSPACE=$(BUILD_ARM32_HOST) ./nncc build -j1
int_build_arm32:
ROOTFS_DIR=$(ROOTFS_ARM) TARGET_ARCH=armv7l \
BUILD_HOST_EXEC=$(CURRENT_DIR)/$(BUILD_ARM32_HOST) \
NNCC_WORKSPACE=$(BUILD_ARM32_FOLDER) ./nncc build -j1
#
# host test; run test in host to generate random input and expected outputs
#
int_test_arm32_host:
NNCC_WORKSPACE=$(BUILD_ARM32_HOST) ./nncc test
#
# tests: run in ARM32 Ubuntu 18.04 device
#
int_test:
NNCC_WORKSPACE=$(BUILD_ARM32_FOLDER) ./nncc test
################################################################################
all: int_configure_arm32_host int_build_arm32_host int_configure_arm32 int_build_arm32
cfg: int_configure_arm32_host int_build_arm32_host int_configure_arm32
debug: int_build_arm32
# NOTE before run test in ARM32, run test in host is required to prepare test data
test_prep: int_test_arm32_host
# NOTE run test in ARM32 Ubuntu 18.04 device
test: int_test
|