diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 59 |
1 files changed, 45 insertions, 14 deletions
@@ -4,10 +4,13 @@ CROSS_BUILD?=0 HOST_OS?=linux TARGET_OS?=linux NPROCS:=1 -OBS_BUILD?=0 +PARALLEL_BUILD?=1 +## TODO: fix obs build break +OBS_BUILD?=OFF COVERAGE_BUILD?=0 BENCHMARK_ACL_BUILD?=0 OPTIONS?= +UPDATE_MODULE?=1 # make TARGET and TYPE to lowercase TARGET_ARCH_LC=$(shell echo $(TARGET_ARCH) | tr A-Z a-z) @@ -56,9 +59,11 @@ ifeq ($(BENCHMARK_ACL_BUILD),1) OPTIONS+= -DBUILD_BENCHMARK_ACL=1 endif -# Get number of processors (linux only for now) -ifeq ($(HOST_OS),linux) - NPROCS:=$(shell grep -c ^processor /proc/cpuinfo) +ifeq ($(PARALLEL_BUILD),1) + # Get number of processors (linux only for now) + ifeq ($(HOST_OS),linux) + NPROCS:=$(shell grep -c ^processor /proc/cpuinfo) + endif endif WORKHOME=Product @@ -79,19 +84,36 @@ TIMESTAMP_CONFIGURE=$(WORKDIR)/CONFIGURE TIMESTAMP_BUILD=$(WORKDIR)/BUILD TIMESTAMP_INSTALL=$(WORKDIR)/INSTALL +# +# for Build Arm Compute Library with SCONS +# ACL_FOLDER=externals/acl -ACL_COMMAND=scons -j${NPROCS} Werror=1 neon=1 opencl=1 os=linux examples=0 embed_kernels=1 +ACL_COMMAND=scons -j${NPROCS} neon=1 opencl=1 examples=0 embed_kernels=1 os=$(TARGET_OS) ifeq ($(TARGET_ARCH_LC),armv7l) ACL_COMMAND+= arch=armv7a + ACL_BUILD_OUT=armv7a-$(TARGET_OS) else ifeq ($(TARGET_ARCH_LC),aarch64) ACL_COMMAND+= arch=arm64-v8a + ACL_BUILD_OUT=arm64-v8a-$(TARGET_OS) +else ifeq ($(TARGET_ARCH_BASE),arm64) + ACL_COMMAND+= arch=arm64-v8a + ACL_BUILD_OUT=arm64-v8a-$(TARGET_OS) endif -ifeq ($(BUILD_TYPE_LC),debug) - ACL_COMMAND+=debug=1 asserts=1 build_dir=debug - ACL_FOLDER_BUILD=$(ACL_FOLDER)/build/debug +ifeq ($(TARGET_OS),android) + ACL_COMMAND+= Werror=0 + ANDROID_GNUSTL_PATH=$(ROOTFS_ARM64)/bin:$(ROOTFS_ARM64)/aarch64-linux-android/bin:$$PATH else - ACL_COMMAND+=build_dir=release - ACL_FOLDER_BUILD=$(ACL_FOLDER)/build/release + ACL_COMMAND+= Werror=1 +endif +ifeq ($(BUILD_TYPE_LC),debug) + ACL_COMMAND+= debug=1 asserts=1 +endif +ACL_FOLDER_NAME=$(ACL_BUILD_OUT).$(BUILD_TYPE_LC) +ACL_COMMAND+= build_dir=$(ACL_FOLDER_NAME) +ACL_FOLDER_BUILD=$(ACL_FOLDER)/build/$(ACL_FOLDER_NAME) + +ifeq ($(OBS_BUILD),ON) + UPDATE_MODULE=0 endif all: build @@ -122,7 +144,7 @@ tflite: tflite_build_internal ### Command (internal) ### configure_internal: -ifneq ($(TARGET_OS),tizen) +ifeq ($(UPDATE_MODULE),1) git submodule update --init --recursive endif @@ -132,6 +154,7 @@ endif -DCMAKE_BUILD_TYPE=$(BUILD_TYPE_LC) -DTARGET_ARCH=$(TARGET_ARCH_LC) \ -DHOST_OS=$(HOST_OS) \ -DTARGET_OS=$(TARGET_OS) \ + -DOBS_BUILD=$(OBS_BUILD) \ $(OPTION_TOOLCHAIN) \ $(OPTIONS) touch $(TIMESTAMP_CONFIGURE) @@ -149,7 +172,15 @@ install_internal: touch $(TIMESTAMP_INSTALL) internal_acl_build: +ifeq ($(UPDATE_MODULE),1) + git submodule update --init --recursive +endif + +ifeq ($(TARGET_OS),android) + cd $(ACL_FOLDER) && CXX=clang++ CC=clang PATH=$(ANDROID_GNUSTL_PATH) $(ACL_COMMAND) +else cd $(ACL_FOLDER) && $(ACL_COMMAND) +endif internal_acl_install: @mkdir -vp $(INSTALL_PATH)/lib @@ -193,7 +224,7 @@ build_coverage_suite: install_internal @mv coverage-suite.tar.gz $(INSTALL_ROOT)/. runtime_build_internal: $(BUILD_ROOT) - cd $(BUILD_ROOT) && make -j $(NPROCS) runtime + cd $(BUILD_ROOT) && make -j $(NPROCS) nnapi_pure_arm_compute rm -rf $(BUILD_ALIAS) ln -s $(BUILD_FOLDER) $(BUILD_ALIAS) touch $(TIMESTAMP_BUILD) @@ -202,14 +233,14 @@ test_build_internal: $(BUILD_ROOT) # Build test cd $(BUILD_ROOT) && make -j $(NPROCS) nnapi_test # Build unittest - cd $(BUILD_ROOT) && make -j $(NPROCS) kernelacl_test runtime_run_android_nn_test + cd $(BUILD_ROOT) && make -j $(NPROCS) runtime_run_android_nn_test rm -rf $(BUILD_ALIAS) ln -s $(BUILD_FOLDER) $(BUILD_ALIAS) touch $(TIMESTAMP_BUILD) tflite_build_internal: $(BUILD_ROOT) # Build test - cd $(BUILD_ROOT) && make -j $(NPROCS) tensorflow-lite + cd $(BUILD_ROOT) && make -j $(NPROCS) tensorflow-lite gtest_main rm -rf $(BUILD_ALIAS) ln -s $(BUILD_FOLDER) $(BUILD_ALIAS) touch $(TIMESTAMP_BUILD) |