Skip to content

Commit

Permalink
[infra] Support RISC-V gbs build (#12405)
Browse files Browse the repository at this point in the history
This commit updates gbs.conf and spec file to support RISC-V gbs build.

ONE-DCO-1.0-Signed-off-by: Hyeongseok Oh <[email protected]>
  • Loading branch information
hseok-oh authored Jan 5, 2024
1 parent fbe65e6 commit 7ad4079
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 8 deletions.
18 changes: 18 additions & 0 deletions infra/nnfw/config/gbs.conf
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ 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/

Expand All @@ -19,3 +25,15 @@ url = http://download.tizen.org/snapshots/TIZEN/Tizen-8.0/Tizen-8.0-Unified/late

[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 = http://download.tizen.org/snapshots/TIZEN/Tizen/Tizen-Unified-RISCV/latest/repos/standard/packages/

[repo.base-riscv]
url = http://download.tizen.org/snapshots/TIZEN/Tizen/Tizen-Base-RISCV/latest/repos/standard/packages/
25 changes: 17 additions & 8 deletions packaging/nnfw.spec
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ Source3020: NEON2SSE.tar.gz
%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
Expand Down Expand Up @@ -137,6 +143,9 @@ NPU daemon for optimal management of NPU hardware
%ifarch %ix86
%define target_arch i686
%endif
%ifarch riscv64
%define target_arch riscv64
%endif

%define install_dir %{_prefix}
%define install_path %{buildroot}%{install_dir}
Expand Down Expand Up @@ -206,7 +215,7 @@ tar -xf %{SOURCE3019} -C ./externals
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 \
Expand Down Expand Up @@ -238,7 +247,7 @@ tar -zcf test-suite.tar.gz infra/scripts
%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}
Expand Down Expand Up @@ -312,15 +321,15 @@ install -m 755 build/out/npud-gtest/* %{test_install_path}/npud-gtest
%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
Expand All @@ -329,13 +338,13 @@ install -m 755 build/out/npud-gtest/* %{test_install_path}/npud-gtest
%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,-)
Expand All @@ -356,7 +365,7 @@ install -m 755 build/out/npud-gtest/* %{test_install_path}/npud-gtest
%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
Expand All @@ -365,7 +374,7 @@ install -m 755 build/out/npud-gtest/* %{test_install_path}/npud-gtest
%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
Expand Down

0 comments on commit 7ad4079

Please sign in to comment.