diff --git a/cmake/nncaseruntimeConfig.cmake.in b/cmake/nncaseruntimeConfig.cmake.in index cce5810298..664c43d7dd 100644 --- a/cmake/nncaseruntimeConfig.cmake.in +++ b/cmake/nncaseruntimeConfig.cmake.in @@ -1,5 +1,4 @@ include(${CMAKE_CURRENT_LIST_DIR}/nncaseruntimeTargets.cmake) -if(NOT TARGET gsl-lite) - find_package(gsl-lite REQUIRED) -endif() \ No newline at end of file +set(nncaseruntime_INCLUDE_DIRS ${CMAKE_CURRENT_LIST_DIR}/../../../include) +set(nncaseruntime_LIBS ${CMAKE_CURRENT_LIST_DIR}/../../libNncase.Runtime.Native.a) \ No newline at end of file diff --git a/conanfile.py b/conanfile.py index 0753e02c28..5f4b8b6740 100644 --- a/conanfile.py +++ b/conanfile.py @@ -28,7 +28,10 @@ class nncaseConan(ConanFile): "tests": [True, False], "python": [True, False], # "vulkan_runtime": [True, False], - "python_root": ["ANY"] + "python_root": ["ANY"], + "op_profile": [True, False], + "dump_mem": [True, False], + } default_options = { "shared": False, @@ -37,7 +40,9 @@ class nncaseConan(ConanFile): "tests": False, "python": True, # "vulkan_runtime": False, - "python_root": "" + "python_root": "", + "op_profile": False, + "dump_mem": False } @property @@ -45,10 +50,11 @@ def _min_cppstd(self): return 17 def layout(self): - cmake_layout(self) + cmake_layout(self, build_folder="build") def requirements(self): self.requires('gsl-lite/0.37.0') + self.requires('nlohmann_json/3.11.3') if self.options.tests: self.requires('gtest/1.10.0') self.requires('ortki/0.0.4') @@ -60,9 +66,9 @@ def requirements(self): self.requires('nethost/8.0.8') self.requires('fmt/7.1.3') - if not self.options.runtime or self.options.tests: - self.requires('nlohmann_json/3.11.3') - + # if not self.options.runtime or self.options.tests: + # self.requires('nlohmann_json/3.11.3') + # if (not self.options.runtime) or self.options.vulkan_runtime: # self.requires('vulkan-headers/1.2.182') # self.requires('vulkan-loader/1.2.182') @@ -83,12 +89,14 @@ def validate(self): if self.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, self._min_cppstd) + def generate(self): tc = CMakeToolchain(self, generator="Ninja") tc.variables['BUILDING_RUNTIME'] = self.options.runtime - # tc.variables['ENABLE_VULKAN_RUNTIME'] = self.options.vulkan_runtime tc.variables['BUILD_PYTHON_BINDING'] = self.options.python tc.variables['BUILD_TESTING'] = self.options.tests + tc.variables['ENABLE_OP_PROFILE'] = self.options.op_profile + tc.variables['ENABLE_DUMP_MEM'] = self.options.dump_mem if self.options.get_safe("python_root", default="") != "": tc.variables['Python3_ROOT_DIR'] = str(self.options.python_root).replace('\\', '/') if self.options.runtime: diff --git a/toolchains/riscv64-k230-linux.profile.jinja b/toolchains/riscv64-k230-linux.profile.jinja new file mode 100644 index 0000000000..6f1a037521 --- /dev/null +++ b/toolchains/riscv64-k230-linux.profile.jinja @@ -0,0 +1,13 @@ +[conf] +tools.cmake.cmaketoolchain:user_toolchain+={{ os.path.join(profile_dir, "k230.linux.toolchain.cmake") }} +tools.cmake.cmaketoolchain:generator=Ninja + +[settings] +os=Linux +arch=riscv64 +build_type=Release +compiler=gcc +compiler.cppstd=17 +compiler.libcxx=libstdc++11 +compiler.version=12 + diff --git a/toolchains/riscv64-k230-rtos.profile.jinja b/toolchains/riscv64-k230-rtos.profile.jinja new file mode 100644 index 0000000000..87eb25b754 --- /dev/null +++ b/toolchains/riscv64-k230-rtos.profile.jinja @@ -0,0 +1,13 @@ +[conf] +tools.cmake.cmaketoolchain:user_toolchain+={{ os.path.join(profile_dir, "k230.rtos.toolchain.cmake") }} +tools.cmake.cmaketoolchain:generator=Ninja + +[settings] +os=Linux +arch=riscv64 +build_type=Release +compiler=gcc +compiler.cppstd=17 +compiler.libcxx=libstdc++11 +compiler.version=12 +