Forums - SNPE runtime error when executing Makefile.x86_64-linux-clang

3 posts / 0 new
Last post
SNPE runtime error when executing Makefile.x86_64-linux-clang
yanbophx
Join Date: 16 Oct 17
Posts: 17
Posted: Tue, 2018-01-09 05:47

Dear SNPE developers,

I have encountered a problem when trying the example for UDL in SNPE runtime. 

switching to the folder: ~/Downloads/snpe-1.8.0/examples/NativeCpp/UdlExample   and  executing:

$ make -f Makefile.x86_64-linux-clang

The output log is shown below:

-----------------------------------------------------------------------

mkdir -p obj/local/x86_64-linux-clang
g++ -c -std=c++11 -fPIC -march=x86-64 -I /home/yanbo/Downloads/snpe-1.8.0/include -I /home/yanbo/Downloads/snpe-1.8.0/include/zdl jni/udlMyCustomScaleLayer.cpp -o obj/local/x86_64-linux-clang/udlMyCustomScaleLayer.o
g++ -c -std=c++11 -fPIC -march=x86-64 -I /home/yanbo/Downloads/snpe-1.8.0/include -I /home/yanbo/Downloads/snpe-1.8.0/include/zdl jni/main.cpp -o obj/local/x86_64-linux-clang/main.o
In file included from jni/main.cpp:64:0:
/home/yanbo/Downloads/snpe-1.8.0/include/zdl/DlSystem/DlError.hpp:168:1: warning: type attributes ignored after type is already defined [-Wattributes]
 };
 ^
g++ -L /home/yanbo/Downloads/snpe-1.8.0/lib/x86_64-linux-clang obj/local/x86_64-linux-clang/udlMyCustomScaleLayer.o obj/local/x86_64-linux-clang/main.o -lSNPE -o obj/local/x86_64-linux-clang/snpe-net-run-udl
obj/local/x86_64-linux-clang/main.o: In function `main':
main.cpp:(.text+0x5d0): undefined reference to `zdl::DlContainer::IDlContainer::open(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
main.cpp:(.text+0x9eb): undefined reference to `zdl::DlSystem::Version_t::toString[abi:cxx11]() const'
collect2: error: ld returned 1 exit status
Makefile.x86_64-linux-clang:41: recipe for target 'obj/local/x86_64-linux-clang/snpe-net-run-udl' failed
make: *** [obj/local/x86_64-linux-clang/snpe-net-run-udl] Error 1
----------------------------------------------------------------------

By the way, I have no problem in converting my mnist caffemodel (containing MyCustomScale layer) into dlc file, by calling snpe-to-caffe-dlc-udl.

Would you please help resolve this issue for SNPE runtime?

Best regards,

  • Up0
  • Down0
yanbophx
Join Date: 16 Oct 17
Posts: 17
Posted: Tue, 2018-01-09 17:43

By switching to gcc4.9, the problem was sloved. I think it would be useful to make a note in the tutorial by explicitly pointing out the exact gcc version used for complilation.

Best regards,

  • Up0
  • Down0
zhaoyangstar
Join Date: 14 Apr 19
Posts: 23
Posted: Fri, 2019-04-19 05:49

I also met these error. My gcc version is 5.4.0.

I changed the original code

container = zdl::DlContainer::IDlContainer::open(ContainerPath) to container = zdl::DlContainer::IDlContainer::open(zdl::DlSystem::String(ContainerPath.c_str()))

 

and chang original code std::cout << "SNPE v" << zdl::SNPE::SNPEFactory::getLibraryVersion().toString() << "\n"; to std::cout << "SNPE v" << zdl::SNPE::SNPEFactory::getLibraryVersion().asString() << "\n";

These changes work for me. You can have a try^_^

PS: Suggest use clang++ instead of g++ to compile these code.

  • 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.