It adds an inipaser option and it's default disabled.
Also, it removes fuse dependency when cuse is disabled.
Signed-off-by: Jiho Chu <jiho.chu@samsung.com>
libdl_dep = cc.find_library('dl') # DL library
libm_dep = cc.find_library('m') # math library
thread_dep = dependency('threads') # pthread library
-iniparser_dep = dependency('iniparser', required: false) # iniparser library
-if not iniparser_dep.found()
- libiniparser = cpp.find_library('iniparser')
- if libiniparser.found() and cpp.has_header('iniparser.h',\
- args : sysroot_inc_cflags_iniparser)
- iniparser_dep = declare_dependency(
- compile_args : sysroot_inc_cflags_iniparser,
- dependencies: libiniparser,
- )
- else
- error('Failed to resovle dependency on libiniparser')
+
+if get_option('enable_ini_parser')
+ iniparser_dep = dependency('iniparser', required: false) # iniparser library
+ if not iniparser_dep.found()
+ libiniparser = cpp.find_library('iniparser')
+ if libiniparser.found() and cpp.has_header('iniparser.h',\
+ args : sysroot_inc_cflags_iniparser)
+ iniparser_dep = declare_dependency(
+ compile_args : sysroot_inc_cflags_iniparser,
+ dependencies: libiniparser,
+ )
+ else
+ error('Failed to resovle dependency on libiniparser')
+ endif
endif
endif
+
libdrm_dep = dependency('libdrm')
npubinfmt_dep = dependency('npubin-fmt', required: true)
option('target_platform', type : 'combo', choices : ['debian', 'tizen', 'fpga'], value : 'debian')
option('enable_npu_emul', type : 'boolean', value : false)
option('enable_npu_cuse', type : 'boolean', value : false)
+option('enable_ini_parser', type : 'boolean', value : false)
option('enable_data_manip', type : 'boolean', value : false)
option('enable_buffering', type : 'boolean', value : false)
option('enable_plugin_npumgr', type : 'boolean', value : false)
## TODO: add the uapi header (trinity.h) to a kernel header package
# BuildRequires: linux-kernel-headers
+%if 0%{?npu_iniparser}
# NE-CONF uses iniparser
BuildRequires: pkgconfig(iniparser)
+%define enable_ini_parser -Denable_ini_parser=true
+%else
+%define enable_ini_parser -Denable_ini_parser=false
+%endif
# utils
BuildRequires: ncurses-devel
-BuildRequires: fuse-devel
# test
BuildRequires: gtest-devel
%if 0%{?npu_cuse}
BuildRequires: libmrpsim-devel >= 3.9.1
+BuildRequires: fuse-devel
%define enable_npu_cuse -Denable_npu_cuse=true
%else
%define enable_npu_cuse -Denable_npu_cuse=false
--datadir=%{_datadir} --sysconfdir=%{_sysconfdir} \
-Dtarget_platform=tizen -Denable_data_manip=true \
%{enable_npu_emul} %{enable_npu_cuse} %{enable_plugin_npumgr} %{enable_plugin_nns} %{skip_idu_check} \
+ %{enable_ini_parser} \
build
ninja -C build %{?_smp_mflags}
#include <atomic>
#include <memory>
#include <chrono>
+#include <unistd.h>
#include <triv2profile.h>
#include <npubinfmt.h>
'ne-conf.cc'
]
-ne_core_utils_deps = [iniparser_dep]
+ne_core_utils_deps = []
+
+if get_option('enable_ini_parser')
+ ne_core_utils_deps += [iniparser_dep]
+endif
if target_platform == 'tizen'
dlog_dep = dependency('dlog')
- ne_core_utils_deps += dlog_dep
+ ne_core_utils_deps += [dlog_dep]
endif
ne_core_utils_dep = declare_dependency (
/**
* @breif error callback of iniparser, used to ignore its error message
*/
+#ifdef ENABLE_INIPARSER
static int
error_callback (const char *, ...) {
return 0;
}
+#endif
/**
* @brief Constructor of Conf class, loading default configurations.
snprintf (default_ini_path, PATH_MAX, "%s/%s", NE_INIDIR, INI_FILE_NAME);
+#ifdef ENABLE_INIPARSER
/** Ignore error messages */
iniparser_set_error_callback (error_callback);
loadConfIni (ini);
iniparser_freedict (ini);
}
+#endif
/** Load up config from envvar if available */
loadConfEnvvar ();
* @param[in] ini The parsed .ini file.
* @note if a config param is nullptr, it is not set. so use default one.
*/
+#ifdef ENABLE_INIPARSER
void
Conf::loadConfIni (dictionary *ini) {
const char *resv_mem_size = iniparser_getstring (ini, "main:resv_mem_size", nullptr);
setPrefixProfile (prefix_profile);
setMuteStdout (mute_stdout == 1);
}
+#endif
/**
* @brief Load configuration with env-vars
#define __NE_CONF_H__
#include <stdint.h>
+
+#ifdef ENABLE_INIPARSER
#include <iniparser.h>
+#endif
#include <memory>
#include <mutex>
Conf ();
void loadConf (const char *inipath);
+#ifdef ENABLE_INIPARSER
void loadConfIni (dictionary *ini);
+#endif
void loadConfDefault ();
void loadConfEnvvar ();
executable ('model_share',
'model_share.cc',
include_directories : [ne_core_utils_inc, ne_host_inc],
- dependencies : [npubinfmt_dep, ne_test_utils_common_dep, thread_dep],
+ dependencies : [npubinfmt_dep, ne_test_utils_common_dep, thread_dep, ne_core_utils_dep],
link_with : ne_library_shared,
install : true,
install_rpath : ne_libdir,
'idu-load.cc',
]
-utils_trinity_cuse = executable('idu-load',
+utils_trinity_idu_load = executable('idu-load',
[utils_idu_srcs],
include_directories: [ne_uapi_inc],
install : true,
subdir('trinity_cuse')
subdir('trinity_test')
subdir('trinity_trace')
-subdir('idu_load')
subdir('examples')