#include "pp/Format.h"
+#include <cstdint>
+
namespace pp
{
set(HOST_ARCH_BASE "aarch64")
elseif("${HOST_ARCH}" STREQUAL "i686")
set(HOST_ARCH_BASE "i686")
+elseif("${HOST_ARCH}" STREQUAL "riscv64")
+ set(HOST_ARCH_BASE "riscv64")
else()
message(FATAL_ERROR "'${HOST_ARCH}' architecture is not supported")
endif()
set(TARGET_ARCH_BASE "aarch64")
elseif("${TARGET_ARCH}" STREQUAL "i686")
set(TARGET_ARCH_BASE "i686")
+elseif("${TARGET_ARCH}" STREQUAL "riscv64")
+ set(TARGET_ARCH_BASE "riscv64")
else()
message(FATAL_ERROR "'${TARGET_ARCH}' architecture is not supported")
endif()
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 8.0)
set(ADDITIONAL_CXX_FLAGS "-Wno-error=class-memaccess")
endif()
+ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 12.0)
+ set(ADDITIONAL_CXX_FLAGS "-Wno-error=stringop-overflow")
+ endif()
nnas_include(ExternalBuildTools)
ExternalBuild_CMake(CMAKE_DIR ${FlatBuffersSource_DIR}
--- /dev/null
+#
+# riscv64 tizen cmake options
+#
--- /dev/null
+#
+# riscv64 tizen compile options
+#
+
+message(STATUS "Building for RISC-V64 Tizen")
+
+# Build flag for tizen
+set(CMAKE_C_FLAGS_DEBUG "-O -g -DDEBUG")
+set(CMAKE_CXX_FLAGS_DEBUG "-O -g -DDEBUG")
+
+# TODO : add and use option_tizen if something uncommon comes up
+# include linux common
+include("cmake/buildtool/config/config_linux.cmake")
+
+# addition for riscv64-tizen
+set(FLAGS_COMMON ${FLAGS_COMMON}
+ )
--- /dev/null
+#
+# riscv64 tizen cmake options
+#
+option(BUILD_ARMCOMPUTE "Build ARM Compute from the downloaded source" OFF)
+option(BUILD_TENSORFLOW_LITE "Build TensorFlow Lite from the downloaded source" OFF)
+option(DOWNLOAD_ARMCOMPUTE "Download ARM Compute source" OFF)
+option(DOWNLOAD_GTEST "Download Google Test source and build Google Test" OFF)
+
+option(BUILD_LOGGING "Build logging runtime" OFF)
+option(GENERATE_RUNTIME_NNAPI_TESTS "Generate NNAPI operation gtest" OFF)
+option(ENVVAR_ONERT_CONFIG "Use environment variable for onert configuration" OFF)
+
+option(BUILD_XNNPACK "Build XNNPACK" OFF)
+option(DOWNLOAD_OPENCL_HEADERS "Download opencl headers" OFF)
+
+option(BUILD_NPUD "Build NPU daemon" OFF)
+# Do not allow to use CONFIG option on Tizen
+option(ENVVAR_NPUD_CONFIG "Use environment variable for npud configuration" OFF)
+
+option(BUILD_MINMAX_H5DUMPER "Build minmax h5dumper" OFF)
[profile.tizen]
repos = repo.base, repo.unified
+[profile.tizen_8]
+repos = repo.base_8, repo.unified_8
+
+[profile.tizen-dev]
+repos = repo.base-dev, repo.unified-dev
+
+[profile.tizen-riscv]
+repos = repo.base-riscv, repo.unified-riscv
+
[repo.unified]
url = http://download.tizen.org/snapshots/TIZEN/Tizen-7.0/Tizen-7.0-Unified/latest/repos/standard/packages/
[repo.base]
url = http://download.tizen.org/snapshots/TIZEN/Tizen-7.0/Tizen-7.0-Base/latest/repos/standard/packages/
+
+[repo.unified_8]
+url = http://download.tizen.org/snapshots/TIZEN/Tizen-8.0/Tizen-8.0-Unified/latest/repos/standard/packages/
+
+[repo.base_8]
+url = http://download.tizen.org/snapshots/TIZEN/Tizen-8.0/Tizen-8.0-Base/latest/repos/standard/packages/
+
+[repo.unified-dev]
+url = http://download.tizen.org/snapshots/TIZEN/Tizen/Tizen-Unified-Dev/latest/repos/standard/packages/
+
+[repo.base-dev]
+url = http://download.tizen.org/snapshots/TIZEN/Tizen/Tizen-Base-Dev/latest/repos/standard/packages/
+
+[repo.unified-riscv]
+url = https://download.tizen.org/snapshots/TIZEN/Tizen/Tizen-Unified-RISCV/latest/repos/standard/packages/
+
+[repo.base-riscv]
+url = https://download.tizen.org/snapshots/TIZEN/Tizen/Tizen-Base-RISCV/latest/repos/standard/packages/
%define test_build 1
%endif
+%ifarch riscv64
+# Disable npud on risc-v
+# TODO Enable on risc-v
+%define npud_build 0
+%endif
+
BuildRequires: cmake
Requires(post): /sbin/ldconfig
%ifarch %ix86
%define target_arch i686
%endif
+%ifarch riscv64
+%define target_arch riscv64
+%endif
%define install_dir %{_prefix}
%define install_path %{buildroot}%{install_dir}
tar -xf %{SOURCE3020} -C ./externals
%build
-%ifarch arm armv7l armv7hl aarch64 x86_64 %ix86
+%ifarch arm armv7l armv7hl aarch64 x86_64 %ix86 riscv64
# nncc build
%if %{odc_build} == 1
%{nncc_env} ./nncc configure -DBUILD_GTEST=OFF -DENABLE_TEST=OFF -DEXTERNALS_BUILD_THREADS=%{nproc} -DCMAKE_BUILD_TYPE=%{build_type} -DTARGET_ARCH=%{target_arch} -DTARGET_OS=tizen \
%endif # arm armv7l armv7hl aarch64
%install
-%ifarch arm armv7l armv7hl aarch64 x86_64 %ix86
+%ifarch arm armv7l armv7hl aarch64 x86_64 %ix86 riscv64
mkdir -p %{buildroot}%{_libdir}
mkdir -p %{buildroot}%{_bindir}
%files
%manifest %{name}.manifest
%defattr(-,root,root,-)
-%ifarch arm armv7l armv7hl aarch64 x86_64 %ix86
+%ifarch arm armv7l armv7hl aarch64 x86_64 %ix86 riscv64
%{_libdir}/*.so
%exclude %{_includedir}/CL/*
%endif
%files devel
%manifest %{name}.manifest
%defattr(-,root,root,-)
-%ifarch arm armv7l armv7hl aarch64 x86_64 %ix86
+%ifarch arm armv7l armv7hl aarch64 x86_64 %ix86 riscv64
%dir %{_includedir}/nnfw
%{_includedir}/nnfw/*
%{_libdir}/pkgconfig/nnfw.pc
%files plugin-devel
%manifest %{name}.manifest
%defattr(-,root,root,-)
-%ifarch arm armv7l armv7hl aarch64 x86_64 %ix86
+%ifarch arm armv7l armv7hl aarch64 x86_64 %ix86 riscv64
%dir %{_includedir}/onert
%{_includedir}/onert/*
%{_libdir}/pkgconfig/nnfw-plugin.pc
%endif
-%ifarch arm armv7l armv7hl aarch64 x86_64 %ix86
+%ifarch arm armv7l armv7hl aarch64 x86_64 %ix86 riscv64
%files minimal-app
%manifest %{name}.manifest
%defattr(-,root,root,-)
%files npud
%manifest %{name}.manifest
%defattr(-,root,root,-)
-%ifarch arm armv7l armv7hl aarch64 x86_64 %ix86
+%ifarch arm armv7l armv7hl aarch64 x86_64 %ix86 riscv64
%{_bindir}/npud
%endif # arm armv7l armv7hl aarch64 x86_64 %ix86
%endif # npud_build
%files odc
%manifest %{name}.manifest
%defattr(-,root,root,-)
-%ifarch arm armv7l armv7hl aarch64 x86_64 %ix86
+%ifarch arm armv7l armv7hl aarch64 x86_64 %ix86 riscv64
%dir %{_libdir}/nnfw/odc
%{_libdir}/nnfw/odc/*
%endif # arm armv7l armv7hl aarch64 x86_64 %ix86