fix build error
authorInki Dae <inki.dae@samsung.com>
Thu, 28 May 2020 10:01:23 +0000 (19:01 +0900)
committerInki Dae <inki.dae@samsung.com>
Thu, 4 Mar 2021 05:20:38 +0000 (14:20 +0900)
Change-Id: I2df41ef0d73282e477948eb0f57150b9f2727087
Signed-off-by: Inki Dae <inki.dae@samsung.com>
CMakeLists.txt
packaging/armnn.spec
src/backends/backendsCommon/CMakeLists.txt
src/backends/backendsCommon/test/CMakeLists.txt
tests/CMakeLists.txt

index 4e75c28..63e6812 100644 (file)
@@ -584,6 +584,8 @@ if(PROFILING_BACKEND_STREAMLINE)
         ${GATOR_ROOT}/annotate/streamline_annotate.c)
 endif()
 
+set_source_files_properties(${armnn_sources} PROPERTIES COMPILE_FLAGS "-Wno-unused-variable -Wno-unused-parameter -Wno-conversion -Wno-sign-conversion -Wno-error=deprecated-copy")
+
 # the backends under src/backends extend the list of
 # object libs armnn to include in the build
 include(src/backends/backends.cmake)
index 57659f5..6af0008 100644 (file)
@@ -8,85 +8,55 @@ Source0:        %{name}-%{version}.tar.gz
 Source1001:     %{name}.manifest
 ExclusiveArch:  %arm aarch64
 
-%define OPEN_CL_SUPPORT 1
-%define CAFFE_SUPPORT 1
 %define TF_LITE_SUPPORT 1
-
-%if 0%{?OPEN_CL_SUPPORT} != 1
-  %define CAFFE_SUPPORT 0
-%endif
+%define TF_SUPPORT 0
+%define CAFFE_SUPPORT 0
+%define OPEN_CL_SUPPORT 1
 
 BuildRequires: curl
 BuildRequires: cmake
 BuildRequires: libarmcl-devel
+%if 0%{?TF_SUPPORT} == 1
 BuildRequires: protobuf-devel
+%endif
+%if 0%{?TF_LITE_SUPPORT} == 1
 BuildRequires: flatbuffers
+%endif
 BuildRequires: icu
 BuildRequires: libicu-devel
-BuildRequires: libicu-tzdata
 BuildRequires: boost-atomic
 BuildRequires: boost-chrono
-BuildRequires: boost-container
-BuildRequires: boost-context
-BuildRequires: boost-coroutine
 BuildRequires: boost-date-time
-BuildRequires: boost-fiber
 BuildRequires: boost-filesystem
-BuildRequires: boost-graph
-BuildRequires: boost-iostreams
-BuildRequires: boost-jam
-BuildRequires: boost-locale
 BuildRequires: boost-log
-BuildRequires: boost-math
-BuildRequires: boost-program-options
-BuildRequires: boost-random
 BuildRequires: boost-regex
-BuildRequires: boost-serialization
-BuildRequires: boost-signals
-BuildRequires: boost-system
-BuildRequires: boost-test
 BuildRequires: boost-devel
 %if 0%{?TF_LITE_SUPPORT} == 1
 BuildRequires: tensorflow-lite-devel
-%endif
-%if 0%{?CAFFE_SUPPORT} == 1
-BuildRequires: libcaffeonacl-devel
+BuildRequires: tensorflow-lite-flatbuf-schema
 %endif
 
 %description
 Arm Neural Networks Library
 
 %package devel
-Summary:  Userspace interface to ARM Neural Network Library
-Provides: pkgconfig(rpm)
+Summary: Userspace interface to ARM Neural Network Library
 Requires: %{name} = %{version}-%{release}
 
 %description devel
-Summary:        Userspace interface to ARM Neural Network Library
+Summary: Userspace interface to ARM Neural Network Library
 
 %package tools
-Summary:       Sample application and benchmark binaries to test ARM Neural Network Library
-Requires:      %{name} = %{version}-%{release}
+Summary: Sample application and benchmark binaries to test ARM Neural Network Library
+Requires: %{name} = %{version}-%{release}
 
 %description tools
-Summary:       Sample application and benchmark binaries to test ARM Neural Network Library
+Summary: Sample application and benchmark binaries to test ARM Neural Network Library
 
 %prep
 %setup -q
 cp %{SOURCE1001} .
 
-%if 0%{?CAFFE_SUPPORT} == 1
-sed -i 's/CAFFE_SUPPORT /-larmnnCaffeParser /g' armnn.pc
-%else # CAFFE_SUPPORT
-sed -i 's/CAFFE_SUPPORT //g' armnn.pc
-%endif # CAFFE_SUPPORT
-
-%if 0%{?TF_LITE_SUPPORT} == 1
-sed -i 's/TF_LITE_SUPPORT /-larmnnTfLiteParser /g' armnn.pc
-%else # TF_LITE_SUPPORT
-sed -i 's/TF_LITE_SUPPORT //g' armnn.pc
-%endif # TF_LITE_SUPPORT
-
 %build
 
 #compile proto files
@@ -99,43 +69,52 @@ sed -i 's/TF_LITE_SUPPORT //g' armnn.pc
 #cd -
 
 #build ArmNN
-cmake -DARMCOMPUTENEON=1                                       \
+cmake -DARMCOMPUTENEON=1                                                                                       \
 %if 0%{?OPEN_CL_SUPPORT} == 1
-      -DARMCOMPUTECL=1                                         \
-%endif # TF_LITE_SUPPORT
-      -DSHARED_BOOST=1                                         \
-      -DCMAKE_SKIP_RPATH=1                                     \
+      -DARMCOMPUTECL=1                                                                                         \
+         -DOPENCL_INCLUDE=/usr/include/arm_compute/core                                \
+%endif # OPEN_CL_SUPPORT
+      -DSHARED_BOOST=1                                                                                         \
+      -DCMAKE_SKIP_RPATH=1                                                                                     \
 %if 0%{?CAFFE_SUPPORT} == 1
-      -DBUILD_CAFFE_PARSER=1                                   \
-      -DCAFFE_GENERATED_SOURCES=/usr/include                   \
+      -DBUILD_CAFFE_PARSER=1                                                                           \
+      -DCAFFE_GENERATED_SOURCES=/usr/include                                           \
 %endif # CAFFE_SUPPORT
 %if 0%{?TF_LITE_SUPPORT} == 1
-      -DBUILD_TF_LITE_PARSER=1                                 \
-      -DTF_LITE_GENERATED_PATH=./tensorflow/contrib/lite/schema        \
+      -DBUILD_TF_LITE_PARSER=1                                                                         \
+      -DTF_LITE_GENERATED_PATH=/usr/include/tensorflow/lite/schema     \
+      -DTF_LITE_SCHEMA_PATH=/usr/share/tensorflow/lite/schema          \
+      -DFLATBUFFERS_INCLUDE_PATH=/usr/include/                                         \
+      -DFLATC=/usr/bin/flatc                                                                           \
 %endif # TF_LITE_SUPPORT
-      -DFLATBUFFERS_INCLUDE_PATH=/usr/include/                 \
-      -DFLATC=/usr/bin/flatc      \
-      -DBUILD_TESTS=1                                          \
+      -DBUILD_TESTS=1                                                                                          \
+         -DARMCOMPUTE_CORE_LIBRARY_DEBUG=/usr/lib/libarm_compute_core.so       \
+         -DARMCOMPUTE_CORE_LIBRARY_RELEASE=/usr/lib/libarm_compute_core.so     \
+         -DARMCOMPUTE_LIBRARY_DEBUG=/usr/lib/libarm_compute.so                         \
+         -DARMCOMPUTE_LIBRARY_RELEASE=/usr/lib/libarm_compute.so
 
-make -j8
+CPU_JOB_NUM=`grep processor /proc/cpuinfo | awk '{field=$NF};END{print field+1}'`
+make -j ${CPU_JOB_NUM}
 
 %install
 mkdir -p %{buildroot}%{_libdir}
 mkdir -p %{buildroot}%{_libdir}/pkgconfig
 mkdir -p %{buildroot}%{_bindir}/armnn
 mkdir -p %{buildroot}%{_includedir}/armnn
+mkdir -p %{buildroot}%{_includedir}/armnn/backends
+mkdir -p %{buildroot}%{_includedir}/armnn/backends/profiling
+mkdir -p %{buildroot}%{_includedir}/armnn/profiling
+mkdir -p %{buildroot}%{_includedir}/armnn/utility
 %if 0%{?CAFFE_SUPPORT} == 1
   mkdir -p %{buildroot}%{_includedir}/armnnCaffeParser
 %endif # CAFFE_SUPPORT
+%if 0%{?TF_SUPPORT} == 1
 mkdir -p %{buildroot}%{_includedir}/armnnTfParser
+%endif # TF_SUPPORT
 %if 0%{?TF_LITE_SUPPORT} == 1
   mkdir -p %{buildroot}%{_includedir}/armnnTfLiteParser
 %endif # TF_LITE_SUPPORT
 
-#prepare stb
-mkdir -p %{buildroot}%{_includedir}
-cp -ar external/stb %{buildroot}%{_includedir}
-
 install armnn.pc %{buildroot}%{_libdir}/pkgconfig/
 
 install -m 0755 bin/*-Armnn %{buildroot}%{_bindir}/armnn/
@@ -146,11 +125,17 @@ install -m 0755 bin/ExecuteNetwork %{buildroot}%{_bindir}/armnn/
 install -m 0755 UnitTests %{buildroot}%{_bindir}/armnn/
 
 install -m 0644 lib*.so %{buildroot}%{_libdir}/
-install -m 0644 include/armnn/* %{buildroot}%{_includedir}/armnn/
+install -m 0644 include/armnn/*.hpp %{buildroot}%{_includedir}/armnn/
+install -m 0644 include/armnn/backends/*.hpp %{buildroot}%{_includedir}/armnn/backends/
+install -m 0644 include/armnn/backends/profiling/*.hpp %{buildroot}%{_includedir}/armnn/backends/profiling/
+install -m 0644 include/armnn/profiling/*.hpp %{buildroot}%{_includedir}/armnn/profiling/
+install -m 0644 include/armnn/utility/*.hpp %{buildroot}%{_includedir}/armnn/utility/
 %if 0%{?CAFFE_SUPPORT} == 1
   install -m 0644 include/armnnCaffeParser/* %{buildroot}%{_includedir}/armnnCaffeParser/
 %endif # CAFFE_SUPPORT
+%if 0%{?TF_SUPPORT} == 1
 install -m 0644 include/armnnTfParser/* %{buildroot}%{_includedir}/armnnTfParser/
+%endif # TF_SUPPORT
 %if 0%{?TF_LITE_SUPPORT} == 1
   install -m 0644 include/armnnTfLiteParser/* %{buildroot}%{_includedir}/armnnTfLiteParser/
 %endif # TF_LITE_SUPPORT
@@ -165,7 +150,10 @@ install -m 0644 include/armnnTfParser/* %{buildroot}%{_includedir}/armnnTfParser
 %files devel
 %manifest %{name}.manifest
 %{_libdir}/pkgconfig/armnn.pc
-%{_includedir}/*
+%{_includedir}/armnn/*
+%if 0%{?TF_LITE_SUPPORT} == 1
+%{_includedir}/armnnTfLiteParser/*
+%endif # TF_LITE_SUPPORT
 
 %files tools
 %manifest %{name}.manifest
index cf6da80..16930a5 100644 (file)
@@ -58,4 +58,6 @@ target_include_directories(armnnBackendsCommon PRIVATE ${PROJECT_SOURCE_DIR}/src
 target_include_directories(armnnBackendsCommon PRIVATE ${PROJECT_SOURCE_DIR}/src/armnnUtils)
 target_include_directories(armnnBackendsCommon PRIVATE ${PROJECT_SOURCE_DIR}/src/backends)
 target_include_directories(armnnBackendsCommon PRIVATE ${PROJECT_SOURCE_DIR}/src/profiling)
-target_include_directories(armnnBackendsCommon PRIVATE ${PROJECT_SOURCE_DIR}/profiling/common/include)
\ No newline at end of file
+target_include_directories(armnnBackendsCommon PRIVATE ${PROJECT_SOURCE_DIR}/profiling/common/include)
+
+set_source_files_properties(${armnnBackendsCommon_sources} PROPERTIES COMPILE_FLAGS "-Wno-unused-variable -Wno-unused-parameter -Wno-conversion -Wno-sign-conversion -Wno-error=deprecated-copy")
index f92e074..6fa9dd7 100644 (file)
@@ -182,6 +182,8 @@ if(ARMCOMPUTENEON AND ARMCOMPUTECL)
         CompatibilityTests.cpp)
 endif()
 
+set_source_files_properties(${armnnBackendsCommonUnitTests_sources} PROPERTIES COMPILE_FLAGS "-Wno-unused-variable -Wno-unused-parameter -Wno-conversion -Wno-sign-conversion -Wno-error=deprecated-copy")
+
 add_library(armnnBackendsCommonUnitTests OBJECT ${armnnBackendsCommonUnitTests_sources})
 target_include_directories(armnnBackendsCommonUnitTests PRIVATE ${PROJECT_SOURCE_DIR}/src/armnn)
 target_include_directories(armnnBackendsCommonUnitTests PRIVATE ${PROJECT_SOURCE_DIR}/src/armnnUtils)
index 21907da..304c631 100644 (file)
@@ -18,6 +18,8 @@ target_include_directories(inferenceTest PRIVATE ../src/armnnUtils)
 target_include_directories(inferenceTest PRIVATE ../src/backends)
 target_include_directories(inferenceTest PRIVATE ../third-party/stb)
 
+set_source_files_properties(${inference_test_sources} PROPERTIES COMPILE_FLAGS "-Wno-unused-variable -Wno-unused-parameter -Wno-conversion -Wno-sign-conversion -Wno-error=deprecated-copy")
+
 if(BUILD_CAFFE_PARSER)
     macro(CaffeParserTest testName sources)
         add_executable_ex(${testName} ${sources})