meson: dependency on ml-api should be optional
authorMyungJoo Ham <myungjoo.ham@samsung.com>
Fri, 18 Mar 2022 08:20:33 +0000 (17:20 +0900)
committerJijoong Moon <jijoong.moon@samsung.com>
Fri, 1 Apr 2022 01:02:36 +0000 (10:02 +0900)
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 <myungjoo.ham@samsung.com>
debian/rules
meson_options.txt
packaging/nntrainer.spec

index 80a9e1f..699232d 100755 (executable)
@@ -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
index 740cb97..461c753 100644 (file)
@@ -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
index 1147551..de456e5 100644 (file)
@@ -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}