Forums - Build snpe with CMake

6 posts / 0 new
Last post
Build snpe with CMake
22imonreal
Join Date: 10 Feb 21
Posts: 80
Posted: Tue, 2021-08-10 05:21

Hello,

I am trying to use the snpe SampleCode application from https://developer.qualcomm.com/docs/snpe/cplus_plus_tutorial.html in one of my projects and I need to build it using CMake.

Can you provide a sample CMakeLists.txt to build the SampleCode instead of just with makefiles?

Thanks in advance.

  • Up0
  • Down0
22imonreal
Join Date: 10 Feb 21
Posts: 80
Posted: Tue, 2021-08-10 06:27

I have tried with the following CMakeLists.txt:

cmake_minimum_required(VERSION 3.10)

set(CMAKE_C_COMPILER "g++")
set(CMAKE_CXX_COMPILER "/usr/bin/g++")

set(CMAKE_CXX_STANDARD 11)

# set the project name
project(cmake_samplecode CXX)


# add the executable
add_executable(cmake_samplecode jni/main.cpp ${SRC_FILES})
target_include_directories(cmake_samplecode PUBLIC /snpe-1.50.0.2622/include/zdl)

But I am getting the following error:

make    
[  7%] Building CXX object CMakeFiles/cmake_samplecode.dir/jni/main.cpp.o
[ 14%] Building CXX object CMakeFiles/cmake_samplecode.dir/jni/CheckRuntime.cpp.o
[ 21%] Building CXX object CMakeFiles/cmake_samplecode.dir/jni/CreateGLBuffer.cpp.o
[ 28%] Building CXX object CMakeFiles/cmake_samplecode.dir/jni/CreateGLContext.cpp.o
[ 35%] Building CXX object CMakeFiles/cmake_samplecode.dir/jni/CreateUserBuffer.cpp.o
[ 42%] Building CXX object CMakeFiles/cmake_samplecode.dir/jni/LoadContainer.cpp.o
[ 50%] Building CXX object CMakeFiles/cmake_samplecode.dir/jni/LoadInputTensor.cpp.o
[ 57%] Building CXX object CMakeFiles/cmake_samplecode.dir/jni/NV21Load.cpp.o
[ 64%] Building CXX object CMakeFiles/cmake_samplecode.dir/jni/PreprocessInput.cpp.o
[ 71%] Building CXX object CMakeFiles/cmake_samplecode.dir/jni/SaveOutputTensor.cpp.o
[ 78%] Building CXX object CMakeFiles/cmake_samplecode.dir/jni/SetBuilderOptions.cpp.o
[ 85%] Building CXX object CMakeFiles/cmake_samplecode.dir/jni/Util.cpp.o
[ 92%] Building CXX object CMakeFiles/cmake_samplecode.dir/jni/udlExample.cpp.o
[100%] Linking CXX executable cmake_samplecode
/usr/bin/ld: CMakeFiles/cmake_samplecode.dir/jni/main.cpp.o: in function `main':
main.cpp:(.text+0x205): undefined reference to `zdl::DlSystem::RuntimeList::RuntimeList()'
/usr/bin/ld: main.cpp:(.text+0x226): undefined reference to `zdl::DlSystem::RuntimeList::~RuntimeList()'
/usr/bin/ld: main.cpp:(.text+0x7e4): undefined reference to `zdl::DlSystem::RuntimeList::clear()'
/usr/bin/ld: main.cpp:(.text+0x86c): undefined reference to `zdl::DlSystem::RuntimeList::stringToRuntime(char const*)'
/usr/bin/ld: main.cpp:(.text+0x897): undefined reference to `zdl::DlSystem::RuntimeList::add(zdl::DlSystem::Runtime_t const&)'
/usr/bin/ld: main.cpp:(.text+0x8b1): undefined reference to `zdl::DlSystem::getLastErrorString()'
/usr/bin/ld: main.cpp:(.text+0xc82): undefined reference to `zdl::DlSystem::RuntimeList::empty() const'
/usr/bin/ld: main.cpp:(.text+0xe5f): undefined reference to `zdl::DlSystem::RuntimeList::RuntimeList(zdl::DlSystem::RuntimeList const&)'
/usr/bin/ld: main.cpp:(.text+0xed1): undefined reference to `zdl::DlSystem::RuntimeList::~RuntimeList()'
/usr/bin/ld: main.cpp:(.text+0xfe1): undefined reference to `zdl::SNPE::SNPE::getDiagLogInterface()'
/usr/bin/ld: main.cpp:(.text+0x1144): undefined reference to `zdl::DlSystem::TensorShape::TensorShape()'
/usr/bin/ld: main.cpp:(.text+0x1168): undefined reference to `zdl::SNPE::SNPE::getInputDimensions() const'
/usr/bin/ld: main.cpp:(.text+0x118c): undefined reference to `zdl::DlSystem::TensorShape::operator=(zdl::DlSystem::TensorShape const&)'
/usr/bin/ld: main.cpp:(.text+0x11aa): undefined reference to `zdl::DlSystem::TensorShape::getDimensions() const'
/usr/bin/ld: main.cpp:(.text+0x122d): undefined reference to `zdl::DlSystem::UserBufferMap::UserBufferMap()'
/usr/bin/ld: main.cpp:(.text+0x123c): undefined reference to `zdl::DlSystem::UserBufferMap::UserBufferMap()'
/usr/bin/ld: main.cpp:(.text+0x1400): undefined reference to `zdl::SNPE::SNPE::execute(zdl::DlSystem::UserBufferMap const&, zdl::DlSystem::UserBufferMap const&)'
/usr/bin/ld: main.cpp:(.text+0x1660): undefined reference to `zdl::SNPE::SNPE::execute(zdl::DlSystem::UserBufferMap const&, zdl::DlSystem::UserBufferMap const&)'
/usr/bin/ld: main.cpp:(.text+0x17b0): undefined reference to `zdl::DlSystem::UserBufferMap::~UserBufferMap()'
/usr/bin/ld: main.cpp:(.text+0x17d3): undefined reference to `zdl::DlSystem::UserBufferMap::~UserBufferMap()'
/usr/bin/ld: main.cpp:(.text+0x17fe): undefined reference to `zdl::DlSystem::TensorMap::TensorMap()'
/usr/bin/ld: main.cpp:(.text+0x1914): undefined reference to `zdl::SNPE::SNPE::execute(zdl::DlSystem::ITensor const*, zdl::DlSystem::TensorMap&)'
/usr/bin/ld: main.cpp:(.text+0x1955): undefined reference to `zdl::DlSystem::TensorMap::TensorMap(zdl::DlSystem::TensorMap const&)'
/usr/bin/ld: main.cpp:(.text+0x198d): undefined reference to `zdl::DlSystem::TensorMap::~TensorMap()'
/usr/bin/ld: main.cpp:(.text+0x1a0c): undefined reference to `zdl::DlSystem::TensorMap::~TensorMap()'
/usr/bin/ld: main.cpp:(.text+0x1a49): undefined reference to `zdl::DlSystem::TensorShape::~TensorShape()'
/usr/bin/ld: main.cpp:(.text+0x1c51): undefined reference to `zdl::DlSystem::RuntimeList::~RuntimeList()'
/usr/bin/ld: main.cpp:(.text+0x1d2b): undefined reference to `zdl::DlSystem::UserBufferMap::~UserBufferMap()'
/usr/bin/ld: main.cpp:(.text+0x1d43): undefined reference to `zdl::DlSystem::UserBufferMap::~UserBufferMap()'
/usr/bin/ld: main.cpp:(.text+0x1d5b): undefined reference to `zdl::DlSystem::TensorMap::~TensorMap()'
/usr/bin/ld: main.cpp:(.text+0x1d8b): undefined reference to `zdl::DlSystem::TensorMap::~TensorMap()'
/usr/bin/ld: main.cpp:(.text+0x1dbb): undefined reference to `zdl::DlSystem::TensorShape::~TensorShape()'
/usr/bin/ld: CMakeFiles/cmake_samplecode.dir/jni/main.cpp.o: in function `zdl::DlSystem::Optional<zdl::DlSystem::TensorShape>::~Optional()':
main.cpp:(.text._ZN3zdl8DlSystem8OptionalINS0_11TensorShapeEED2Ev[_ZN3zdl8DlSystem8OptionalINS0_11TensorShapeEED5Ev]+0x76): undefined reference to `zdl::DlSystem::TensorShape::~TensorShape()'
/usr/bin/ld: CMakeFiles/cmake_samplecode.dir/jni/main.cpp.o: in function `std::default_delete<zdl::SNPE::SNPE>::operator()(zdl::SNPE::SNPE*) const':
main.cpp:(.text._ZNKSt14default_deleteIN3zdl4SNPE4SNPEEEclEPS2_[_ZNKSt14default_deleteIN3zdl4SNPE4SNPEEEclEPS2_]+0x22): undefined reference to `zdl::SNPE::SNPE::~SNPE()'
/usr/bin/ld: CMakeFiles/cmake_samplecode.dir/jni/CheckRuntime.cpp.o: in function `checkRuntime(zdl::DlSystem::Runtime_t)':
CheckRuntime.cpp:(.text+0x57): undefined reference to `zdl::SNPE::SNPEFactory::getLibraryVersion()'
/usr/bin/ld: CheckRuntime.cpp:(.text+0xa6): undefined reference to `zdl::DlSystem::Version_t::asString() const'
/usr/bin/ld: CheckRuntime.cpp:(.text+0xb2): undefined reference to `zdl::DlSystem::String::c_str() const'
/usr/bin/ld: CheckRuntime.cpp:(.text+0xde): undefined reference to `zdl::DlSystem::String::~String()'
/usr/bin/ld: CheckRuntime.cpp:(.text+0xe8): undefined reference to `zdl::SNPE::SNPEFactory::isRuntimeAvailable(zdl::DlSystem::Runtime_t)'
/usr/bin/ld: CheckRuntime.cpp:(.text+0x168): undefined reference to `zdl::DlSystem::String::~String()'
/usr/bin/ld: CMakeFiles/cmake_samplecode.dir/jni/CheckRuntime.cpp.o: in function `checkGLCLInteropSupport()':
CheckRuntime.cpp:(.text+0x18e): undefined reference to `zdl::SNPE::SNPEFactory::isGLCLInteropSupported()'
/usr/bin/ld: CMakeFiles/cmake_samplecode.dir/jni/CreateUserBuffer.cpp.o: in function `createUserBuffer(zdl::DlSystem::UserBufferMap&, std::unordered_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::vector<unsigned char, std::allocator<unsigned char> >, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::vector<unsigned char, std::allocator<unsigned char> > > > >&, std::vector<std::unique_ptr<zdl::DlSystem::IUserBuffer, std::default_delete<zdl::DlSystem::IUserBuffer> >, std::allocator<std::unique_ptr<zdl::DlSystem::IUserBuffer, std::default_delete<zdl::DlSystem::IUserBuffer> > > >&, std::unique_ptr<zdl::SNPE::SNPE, std::default_delete<zdl::SNPE::SNPE> >&, char const*, bool, int)':
CreateUserBuffer.cpp:(.text+0x74): undefined reference to `zdl::SNPE::SNPE::getInputOutputBufferAttributes(char const*) const'
/usr/bin/ld: CreateUserBuffer.cpp:(.text+0x1b0): undefined reference to `zdl::DlSystem::TensorShape::rank() const'
/usr/bin/ld: CreateUserBuffer.cpp:(.text+0x242): undefined reference to `zdl::DlSystem::TensorShape::rank() const'
/usr/bin/ld: CreateUserBuffer.cpp:(.text+0x274): undefined reference to `zdl::DlSystem::TensorShape::operator[](unsigned long) const'
/usr/bin/ld: CreateUserBuffer.cpp:(.text+0x2ae): undefined reference to `zdl::DlSystem::TensorShape::operator[](unsigned long) const'
/usr/bin/ld: CreateUserBuffer.cpp:(.text+0x306): undefined reference to `zdl::DlSystem::TensorShape::rank() const'
/usr/bin/ld: CreateUserBuffer.cpp:(.text+0x318): undefined reference to `zdl::DlSystem::TensorShape::getDimensions() const'
/usr/bin/ld: CreateUserBuffer.cpp:(.text+0x45f): undefined reference to `zdl::SNPE::SNPEFactory::getUserBufferFactory()'
/usr/bin/ld: CreateUserBuffer.cpp:(.text+0x4b5): undefined reference to `zdl::DlSystem::TensorShape::TensorShape(std::vector<unsigned long, std::allocator<unsigned long> >)'
/usr/bin/ld: CreateUserBuffer.cpp:(.text+0x581): undefined reference to `zdl::DlSystem::TensorShape::~TensorShape()'
/usr/bin/ld: CreateUserBuffer.cpp:(.text+0x608): undefined reference to `zdl::DlSystem::UserBufferMap::add(char const*, zdl::DlSystem::IUserBuffer*)'
/usr/bin/ld: CreateUserBuffer.cpp:(.text+0x635): undefined reference to `zdl::DlSystem::TensorShape::~TensorShape()'
/usr/bin/ld: CreateUserBuffer.cpp:(.text+0x759): undefined reference to `zdl::DlSystem::TensorShape::~TensorShape()'
/usr/bin/ld: CreateUserBuffer.cpp:(.text+0x7ad): undefined reference to `zdl::DlSystem::TensorShape::~TensorShape()'
/usr/bin/ld: CMakeFiles/cmake_samplecode.dir/jni/CreateUserBuffer.cpp.o: in function `createInputBufferMap(zdl::DlSystem::UserBufferMap&, std::unordered_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::vector<unsigned char, std::allocator<unsigned char> >, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::vector<unsigned char, std::allocator<unsigned char> > > > >&, std::vector<std::unique_ptr<zdl::DlSystem::IUserBuffer, std::default_delete<zdl::DlSystem::IUserBuffer> >, std::allocator<std::unique_ptr<zdl::DlSystem::IUserBuffer, std::default_delete<zdl::DlSystem::IUserBuffer> > > >&, std::unique_ptr<zdl::SNPE::SNPE, std::default_delete<zdl::SNPE::SNPE> >&, bool, int)':
CreateUserBuffer.cpp:(.text+0x83d): undefined reference to `zdl::SNPE::SNPE::getInputTensorNames() const'
/usr/bin/ld: CreateUserBuffer.cpp:(.text+0x8a6): undefined reference to `zdl::DlSystem::StringList::size() const'
/usr/bin/ld: CreateUserBuffer.cpp:(.text+0x8de): undefined reference to `zdl::DlSystem::StringList::begin() const'
/usr/bin/ld: CreateUserBuffer.cpp:(.text+0x8ee): undefined reference to `zdl::DlSystem::StringList::end() const'
/usr/bin/ld: CMakeFiles/cmake_samplecode.dir/jni/CreateUserBuffer.cpp.o: in function `createOutputBufferMap(zdl::DlSystem::UserBufferMap&, std::unordered_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::vector<unsigned char, std::allocator<unsigned char> >, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::vector<unsigned char, std::allocator<unsigned char> > > > >&, std::vector<std::unique_ptr<zdl::DlSystem::IUserBuffer, std::default_delete<zdl::DlSystem::IUserBuffer> >, std::allocator<std::unique_ptr<zdl::DlSystem::IUserBuffer, std::default_delete<zdl::DlSystem::IUserBuffer> > > >&, std::unique_ptr<zdl::SNPE::SNPE, std::default_delete<zdl::SNPE::SNPE> >&, bool, int)':
CreateUserBuffer.cpp:(.text+0x9fb): undefined reference to `zdl::SNPE::SNPE::getOutputTensorNames() const'
/usr/bin/ld: CreateUserBuffer.cpp:(.text+0xa6c): undefined reference to `zdl::DlSystem::StringList::begin() const'
/usr/bin/ld: CreateUserBuffer.cpp:(.text+0xa7c): undefined reference to `zdl::DlSystem::StringList::end() const'
/usr/bin/ld: CMakeFiles/cmake_samplecode.dir/jni/CreateUserBuffer.cpp.o: in function `createUserBuffer(zdl::DlSystem::UserBufferMap&, std::unordered_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, unsigned int, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, unsigned int> > >&, std::vector<std::unique_ptr<zdl::DlSystem::IUserBuffer, std::default_delete<zdl::DlSystem::IUserBuffer> >, std::allocator<std::unique_ptr<zdl::DlSystem::IUserBuffer, std::default_delete<zdl::DlSystem::IUserBuffer> > > >&, std::unique_ptr<zdl::SNPE::SNPE, std::default_delete<zdl::SNPE::SNPE> >&, char const*)':
CreateUserBuffer.cpp:(.text+0xb9c): undefined reference to `zdl::SNPE::SNPE::getInputOutputBufferAttributes(char const*) const'
/usr/bin/ld: CreateUserBuffer.cpp:(.text+0xca0): undefined reference to `zdl::DlSystem::TensorShape::rank() const'
/usr/bin/ld: CreateUserBuffer.cpp:(.text+0xd2f): undefined reference to `zdl::DlSystem::TensorShape::rank() const'
/usr/bin/ld: CreateUserBuffer.cpp:(.text+0xd5d): undefined reference to `zdl::DlSystem::TensorShape::operator[](unsigned long) const'
/usr/bin/ld: CreateUserBuffer.cpp:(.text+0xdd6): undefined reference to `zdl::DlSystem::TensorShape::rank() const'
/usr/bin/ld: CreateUserBuffer.cpp:(.text+0xde8): undefined reference to `zdl::DlSystem::TensorShape::getDimensions() const'
/usr/bin/ld: CreateUserBuffer.cpp:(.text+0xe4e): undefined reference to `zdl::SNPE::SNPEFactory::getUserBufferFactory()'
/usr/bin/ld: CreateUserBuffer.cpp:(.text+0xe92): undefined reference to `zdl::DlSystem::TensorShape::TensorShape(std::vector<unsigned long, std::allocator<unsigned long> >)'
/usr/bin/ld: CreateUserBuffer.cpp:(.text+0xf67): undefined reference to `zdl::DlSystem::TensorShape::~TensorShape()'
/usr/bin/ld: CreateUserBuffer.cpp:(.text+0xfa6): undefined reference to `zdl::DlSystem::UserBufferMap::add(char const*, zdl::DlSystem::IUserBuffer*)'
/usr/bin/ld: CreateUserBuffer.cpp:(.text+0xfd3): undefined reference to `zdl::DlSystem::TensorShape::~TensorShape()'
/usr/bin/ld: CreateUserBuffer.cpp:(.text+0x10b2): undefined reference to `zdl::DlSystem::TensorShape::~TensorShape()'
/usr/bin/ld: CreateUserBuffer.cpp:(.text+0x1106): undefined reference to `zdl::DlSystem::TensorShape::~TensorShape()'
/usr/bin/ld: CMakeFiles/cmake_samplecode.dir/jni/CreateUserBuffer.cpp.o: in function `createInputBufferMap(zdl::DlSystem::UserBufferMap&, std::unordered_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, unsigned int, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, unsigned int> > >&, std::vector<std::unique_ptr<zdl::DlSystem::IUserBuffer, std::default_delete<zdl::DlSystem::IUserBuffer> >, std::allocator<std::unique_ptr<zdl::DlSystem::IUserBuffer, std::default_delete<zdl::DlSystem::IUserBuffer> > > >&, std::unique_ptr<zdl::SNPE::SNPE, std::default_delete<zdl::SNPE::SNPE> >&)':
CreateUserBuffer.cpp:(.text+0x1183): undefined reference to `zdl::SNPE::SNPE::getInputTensorNames() const'
/usr/bin/ld: CreateUserBuffer.cpp:(.text+0x11ec): undefined reference to `zdl::DlSystem::StringList::size() const'
/usr/bin/ld: CreateUserBuffer.cpp:(.text+0x1224): undefined reference to `zdl::DlSystem::StringList::begin() const'
/usr/bin/ld: CreateUserBuffer.cpp:(.text+0x1234): undefined reference to `zdl::DlSystem::StringList::end() const'
/usr/bin/ld: CMakeFiles/cmake_samplecode.dir/jni/CreateUserBuffer.cpp.o: in function `zdl::DlSystem::UserBufferEncodingFloat::UserBufferEncodingFloat()':
CreateUserBuffer.cpp:(.text._ZN3zdl8DlSystem23UserBufferEncodingFloatC2Ev[_ZN3zdl8DlSystem23UserBufferEncodingFloatC5Ev]+0x24): undefined reference to `vtable for zdl::DlSystem::UserBufferEncodingFloat'
/usr/bin/ld: CMakeFiles/cmake_samplecode.dir/jni/CreateUserBuffer.cpp.o: in function `zdl::DlSystem::UserBufferEncodingTfN::UserBufferEncodingTfN(unsigned long, float, unsigned char)':
CreateUserBuffer.cpp:(.text._ZN3zdl8DlSystem21UserBufferEncodingTfNC2Emfh[_ZN3zdl8DlSystem21UserBufferEncodingTfNC5Emfh]+0x31): undefined reference to `zdl::DlSystem::UserBufferEncodingTfN::getTypeFromWidth(unsigned char)'
/usr/bin/ld: CreateUserBuffer.cpp:(.text._ZN3zdl8DlSystem21UserBufferEncodingTfNC2Emfh[_ZN3zdl8DlSystem21UserBufferEncodingTfNC5Emfh]+0x42): undefined reference to `vtable for zdl::DlSystem::UserBufferEncodingTfN'
/usr/bin/ld: CMakeFiles/cmake_samplecode.dir/jni/CreateUserBuffer.cpp.o: in function `zdl::DlSystem::Optional<zdl::DlSystem::StringList>::~Optional()':
CreateUserBuffer.cpp:(.text._ZN3zdl8DlSystem8OptionalINS0_10StringListEED2Ev[_ZN3zdl8DlSystem8OptionalINS0_10StringListEED5Ev]+0x76): undefined reference to `zdl::DlSystem::StringList::~StringList()'
/usr/bin/ld: CMakeFiles/cmake_samplecode.dir/jni/CreateUserBuffer.cpp.o: in function `zdl::DlSystem::UserBufferEncodingFloat::~UserBufferEncodingFloat()':
CreateUserBuffer.cpp:(.text._ZN3zdl8DlSystem23UserBufferEncodingFloatD2Ev[_ZN3zdl8DlSystem23UserBufferEncodingFloatD5Ev]+0x13): undefined reference to `vtable for zdl::DlSystem::UserBufferEncodingFloat'
/usr/bin/ld: CMakeFiles/cmake_samplecode.dir/jni/LoadContainer.cpp.o: in function `loadContainerFromFile(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)':
LoadContainer.cpp:(.text+0x49): undefined reference to `zdl::DlSystem::String::String(char const*)'
/usr/bin/ld: LoadContainer.cpp:(.text+0x5c): undefined reference to `zdl::DlContainer::IDlContainer::open(zdl::DlSystem::String const&)'
/usr/bin/ld: LoadContainer.cpp:(.text+0x87): undefined reference to `zdl::DlSystem::String::~String()'
/usr/bin/ld: CMakeFiles/cmake_samplecode.dir/jni/LoadInputTensor.cpp.o: in function `loadInputTensor(std::unique_ptr<zdl::SNPE::SNPE, std::default_delete<zdl::SNPE::SNPE> >&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >&)':
LoadInputTensor.cpp:(.text+0x61): undefined reference to `zdl::SNPE::SNPE::getInputTensorNames() const'
/usr/bin/ld: LoadInputTensor.cpp:(.text+0xdc): undefined reference to `zdl::DlSystem::StringList::size() const'
/usr/bin/ld: LoadInputTensor.cpp:(.text+0x262): undefined reference to `zdl::DlSystem::StringList::at(unsigned long) const'
/usr/bin/ld: LoadInputTensor.cpp:(.text+0x277): undefined reference to `zdl::SNPE::SNPE::getInputDimensions(char const*) const'
/usr/bin/ld: LoadInputTensor.cpp:(.text+0x2a0): undefined reference to `zdl::SNPE::SNPEFactory::getTensorFactory()'
/usr/bin/ld: LoadInputTensor.cpp:(.text+0x301): undefined reference to `zdl::SNPE::SNPE::getInputDimensions() const'
/usr/bin/ld: LoadInputTensor.cpp:(.text+0x322): undefined reference to `zdl::DlSystem::TensorShape::TensorShape(zdl::DlSystem::TensorShape const&)'
/usr/bin/ld: LoadInputTensor.cpp:(.text+0x33d): undefined reference to `zdl::DlSystem::TensorShape::getDimensions() const'
/usr/bin/ld: LoadInputTensor.cpp:(.text+0x62b): undefined reference to `zdl::DlSystem::TensorShape::~TensorShape()'
/usr/bin/ld: LoadInputTensor.cpp:(.text+0x733): undefined reference to `zdl::DlSystem::TensorShape::~TensorShape()'
/usr/bin/ld: CMakeFiles/cmake_samplecode.dir/jni/LoadInputTensor.cpp.o: in function `loadMultipleInput(std::unique_ptr<zdl::SNPE::SNPE, std::default_delete<zdl::SNPE::SNPE> >&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >&)':
LoadInputTensor.cpp:(.text+0x7f2): undefined reference to `zdl::DlSystem::TensorMap::TensorMap()'
/usr/bin/ld: LoadInputTensor.cpp:(.text+0x816): undefined reference to `zdl::SNPE::SNPE::getInputTensorNames() const'
/usr/bin/ld: LoadInputTensor.cpp:(.text+0x891): undefined reference to `zdl::DlSystem::StringList::size() const'
/usr/bin/ld: LoadInputTensor.cpp:(.text+0x8c5): undefined reference to `zdl::DlSystem::StringList::size() const'
/usr/bin/ld: LoadInputTensor.cpp:(.text+0x915): undefined reference to `zdl::DlSystem::StringList::size() const'
/usr/bin/ld: LoadInputTensor.cpp:(.text+0x94f): undefined reference to `zdl::DlSystem::TensorMap::TensorMap()'
/usr/bin/ld: LoadInputTensor.cpp:(.text+0x9ea): undefined reference to `zdl::DlSystem::StringList::size() const'
/usr/bin/ld: LoadInputTensor.cpp:(.text+0xab1): undefined reference to `zdl::DlSystem::StringList::at(unsigned long) const'
/usr/bin/ld: LoadInputTensor.cpp:(.text+0xb1a): undefined reference to `zdl::DlSystem::StringList::at(unsigned long) const'
/usr/bin/ld: LoadInputTensor.cpp:(.text+0xb2f): undefined reference to `zdl::SNPE::SNPE::getInputDimensions(char const*) const'
/usr/bin/ld: LoadInputTensor.cpp:(.text+0xb58): undefined reference to `zdl::SNPE::SNPEFactory::getTensorFactory()'
/usr/bin/ld: LoadInputTensor.cpp:(.text+0xdc2): undefined reference to `zdl::DlSystem::TensorMap::add(char const*, zdl::DlSystem::ITensor*)'
/usr/bin/ld: LoadInputTensor.cpp:(.text+0xed5): undefined reference to `zdl::DlSystem::TensorMap::~TensorMap()'
/usr/bin/ld: LoadInputTensor.cpp:(.text+0xf02): undefined reference to `zdl::DlSystem::TensorMap::~TensorMap()'
/usr/bin/ld: LoadInputTensor.cpp:(.text+0x1007): undefined reference to `zdl::DlSystem::TensorMap::~TensorMap()'
/usr/bin/ld: LoadInputTensor.cpp:(.text+0x1046): undefined reference to `zdl::DlSystem::TensorMap::~TensorMap()'
/usr/bin/ld: CMakeFiles/cmake_samplecode.dir/jni/LoadInputTensor.cpp.o: in function `loadInputUserBufferTfN(std::unordered_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::vector<unsigned char, std::allocator<unsigned char> >, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::vector<unsigned char, std::allocator<unsigned char> > > > >&, std::unique_ptr<zdl::SNPE::SNPE, std::default_delete<zdl::SNPE::SNPE> >&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >&, zdl::DlSystem::UserBufferMap&, int)':
LoadInputTensor.cpp:(.text+0x10d1): undefined reference to `zdl::SNPE::SNPE::getInputTensorNames() const'
/usr/bin/ld: LoadInputTensor.cpp:(.text+0x114c): undefined reference to `zdl::DlSystem::StringList::size() const'
/usr/bin/ld: LoadInputTensor.cpp:(.text+0x117f): undefined reference to `zdl::DlSystem::StringList::size() const'
/usr/bin/ld: LoadInputTensor.cpp:(.text+0x124c): undefined reference to `zdl::DlSystem::StringList::size() const'
/usr/bin/ld: LoadInputTensor.cpp:(.text+0x1277): undefined reference to `zdl::DlSystem::StringList::at(unsigned long) const'
/usr/bin/ld: LoadInputTensor.cpp:(.text+0x13cb): undefined reference to `zdl::DlSystem::UserBufferMap::getUserBuffer(char const*) const'
/usr/bin/ld: LoadInputTensor.cpp:(.text+0x13eb): undefined reference to `typeinfo for zdl::DlSystem::UserBufferEncodingTfN'
/usr/bin/ld: CMakeFiles/cmake_samplecode.dir/jni/LoadInputTensor.cpp.o: in function `loadInputUserBufferFloat(std::unordered_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::vector<unsigned char, std::allocator<unsigned char> >, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::vector<unsigned char, std::allocator<unsigned char> > > > >&, std::unique_ptr<zdl::SNPE::SNPE, std::default_delete<zdl::SNPE::SNPE> >&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >&)':
LoadInputTensor.cpp:(.text+0x15e0): undefined reference to `zdl::SNPE::SNPE::getInputTensorNames() const'
/usr/bin/ld: LoadInputTensor.cpp:(.text+0x165b): undefined reference to `zdl::DlSystem::StringList::size() const'
/usr/bin/ld: LoadInputTensor.cpp:(.text+0x168e): undefined reference to `zdl::DlSystem::StringList::size() const'
/usr/bin/ld: LoadInputTensor.cpp:(.text+0x175b): undefined reference to `zdl::DlSystem::StringList::size() const'
/usr/bin/ld: LoadInputTensor.cpp:(.text+0x1786): undefined reference to `zdl::DlSystem::StringList::at(unsigned long) const'
/usr/bin/ld: CMakeFiles/cmake_samplecode.dir/jni/LoadInputTensor.cpp.o: in function `loadInputUserBuffer(std::unordered_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, unsigned int, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, unsigned int> > >&, std::unique_ptr<zdl::SNPE::SNPE, std::default_delete<zdl::SNPE::SNPE> >&, unsigned int)':
LoadInputTensor.cpp:(.text+0x1a45): undefined reference to `zdl::SNPE::SNPE::getInputTensorNames() const'
/usr/bin/ld: LoadInputTensor.cpp:(.text+0x1aae): undefined reference to `zdl::DlSystem::StringList::size() const'
/usr/bin/ld: LoadInputTensor.cpp:(.text+0x1ae6): undefined reference to `zdl::DlSystem::StringList::size() const'
/usr/bin/ld: LoadInputTensor.cpp:(.text+0x1b08): undefined reference to `zdl::DlSystem::StringList::at(unsigned long) const'
/usr/bin/ld: CMakeFiles/cmake_samplecode.dir/jni/LoadInputTensor.cpp.o: in function `std::_Head_base<0ul, zdl::DlSystem::TensorMap, false>::_Head_base<zdl::DlSystem::TensorMap&>(zdl::DlSystem::TensorMap&)':
LoadInputTensor.cpp:(.text._ZNSt10_Head_baseILm0EN3zdl8DlSystem9TensorMapELb0EEC2IRS2_EEOT_[_ZNSt10_Head_baseILm0EN3zdl8DlSystem9TensorMapELb0EEC5IRS2_EEOT_]+0x2c): undefined reference to `zdl::DlSystem::TensorMap::TensorMap(zdl::DlSystem::TensorMap const&)'
/usr/bin/ld: CMakeFiles/cmake_samplecode.dir/jni/NV21Load.cpp.o: in function `loadNV21Tensor(std::unique_ptr<zdl::SNPE::SNPE, std::default_delete<zdl::SNPE::SNPE> >&, char const*)':
NV21Load.cpp:(.text+0xc9): undefined reference to `zdl::DlSystem::TensorMap::TensorMap()'
/usr/bin/ld: NV21Load.cpp:(.text+0xed): undefined reference to `zdl::SNPE::SNPE::getInputTensorNames() const'
/usr/bin/ld: NV21Load.cpp:(.text+0x120): undefined reference to `zdl::DlSystem::StringList::size() const'
/usr/bin/ld: NV21Load.cpp:(.text+0x1be): undefined reference to `zdl::DlSystem::StringList::at(unsigned long) const'
/usr/bin/ld: NV21Load.cpp:(.text+0x1d3): undefined reference to `zdl::SNPE::SNPE::getInputDimensions(char const*) const'
/usr/bin/ld: NV21Load.cpp:(.text+0x20b): undefined reference to `zdl::DlSystem::TensorShape::operator[](unsigned long) const'
/usr/bin/ld: NV21Load.cpp:(.text+0x222): undefined reference to `zdl::DlSystem::TensorShape::operator[](unsigned long) const'
/usr/bin/ld: NV21Load.cpp:(.text+0x274): undefined reference to `zdl::SNPE::SNPEFactory::getTensorFactory()'
/usr/bin/ld: NV21Load.cpp:(.text+0x327): undefined reference to `zdl::DlSystem::TensorMap::~TensorMap()'
/usr/bin/ld: NV21Load.cpp:(.text+0x3ce): undefined reference to `zdl::DlSystem::TensorMap::~TensorMap()'
/usr/bin/ld: CMakeFiles/cmake_samplecode.dir/jni/SaveOutputTensor.cpp.o: in function `saveOutput(zdl::DlSystem::TensorMap, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int, unsigned long)':
SaveOutputTensor.cpp:(.text+0x51): undefined reference to `zdl::DlSystem::TensorMap::getTensorNames() const'
/usr/bin/ld: SaveOutputTensor.cpp:(.text+0x6e): undefined reference to `zdl::DlSystem::StringList::begin() const'
/usr/bin/ld: SaveOutputTensor.cpp:(.text+0x84): undefined reference to `zdl::DlSystem::StringList::end() const'
/usr/bin/ld: SaveOutputTensor.cpp:(.text+0x185): undefined reference to `zdl::DlSystem::TensorMap::getTensor(char const*) const'
/usr/bin/ld: SaveOutputTensor.cpp:(.text+0x266): undefined reference to `zdl::DlSystem::StringList::~StringList()'
/usr/bin/ld: SaveOutputTensor.cpp:(.text+0x2c0): undefined reference to `zdl::DlSystem::StringList::~StringList()'
/usr/bin/ld: CMakeFiles/cmake_samplecode.dir/jni/SaveOutputTensor.cpp.o: in function `saveOutput(zdl::DlSystem::UserBufferMap&, std::unordered_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::vector<unsigned char, std::allocator<unsigned char> >, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::vector<unsigned char, std::allocator<unsigned char> > > > >&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int, unsigned long, bool, int)':
SaveOutputTensor.cpp:(.text+0x345): undefined reference to `zdl::DlSystem::UserBufferMap::getUserBufferNames() const'
/usr/bin/ld: SaveOutputTensor.cpp:(.text+0x384): undefined reference to `zdl::DlSystem::StringList::begin() const'
/usr/bin/ld: SaveOutputTensor.cpp:(.text+0x39a): undefined reference to `zdl::DlSystem::StringList::end() const'
/usr/bin/ld: SaveOutputTensor.cpp:(.text+0x49b): undefined reference to `zdl::DlSystem::UserBufferMap::getUserBuffer(char const*) const'
/usr/bin/ld: SaveOutputTensor.cpp:(.text+0x64b): undefined reference to `zdl::DlSystem::UserBufferMap::getUserBuffer(char const*) const'
/usr/bin/ld: SaveOutputTensor.cpp:(.text+0x666): undefined reference to `typeinfo for zdl::DlSystem::UserBufferEncodingTfN'
/usr/bin/ld: SaveOutputTensor.cpp:(.text+0xa57): undefined reference to `zdl::DlSystem::StringList::~StringList()'
/usr/bin/ld: SaveOutputTensor.cpp:(.text+0xbc0): undefined reference to `zdl::DlSystem::StringList::~StringList()'
/usr/bin/ld: CMakeFiles/cmake_samplecode.dir/jni/SaveOutputTensor.cpp.o: in function `zdl::DlSystem::UserBufferEncodingTfN::~UserBufferEncodingTfN()':
SaveOutputTensor.cpp:(.text._ZN3zdl8DlSystem21UserBufferEncodingTfND2Ev[_ZN3zdl8DlSystem21UserBufferEncodingTfND5Ev]+0x13): undefined reference to `vtable for zdl::DlSystem::UserBufferEncodingTfN'
/usr/bin/ld: CMakeFiles/cmake_samplecode.dir/jni/SaveOutputTensor.cpp.o: in function `zdl::DlSystem::UserBufferEncodingTfN::UserBufferEncodingTfN(zdl::DlSystem::UserBufferEncodingTfN const&)':
SaveOutputTensor.cpp:(.text._ZN3zdl8DlSystem21UserBufferEncodingTfNC2ERKS1_[_ZN3zdl8DlSystem21UserBufferEncodingTfNC5ERKS1_]+0x2a): undefined reference to `vtable for zdl::DlSystem::UserBufferEncodingTfN'
/usr/bin/ld: CMakeFiles/cmake_samplecode.dir/jni/SetBuilderOptions.cpp.o: in function `setBuilderOptions(std::unique_ptr<zdl::DlContainer::IDlContainer, std::default_delete<zdl::DlContainer::IDlContainer> >&, zdl::DlSystem::Runtime_t, zdl::DlSystem::RuntimeList, zdl::DlSystem::UDLBundle, bool, zdl::DlSystem::PlatformConfig, bool)':
SetBuilderOptions.cpp:(.text+0x7f): undefined reference to `zdl::SNPE::SNPEBuilder::SNPEBuilder(zdl::DlContainer::IDlContainer*)'
/usr/bin/ld: SetBuilderOptions.cpp:(.text+0x8e): undefined reference to `zdl::DlSystem::RuntimeList::empty() const'
/usr/bin/ld: SetBuilderOptions.cpp:(.text+0xab): undefined reference to `zdl::DlSystem::RuntimeList::add(zdl::DlSystem::Runtime_t const&)'
/usr/bin/ld: SetBuilderOptions.cpp:(.text+0xca): undefined reference to `zdl::SNPE::SNPEBuilder::setOutputLayers(zdl::DlSystem::StringList const&)'
/usr/bin/ld: SetBuilderOptions.cpp:(.text+0xdf): undefined reference to `zdl::SNPE::SNPEBuilder::setRuntimeProcessorOrder(zdl::DlSystem::RuntimeList const&)'
/usr/bin/ld: SetBuilderOptions.cpp:(.text+0x107): undefined reference to `zdl::SNPE::SNPEBuilder::setUdlBundle(zdl::DlSystem::UDLBundle)'
/usr/bin/ld: SetBuilderOptions.cpp:(.text+0x11b): undefined reference to `zdl::SNPE::SNPEBuilder::setUseUserSuppliedBuffers(bool)'
/usr/bin/ld: SetBuilderOptions.cpp:(.text+0x130): undefined reference to `zdl::SNPE::SNPEBuilder::setPlatformConfig(zdl::DlSystem::PlatformConfig const&)'
/usr/bin/ld: SetBuilderOptions.cpp:(.text+0x144): undefined reference to `zdl::SNPE::SNPEBuilder::setInitCacheMode(bool)'
/usr/bin/ld: SetBuilderOptions.cpp:(.text+0x156): undefined reference to `zdl::SNPE::SNPEBuilder::build()'
/usr/bin/ld: SetBuilderOptions.cpp:(.text+0x18d): undefined reference to `zdl::DlSystem::StringList::~StringList()'
/usr/bin/ld: SetBuilderOptions.cpp:(.text+0x19a): undefined reference to `zdl::SNPE::SNPEBuilder::~SNPEBuilder()'
/usr/bin/ld: SetBuilderOptions.cpp:(.text+0x1d4): undefined reference to `zdl::DlSystem::StringList::~StringList()'
/usr/bin/ld: SetBuilderOptions.cpp:(.text+0x1e9): undefined reference to `zdl::SNPE::SNPEBuilder::~SNPEBuilder()'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/cmake_samplecode.dir/build.make:289: cmake_samplecode] Error 1
make[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/cmake_samplecode.dir/all] Error 2
make: *** [Makefile:91: all] Error 2

Can you please provide a working CMakeLists.txt or suggest how to correc this one for it to work?

  • Up0
  • Down0
mitarath
Join Date: 21 Jun 21
Posts: 12
Posted: Thu, 2021-08-12 10:21

Hello customer,

Queries related to CMake is not supported at present !
if you have question for makefile issues, let us know

Thankyou for understanding!
Mita

  • Up0
  • Down0
ap.arunraj
Join Date: 20 Apr 20
Posts: 21
Posted: Wed, 2021-09-01 07:52

Hello 22imonreal,
I was able to build SNPE sample code with the following CMakeList.txt:


-----------------------------------------------CMakeLists.txt----------------------------------------
cmake_minimum_required(VERSION 3.10)

project(SNPE_SAMPLE)
set(CMAKE_CXX_STANDARD 11)
 
#set CXX Flags
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -fPIC -march=x86-64")
 
#set SNPE_ROOT
set(SNPE_ROOT $ENV{SNPE_ROOT})
if(NOT DEFINED SNPE_ROOT)
  message(FATAL_ERROR " SNPE library not found, please setup SNPE")
else()
  message("Found SNPE at ${SNPE_ROOT}")
endif()
 
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/x86_64-linux-clang)
file(GLOB SRC_FILES ${PROJECT_SOURCE_DIR}/jni/*.cpp)

include_directories(${SNPE_ROOT}/include/zdl)
 
add_executable(snpe-sample ${SRC_FILES})
 
target_link_libraries(snpe-sample PRIVATE ${SNPE_ROOT}/lib/x86_64-linux-clang/libSNPE.so)

------------------------------------------------------------------------------------------------------
Note: This CMakeLists.txt is for building snpe sample application for x86-64 linux platform. So make necessary changes according to your needs. Feel free to reply back for any further query.
  • Up0
  • Down0
22imonreal
Join Date: 10 Feb 21
Posts: 80
Posted: Thu, 2021-09-23 02:11

Hello,

Thanks for your reply.

What changes would I need to make to build it for the RB5 platform?

Thanks

  • Up0
  • Down0
22imonreal
Join Date: 10 Feb 21
Posts: 80
Posted: Sun, 2021-10-10 07:58

Hello,

I tried editing the CMakeLists.txt code you shared above to build for the RB5 as follows:

cmake_minimum_required(VERSION 3.10)
project(SNPE_SAMPLE)
set(CMAKE_CXX_STANDARD 11)
 
#set CXX Flags
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -fPIC -march=armv8-a")
 
#set SNPE_ROOT
set(SNPE_ROOT $ENV{SNPE_ROOT})
if(NOT DEFINED SNPE_ROOT)
  message(FATAL_ERROR " SNPE library not found, please setup SNPE")
else()
  message("Found SNPE at ${SNPE_ROOT}")
endif()

set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/aarch64-ubuntu-gcc7.5)
file(GLOB SRC_FILES ${PROJECT_SOURCE_DIR}/jni/*.cpp)

include_directories(${SNPE_ROOT}/include/zdl)
 
add_executable(snpe-sample ${SRC_FILES})
 
target_link_libraries(snpe-sample PRIVATE ${SNPE_ROOT}/lib/aarch64-ubuntu-gcc7.5/libSNPE.so)


But I am getting the following error:


SNPE Version: 1.50.0.2622RBUFFER_FLOAT -d models/dlc/test_model.dlc -i data/input/target_input_list.txt -o data/ou
Selected runtime not present. Falling back to CPU.
Batch size for the container is 1
Processing DNN Input:

This means it is not finding the DSP runtime.

Do I have to include or link any additional libraries in the CMakeListst.txt to get it to run on the DSP or AIP? And how would I do it?

My guess is it has something to do with linking the

$SNPE_ROOT/lib/dsp .so shared libraries, and I tried the following, which did not work:

cmake_minimum_required(VERSION 3.10)
project(SNPE_SAMPLE)
set(CMAKE_CXX_STANDARD 11)
 
#set CXX Flags
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -fPIC -march=armv8-a")
 
#set SNPE_ROOT
set(SNPE_ROOT $ENV{SNPE_ROOT})
if(NOT DEFINED SNPE_ROOT)
  message(FATAL_ERROR " SNPE library not found, please setup SNPE")
else()
  message("Found SNPE at ${SNPE_ROOT}")
endif()

set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/aarch64-ubuntu-gcc7.5)
file(GLOB SRC_FILES ${PROJECT_SOURCE_DIR}/jni/*.cpp)

include_directories(${SNPE_ROOT}/include/zdl)

 find_library(LIBCALCULATORSKEL
     NAMES libcalculator_skel.so
     REQUIRED
     PATHS "${SNPE_ROOT}/lib/dsp/"
 )

 find_library(LIBSNPEDSPV65DOMAINSV2SKEL
     NAMES libsnpe_dsp_v65_domains_v2_skel.so
     REQUIRED
     PATHS "${SNPE_ROOT}/lib/dsp/"
 )

 find_library(LIBSNPEDSPV66DOMAINSV2SKEL
     NAMES libsnpe_dsp_v66_domains_v2_skel.so
     REQUIRED
     PATHS "${SNPE_ROOT}/lib/dsp/"
 )

 find_library(LIBSNPEDSPV68DOMAINSV3SKEL
     NAMES libsnpe_dsp_v68_domains_v3_skel.so
     REQUIRED
     PATHS "${SNPE_ROOT}/lib/dsp/"
 )
 
add_executable(snpe-sample ${SRC_FILES})
 
target_link_libraries(snpe-sample PRIVATE ${SNPE_ROOT}/lib/aarch64-ubuntu-gcc7.5/libSNPE.so
			    ${LIBCALCULATORSKEL}
                           ${LIBSNPEDSPV65DOMAINSV2SKEL}
                           ${LIBSNPEDSPV66DOMAINSV2SKEL}
                           ${LIBSNPEDSPV68DOMAINSV3SKEL}
                                )


so how would I do this in the CMakeLists.txt to make the sample-app for the RB5 find the DSP runtime?

Thank you in advance, I just need this last bit to work with your help, and I am sure it will help may other customers who are having similar issues, so I would be very grateful if you could come back to me with an answer and not just ignore this post as with the one above.

Kind regards,

A grateful customer.

  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.