From 98a437b424f4f8bffd118d147edd256e74332f46 Mon Sep 17 00:00:00 2001 From: MyungJoo Ham Date: Fri, 18 Mar 2022 17:20:33 +0900 Subject: [PATCH] meson: dependency on ml-api should be optional Users should be able to build nntrainer in a system without ML-API and nnstreamer by default. ML-API and nnstreamer dependency should only be mandated in related systems (a few embedded systems). Let's keep it "auto" so that most external users can forget about nnstreamer and ML-API. Addresses #1853 Signed-off-by: MyungJoo Ham --- debian/rules | 4 +++- meson_options.txt | 9 +++++++-- packaging/nntrainer.spec | 4 +++- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/debian/rules b/debian/rules index 80a9e1f..699232d 100755 --- a/debian/rules +++ b/debian/rules @@ -36,7 +36,9 @@ override_dh_auto_configure: --libdir=lib/$(DEB_HOST_MULTIARCH) --bindir=lib/nntrainer/bin \ --includedir=include -Dinstall-app=true \ -Dreduce-tolerance=$(ENABLE_REDUCE_TOLERANCE) \ - -Denable-debug=$(ENABLE_DEBUG) build + -Denable-debug=$(ENABLE_DEBUG) \ + -Dml-api-support=enabled -Denable-nnstreamer-tensor-filter=true \ + build override_dh_auto_build: ninja -C build diff --git a/meson_options.txt b/meson_options.txt index 740cb97..461c753 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -7,8 +7,6 @@ option('enable-ccapi', type: 'boolean', value: true) option('enable-test', type: 'boolean', value: true) option('enable-logging', type: 'boolean', value: true) option('enable-tizen-feature-check', type: 'boolean', value: true) -option('enable-nnstreamer-tensor-filter', type: 'boolean', value: true) -option('nnstreamer-subplugin-install-path', type: 'string', value: '/usr/lib/nnstreamer') # where nnstreamer subplugin should be installed option('enable-nnstreamer-backbone', type: 'boolean', value: true) option('enable-tflite-backbone', type: 'boolean', value: true) option('enable-profile', type: 'boolean', value: false) @@ -32,3 +30,10 @@ option('enable-blas', type: 'boolean', value: true) option('enable-cublas', type: 'boolean', value: false) option('enable-openmp', type: 'boolean', value: true) +# ml-api dependency (to enable, install capi-inference from github.com/nnstreamer/api ) +# To inter-operate with nnstreamer and ML-API packages, you need to enable this. +# If this is disabled, related options (capi-ml-*) are ignored. +option('ml-api-support', type: 'feature', value: 'auto') +# @todo : make them use 'feature' and depend on ml-api-support +option('enable-nnstreamer-tensor-filter', type: 'boolean', value: false) +option('nnstreamer-subplugin-install-path', type: 'string', value: '/usr/lib/nnstreamer') # where nnstreamer subplugin should be installed \ No newline at end of file diff --git a/packaging/nntrainer.spec b/packaging/nntrainer.spec index 1147551..de456e5 100644 --- a/packaging/nntrainer.spec +++ b/packaging/nntrainer.spec @@ -365,7 +365,9 @@ meson --buildtype=plain --prefix=%{_prefix} --sysconfdir=%{_sysconfdir} \ %{enable_gym} %{enable_nnstreamer_tensor_filter} %{enable_profile} \ %{enable_nnstreamer_backbone} %{enable_tflite_backbone} \ %{enable_tflite_interpreter} %{capi_ml_pkg_dep_resolution} \ - %{enable_reduce_tolerance} %{configure_subplugin_install_path} %{enable_debug} build + %{enable_reduce_tolerance} %{configure_subplugin_install_path} %{enable_debug} \ + -Dml-api-support=enabled -Denable-nnstreamer-tensor-filter=true \ + build ninja -C build %{?_smp_mflags} -- 2.7.4