It works fine If i do not use any full tf lite and easier models (such as for my project 58571). However, If I switch to a slightly more complicated network (such as project 74857) then the code still compiles but the application aborts (this does not happen with makefile). Further, the tflite support does not seem to work (as I can set it with an EON compiled model without an issue).
Just to confirm, you’re saying that it will build, but when you run it, the application crashes/aborts?
First off, to make your life easier, did you notice that our library export comes with a CMakeLists.txt file? You can include the EI SDK by just using the add_subdirectory() function.
Second, it will be easier to help you debug if you include libraries the same way we do in the makefile. Instead of using find_library, can you include the libraries the same way we do in our makefile, by using linker flags like “-ltensorflow-lite”
I suspect this is the difference in why building with make works, but building with CMake causes you to crash.
I believe these are the linker flags you will need to load the right libraries (in addition to the ones you already have in your CMake file):
I actually don’t have a CMakeLists.txt for Linux, otherwise I would happily share :-). I’m pulling from a cmake build for another embedded target altogether, and really the only common line between that project and yours is the easiest way to include the EI SDK.
Note, you can’t use the CMakeLists.txt file that comes with the export directly. It’s meant to be included via add_subdirectory(). So for example, if you copy the exported files from Studio in the directory “source”, then "add_subdirectory(source) " is what you want inside your CMake file.
Note our CMakeLists.txt file expects the target “app” to exist, so you need to place add_subdirectory AFTER your line “add_executeable(app…)”
If you want to give this a shot and push your changes to your repo, I’m happy to have a look if you’re still having issues when you’re done!