Accepting request 1042946 from home:Guillaume_G:branches:science:machinelearning
- tensorflow-lite >= 2.10 is only avaialble on Tumbleweed - Add patch to use static libraries not object libraries for support library: * armnn-281e97b.patch OBS-URL: https://build.opensuse.org/request/show/1042946 OBS-URL: https://build.opensuse.org/package/show/science:machinelearning/armnn?expand=0&rev=66
This commit is contained in:
parent
57b146d70b
commit
e00b6ac8ff
122
armnn-281e97b.patch
Normal file
122
armnn-281e97b.patch
Normal file
@ -0,0 +1,122 @@
|
|||||||
|
From 281e97b415ec429b6878aec7635cb74b8ed7ebca Mon Sep 17 00:00:00 2001
|
||||||
|
From: Francis Murtagh <francis.murtagh@arm.com>
|
||||||
|
Date: Tue, 13 Dec 2022 17:21:55 +0000
|
||||||
|
Subject: [PATCH] Github #712: Use static libraries not object libraries for support library
|
||||||
|
|
||||||
|
* .o files were being installed by cmake.
|
||||||
|
|
||||||
|
Change-Id: Ie2056e09b4800fe208d784a90f3908d508b8cadf
|
||||||
|
Signed-off-by: Francis Murtagh <francis.murtagh@arm.com>
|
||||||
|
---
|
||||||
|
|
||||||
|
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||||
|
index fc4207b..51c4cf2 100644
|
||||||
|
--- a/CMakeLists.txt
|
||||||
|
+++ b/CMakeLists.txt
|
||||||
|
@@ -1,5 +1,5 @@
|
||||||
|
#
|
||||||
|
-# Copyright © 2022 Arm Ltd and Contributors. All rights reserved.
|
||||||
|
+# Copyright © 2018-2022 Arm Ltd and Contributors. All rights reserved.
|
||||||
|
# Copyright 2020 NXP
|
||||||
|
# SPDX-License-Identifier: MIT
|
||||||
|
#
|
||||||
|
@@ -109,7 +109,6 @@
|
||||||
|
src/armnnUtils/Transpose.cpp
|
||||||
|
)
|
||||||
|
|
||||||
|
-add_library(armnnUtilsObj OBJECT ${armnnUtils_sources})
|
||||||
|
add_library_ex(armnnUtils STATIC ${armnnUtils_sources})
|
||||||
|
|
||||||
|
target_include_directories(armnnUtils PRIVATE src/backends)
|
||||||
|
@@ -839,7 +838,7 @@
|
||||||
|
list(APPEND unittest_sources $<TARGET_OBJECTS:${lib}>)
|
||||||
|
endforeach()
|
||||||
|
|
||||||
|
- add_executable(UnitTests ${unittest_sources} $<TARGET_OBJECTS:armnnUtilsObj>)
|
||||||
|
+ add_executable(UnitTests ${unittest_sources})
|
||||||
|
target_include_directories(UnitTests PRIVATE src/armnn)
|
||||||
|
target_include_directories(UnitTests PRIVATE src/armnnUtils)
|
||||||
|
target_include_directories(UnitTests PRIVATE src/armnnTestUtils)
|
||||||
|
@@ -1004,14 +1003,6 @@
|
||||||
|
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||||
|
)
|
||||||
|
|
||||||
|
-install(
|
||||||
|
- TARGETS armnnUtilsObj
|
||||||
|
- EXPORT armnn-targets
|
||||||
|
- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||||
|
- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||||
|
- OBJECTS DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||||
|
-)
|
||||||
|
-
|
||||||
|
####################################################
|
||||||
|
## Set export alias
|
||||||
|
set_target_properties(armnn
|
||||||
|
diff --git a/shim/sl/CMakeLists.txt b/shim/sl/CMakeLists.txt
|
||||||
|
index 6912640..e54101c 100644
|
||||||
|
--- a/shim/sl/CMakeLists.txt
|
||||||
|
+++ b/shim/sl/CMakeLists.txt
|
||||||
|
@@ -489,9 +489,9 @@
|
||||||
|
canonical/SystemPropertiesUtils.hpp
|
||||||
|
support_library_service.cpp)
|
||||||
|
|
||||||
|
-list(APPEND armnn_support_library_sources "$<TARGET_OBJECTS:Armnn::armnnUtilsObj>")
|
||||||
|
-list(APPEND armnn_support_library_sources "$<TARGET_OBJECTS:Armnn::armnnSerializerObj>")
|
||||||
|
add_library(armnn_support_library SHARED ${armnn_support_library_sources})
|
||||||
|
+target_link_libraries(armnn_support_library PUBLIC Armnn::armnnUtils)
|
||||||
|
+target_link_libraries(armnn_support_library PUBLIC Armnn::armnnSerializer-static)
|
||||||
|
|
||||||
|
target_link_libraries(armnn_support_library PUBLIC Armnn::Armnn)
|
||||||
|
target_link_libraries(armnn_support_library PUBLIC profiling_library_headers)
|
||||||
|
diff --git a/src/armnnSerializer/CMakeLists.txt b/src/armnnSerializer/CMakeLists.txt
|
||||||
|
index b7e65ad..5e94f33 100755
|
||||||
|
--- a/src/armnnSerializer/CMakeLists.txt
|
||||||
|
+++ b/src/armnnSerializer/CMakeLists.txt
|
||||||
|
@@ -1,5 +1,5 @@
|
||||||
|
#
|
||||||
|
-# Copyright © 2017 Arm Ltd. All rights reserved.
|
||||||
|
+# Copyright © 2017, 2018-2021, 2022 Arm Ltd and Contributors. All rights reserved.
|
||||||
|
# SPDX-License-Identifier: MIT
|
||||||
|
#
|
||||||
|
if(BUILD_ARMNN_SERIALIZER)
|
||||||
|
@@ -39,34 +39,33 @@
|
||||||
|
if(BUILD_BARE_METAL)
|
||||||
|
add_library_ex(armnnSerializer STATIC ${armnn_serializer_sources})
|
||||||
|
else()
|
||||||
|
- # We're going to export both an OBJECT library and a SHARED library here.
|
||||||
|
+ # We're going to export both a STATIC library and a SHARED library here.
|
||||||
|
# In some instances it's easier to include the serializer directly into
|
||||||
|
# the target executable or library rather than have yet another .so.
|
||||||
|
- add_library(armnnSerializerObj OBJECT ${armnn_serializer_sources})
|
||||||
|
+ add_library(armnnSerializer-static STATIC ${armnn_serializer_sources})
|
||||||
|
add_library_ex(armnnSerializer SHARED ${armnn_serializer_sources})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
include_directories(SYSTEM "${FLATBUFFERS_INCLUDE_PATH}")
|
||||||
|
|
||||||
|
set_target_properties(armnnSerializer PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
|
||||||
|
- target_include_directories(armnnSerializerObj PRIVATE ../armnn)
|
||||||
|
- target_include_directories(armnnSerializerObj PRIVATE ../armnnUtils)
|
||||||
|
target_include_directories(armnnSerializer PRIVATE ../armnn)
|
||||||
|
target_include_directories(armnnSerializer PRIVATE ../armnnUtils)
|
||||||
|
target_include_directories(armnnSerializer PRIVATE ../../generated)
|
||||||
|
- target_include_directories(armnnSerializerObj PRIVATE ../../generated)
|
||||||
|
+ target_include_directories(armnnSerializer-static PRIVATE ../armnn)
|
||||||
|
+ target_include_directories(armnnSerializer-static PRIVATE ../armnnUtils)
|
||||||
|
+ target_include_directories(armnnSerializer-static PRIVATE ../../generated)
|
||||||
|
|
||||||
|
list(APPEND armnn_serializer_sources
|
||||||
|
ArmnnSchema_generated.h
|
||||||
|
)
|
||||||
|
|
||||||
|
# System include to suppress warnings for flatbuffers generated files
|
||||||
|
- target_include_directories(armnnSerializerObj SYSTEM PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
|
||||||
|
target_include_directories(armnnSerializer SYSTEM PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
|
||||||
|
|
||||||
|
target_link_libraries(armnnSerializer armnn ${FLATBUFFERS_LIBRARY})
|
||||||
|
|
||||||
|
- install(TARGETS armnnSerializerObj
|
||||||
|
+ install(TARGETS armnnSerializer-static
|
||||||
|
EXPORT armnn-targets
|
||||||
|
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||||
|
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
@ -1,3 +1,15 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Wed Dec 14 15:41:22 UTC 2022 - Guillaume GARDET <guillaume.gardet@opensuse.org>
|
||||||
|
|
||||||
|
- tensorflow-lite >= 2.10 is only avaialble on Tumbleweed
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Wed Dec 14 15:38:39 UTC 2022 - Guillaume GARDET <guillaume.gardet@opensuse.org>
|
||||||
|
|
||||||
|
- Add patch to use static libraries not object libraries for
|
||||||
|
support library:
|
||||||
|
* armnn-281e97b.patch
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Mon Nov 28 07:40:40 UTC 2022 - Guillaume GARDET <guillaume.gardet@opensuse.org>
|
Mon Nov 28 07:40:40 UTC 2022 - Guillaume GARDET <guillaume.gardet@opensuse.org>
|
||||||
|
|
||||||
|
@ -51,7 +51,8 @@
|
|||||||
%bcond_with armnn_extra_tests
|
%bcond_with armnn_extra_tests
|
||||||
%endif
|
%endif
|
||||||
# flatbuffers-devel is available on Leap 15.2+/SLE15SP2+
|
# flatbuffers-devel is available on Leap 15.2+/SLE15SP2+
|
||||||
%if 0%{?suse_version} > 1500 || 0%{?sle_version} >= 150200
|
# But tensorflow-lite >= 2.10 is only avaialble on Tumbleweed
|
||||||
|
%if 0%{?suse_version} > 1500
|
||||||
%bcond_without armnn_flatbuffers
|
%bcond_without armnn_flatbuffers
|
||||||
%else
|
%else
|
||||||
%bcond_with armnn_flatbuffers
|
%bcond_with armnn_flatbuffers
|
||||||
@ -80,6 +81,8 @@ Source0: https://github.com/ARM-software/armnn/archive/v%{version}.tar.gz
|
|||||||
Source1: armnn-rpmlintrc
|
Source1: armnn-rpmlintrc
|
||||||
# PATCH-FIX-UPSTREAM - https://github.com/ARM-software/armnn/issues/711
|
# PATCH-FIX-UPSTREAM - https://github.com/ARM-software/armnn/issues/711
|
||||||
Patch1: armnn-gh711.patch
|
Patch1: armnn-gh711.patch
|
||||||
|
# PATCH-FIX-UPSTREAM - https://github.com/ARM-software/armnn/issues/712
|
||||||
|
Patch2: armnn-281e97b.patch
|
||||||
# PATCHES to add downstream ArmnnExamples binary - https://layers.openembedded.org/layerindex/recipe/87610/
|
# PATCHES to add downstream ArmnnExamples binary - https://layers.openembedded.org/layerindex/recipe/87610/
|
||||||
Patch200: 0003-add-more-test-command-line-arguments.patch
|
Patch200: 0003-add-more-test-command-line-arguments.patch
|
||||||
Patch201: 0005-add-armnn-mobilenet-test-example.patch
|
Patch201: 0005-add-armnn-mobilenet-test-example.patch
|
||||||
@ -374,6 +377,7 @@ This package contains the libarmnnOnnxParser library from armnn.
|
|||||||
%prep
|
%prep
|
||||||
%setup -q -n armnn-%{version}
|
%setup -q -n armnn-%{version}
|
||||||
%patch1 -p1
|
%patch1 -p1
|
||||||
|
%patch2 -p1
|
||||||
%if %{with armnn_extra_tests}
|
%if %{with armnn_extra_tests}
|
||||||
%patch200 -p1
|
%patch200 -p1
|
||||||
%patch201 -p1
|
%patch201 -p1
|
||||||
@ -485,8 +489,6 @@ cp $CP_ARGS ./build/samples/SimpleSample %{buildroot}%{_bindir}
|
|||||||
%endif
|
%endif
|
||||||
# Drop static libs - https://github.com/ARM-software/armnn/issues/514
|
# Drop static libs - https://github.com/ARM-software/armnn/issues/514
|
||||||
rm -f %{buildroot}%{_libdir}/*.a
|
rm -f %{buildroot}%{_libdir}/*.a
|
||||||
# Drop unneeded files - https://github.com/ARM-software/armnn/issues/711
|
|
||||||
rm -rf %{buildroot}%{_libdir}/objects-RelWithDebInfo
|
|
||||||
|
|
||||||
# openCL UnitTests are failing in OBS due to the lack of openCL device
|
# openCL UnitTests are failing in OBS due to the lack of openCL device
|
||||||
%if %{without compute_cl} && %{with armnn_tests}
|
%if %{without compute_cl} && %{with armnn_tests}
|
||||||
|
Loading…
Reference in New Issue
Block a user