ARMNN_BACKEND_MAKEFILE_PATHS := $(subst $(LOCAL_PATH),,$(ARMNN_BACKEND_MAKEFILE_LOCAL_PATHS))
ARMNN_BACKEND_MAKEFILE_DIRS := $(subst /backend.mk,,$(ARMNN_BACKEND_MAKEFILE_PATHS))
-# Get ArmNN's version from file
-get_version_number = $(shell sed -n 's/.*$1 *\([0-9*]\)/\1/p' $(LOCAL_PATH)/ArmnnVersion.txt)
-ARMNN_VERSION := 20$(call get_version_number,ARMNN_MAJOR_VERSION)$(call get_version_number,ARMNN_MINOR_VERSION)$(call get_version_number,ARMNN_PATCH_VERSION)
-$(info armnn ARMNN_VERSION: $(ARMNN_VERSION))
-
##############
# libarmnn.a #
##############
-std=$(CPP_VERSION) \
-fexceptions \
-Wno-unused-parameter \
- -frtti \
- -DARMNN_VERSION_FROM_FILE=$(ARMNN_VERSION)
+ -frtti
# The variable to enable/disable the CL backend (ARMNN_COMPUTE_CL_ENABLED) is declared in android-nn-driver/Android.mk
ifeq ($(ARMNN_COMPUTE_CL_ENABLED),1)
-std=$(CPP_VERSION) \
-fexceptions \
-frtti \
- -isystem vendor/arm/android-nn-driver/boost_1_64_0 \
- -DARMNN_VERSION_FROM_FILE=$(ARMNN_VERSION)
+ -isystem vendor/arm/android-nn-driver/boost_1_64_0
# The variable to enable/disable the CL backend (ARMNN_COMPUTE_CL_ENABLED) is declared in android-nn-driver/Android.mk
ifeq ($(ARMNN_COMPUTE_CL_ENABLED),1)
+++ /dev/null
-#
-# Copyright © 2019 Arm Ltd. All rights reserved.
-# SPDX-License-Identifier: MIT
-#
-
-# ArmNN version number components
-ARMNN_MAJOR_VERSION 19
-ARMNN_MINOR_VERSION 08
-ARMNN_PATCH_VERSION 00
target_link_libraries(armnnCaffeParser armnn)
target_link_libraries(armnnCaffeParser ${PROTOBUF_LIBRARIES})
+ set_target_properties(armnnCaffeParser PROPERTIES VERSION ${GENERIC_LIB_VERSION} SOVERSION ${GENERIC_LIB_SOVERSION})
endif()
# Protobuf
target_link_libraries(armnnOnnxParser ${PROTOBUF_LIBRARIES})
+ set_target_properties(armnnOnnxParser PROPERTIES VERSION ${GENERIC_LIB_VERSION} SOVERSION ${GENERIC_LIB_SOVERSION})
endif()
if(BUILD_TF_PARSER)
# Protobuf (use the specific version tensorflow wants)
target_link_libraries(armnnTfParser ${PROTOBUF_LIBRARIES})
+ set_target_properties(armnnTfParser PROPERTIES VERSION ${GENERIC_LIB_VERSION} SOVERSION ${GENERIC_LIB_SOVERSION})
endif()
if(BUILD_ARMNN_QUANTIZER AND ARMNNREF)
target_link_libraries(ArmnnQuantizer pthread)
endif()
+ set_target_properties(ArmnnQuantizer PROPERTIES VERSION ${GENERIC_LIB_VERSION} SOVERSION ${GENERIC_LIB_SOVERSION})
+
endif()
target_link_libraries(armnn pthread)
endif()
+set_target_properties(armnn PROPERTIES VERSION ${GENERIC_LIB_VERSION} SOVERSION ${GENERIC_LIB_SOVERSION})
+
if(BUILD_UNIT_TESTS)
set(unittest_sources)
list(APPEND unittest_sources
#
# Read the ArmNN version components from file
-file(READ ${CMAKE_CURRENT_LIST_DIR}/../ArmnnVersion.txt armnnVersion)
+file(READ ${CMAKE_CURRENT_LIST_DIR}/../include/armnn/Version.hpp armnnVersion)
# Parse the ArmNN version components
-string(REGEX MATCH "ARMNN_MAJOR_VERSION ([0-9]*)" _ ${armnnVersion})
+string(REGEX MATCH "#define ARMNN_MAJOR_VERSION ([0-9]*)" _ ${armnnVersion})
set(ARMNN_MAJOR_VERSION ${CMAKE_MATCH_1})
-string(REGEX MATCH "ARMNN_MINOR_VERSION ([0-9]*)" _ ${armnnVersion})
+string(REGEX MATCH "#define ARMNN_MINOR_VERSION ([0-9]*)" _ ${armnnVersion})
set(ARMNN_MINOR_VERSION ${CMAKE_MATCH_1})
-string(REGEX MATCH "ARMNN_PATCH_VERSION ([0-9]*)" _ ${armnnVersion})
-set(ARMNN_PATCH_VERSION ${CMAKE_MATCH_1})
-# Put together the ArmNN version (YYYYMMPP)
-set(ARMNN_VERSION "20${ARMNN_MAJOR_VERSION}${ARMNN_MINOR_VERSION}${ARMNN_PATCH_VERSION}")
+# Define LIB version
+set(GENERIC_LIB_VERSION "${ARMNN_MAJOR_VERSION}.${ARMNN_MINOR_VERSION}")
-# Pass the ArmNN version to the build
-if(${CMAKE_VERSION} VERSION_LESS "3.12.0")
- add_definitions(-DARMNN_VERSION_FROM_FILE=${ARMNN_VERSION})
-else()
- add_compile_definitions(ARMNN_VERSION_FROM_FILE=${ARMNN_VERSION})
-endif()
+# Define LIB soversion
+set(GENERIC_LIB_SOVERSION "${ARMNN_MAJOR_VERSION}")
#pragma once
-#if !defined(ARMNN_VERSION_FROM_FILE)
-#error "A valid version of ArmNN must be provided at compile time"
-#endif
-
+// Macro utils
#define STRINGIFY_VALUE(s) STRINGIFY_MACRO(s)
#define STRINGIFY_MACRO(s) #s
+#define CONCAT_VALUE(a, b, c) CONCAT_MACRO(a, b, c)
+#define CONCAT_MACRO(a, b, c) a ## b ## c
+
+// ArmNN version components
+#define ARMNN_MAJOR_VERSION 19
+#define ARMNN_MINOR_VERSION 08
+#define ARMNN_PATCH_VERSION 00
-// YYYYMMPP
+// ARMNN_VERSION: "YYYYMMPP"
// where:
// YYYY = 4-digit year number
// MM = 2-digit month number
// PP = 2-digit patch number
-// Defined in ArmnnVersion.txt
-#define ARMNN_VERSION STRINGIFY_VALUE(ARMNN_VERSION_FROM_FILE)
-
-// Check that the provided ArmNN version is valid
-static_assert(sizeof(ARMNN_VERSION) == 9, "Invalid ArmNN version, a valid version should have exactly 8 digits");
+#define ARMNN_VERSION "20" STRINGIFY_VALUE(CONCAT_VALUE(ARMNN_MAJOR_VERSION, ARMNN_MINOR_VERSION, ARMNN_PATCH_VERSION))
install(TARGETS armnnSerializer
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
+ set_target_properties(armnnSerializer PROPERTIES VERSION ${GENERIC_LIB_VERSION} SOVERSION ${GENERIC_LIB_SOVERSION} )
endif()
target_link_libraries(armnnTfLiteParser ${Boost_FILESYSTEM_LIBRARY} ${Boost_THREAD_LIBRARY})
target_link_libraries(armnnTfLiteParser armnn ${FLATBUFFERS_LIBRARY})
+ set_target_properties(armnnTfLiteParser PROPERTIES VERSION ${GENERIC_LIB_VERSION} SOVERSION ${GENERIC_LIB_SOVERSION} )
+
install(TARGETS armnnTfLiteParser
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})