Enable ACL build (#99)
author박세희/동작제어Lab(SR)/Principal Engineer/삼성전자 <saehie.park@samsung.com>
Tue, 20 Mar 2018 23:22:25 +0000 (08:22 +0900)
committer서상민/동작제어Lab(SR)/Senior Engineer/삼성전자 <sangmin7.seo@samsung.com>
Tue, 20 Mar 2018 23:22:25 +0000 (08:22 +0900)
This will call ACL build when building nnfw. Output .SO files will be copied to out/bin folder with install.

Makefile

index 6cf5a59..a2333e1 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -14,6 +14,9 @@ ifneq (,$(findstring arm,$(TARGET_ARCH_BASE)))
                ROOTFS_ARM=$(ROOTFS_DIR)
                export ROOTFS_ARM
        endif
+       ifeq ($(HOST_OS),linux)
+               BUILD_ACL=1
+       endif
 endif
 # Todo: we may set CROSS_BUILD=1 when ROOTFS_DIR is given
 # the toolchain file, only for cross build
@@ -42,6 +45,11 @@ TIMESTAMP_CONFIGURE=$(WORKDIR)/CONFIGURE
 TIMESTAMP_BUILD=$(WORKDIR)/BUILD
 TIMESTAMP_INSTALL=$(WORKDIR)/INSTALL
 
+ACL_FOLDER=externals/acl
+ACL_COMMAND=scons Werror=1 neon=1 opencl=1 os=linux arch=armv7a examples=0
+# TODO: add these for only debug
+ACL_COMMAND+=debug=1 asserts=1
+
 all: build
 
 ###
@@ -69,6 +77,9 @@ configure_internal:
        touch $(TIMESTAMP_CONFIGURE)
 
 build_internal: $(BUILD_ROOT)
+ifeq ($(BUILD_ACL),1)
+       cd $(ACL_FOLDER) && $(ACL_COMMAND)
+endif
        cd $(BUILD_ROOT) && make all
        rm -rf $(BUILD_ALIAS)
        ln -s $(BUILD_FOLDER) $(BUILD_ALIAS)
@@ -76,6 +87,11 @@ build_internal: $(BUILD_ROOT)
 
 install_internal:
        cd $(BUILD_ROOT) && make install
+ifeq ($(BUILD_ACL),1)
+       @cp -v $(ACL_FOLDER)/build/libarm_compute_core.so $(INSTALL_PATH)/bin/.
+       @cp -v $(ACL_FOLDER)/build/libarm_compute_graph.so $(INSTALL_PATH)/bin/.
+       @cp -v $(ACL_FOLDER)/build/libarm_compute.so $(INSTALL_PATH)/bin/.
+endif
        rm -rf $(INSTALL_ALIAS)
        ln -s $(INSTALL_FOLDER) $(INSTALL_ALIAS)
        touch $(TIMESTAMP_INSTALL)