Forums - where to find libatomic.so.1?

7 posts / 0 new
Last post
where to find libatomic.so.1?
jerry.wj_chen
Join Date: 5 Mar 18
Posts: 7
Posted: Mon, 2018-04-16 20:40

Hi all,

According to the SDK document SNPE setup.

There is a requirement to copy libatomic.so.1 to $SNPE_ROOT/lib/aarch64-linux-gcc4.9/

However, I am new to cross compiling and I have no idea which library should i copy from.

There are so many different 

I know this is stupid but could anyone give me a hint? 

I am very appreciated, since i keep getting error message when i make Makefile.aarch64-linux-gcc4.9.

(How to fullfill the following library requirement?) 

  • Aarch64 Linux Runtime Library Requirement

The SDK requires libatomic.so.1. The SDK does not ship with this library so it needs to be copied into the library folder of SNPE SDK aarch64-linux

cp <path_to_libatomic>/libatomic.so.1 $SNPE_ROOT/lib/aarch64-linux-gcc4.9/
  • Up0
  • Down0
jihoonk
Profile picture
Join Date: 28 Jan 13
Location: Seoul
Posts: 55
Posted: Mon, 2018-04-16 21:17

You can find libatomic.so.1 at /usr/aarch64-linux-gnu/lib/ if you've installed cross-compile environment. If not, install the environment first using following command:

sudo apt install gcc-aarch64-linux-gnu

  • Up0
  • Down0
jerry.wj_chen
Join Date: 5 Mar 18
Posts: 7
Posted: Tue, 2018-04-17 00:18

Hi jihoonk

Thanks for the reply and I tired the command and it automatically installed gcc-4.8-aarch64-linux-gnu on my system. 

But it seems SNPE states that I should use Ubuntu 14.04 to develop the program.

My target platform is aarch64, so i try to compile the snpe-sample with Makefile.aarch64-linux-gcc4.9.

However i found that i on Ubuntu 14.04 there is only gcc-4.8-aarch64-linux-gnu getting supported.

If i want to install gcc-4.9-aarch64-linux-gnu, i have to shift to Ubuntu 16.xx.

Do you have any clue about that? Since i am still not able to compile it successfully.

I can't local libstdc++.so.6 in /usr/aarch64-linux-gnu/lib/

 i don't know if it is the matter of gcc version?

Again very appreciated.

 

 
  • Up0
  • Down0
jihoonk
Profile picture
Join Date: 28 Jan 13
Location: Seoul
Posts: 55
Posted: Tue, 2018-04-17 01:34

Hi jerry.wj_chen,

I'm not sure if you really need gcc-4.9.

Before that, I'd like to check your environment. Could you paste your Makefile and the error message you ran into? Is there /usr/aarch64-linux-gnu/lib/libstdc++.so.6?

Thanks,

Jihoon

  • Up0
  • Down0
jerry.wj_chen
Join Date: 5 Mar 18
Posts: 7
Posted: Tue, 2018-04-17 02:56
I solve the problem by install g++-aarch64-linux-gnu (sudo apt-get install g++-aarch64-linux-gnu)
 
The missed .so files seems are installed into /usr/aarch64-linux-gnu/lib by the above command.
 
However, I got the different error now.
 
Currently I didn't modify the content of example file Makefile.aarch64-linux-gcc4.9,
 
but just add a line on the top of it.
 
CXX=/usr/bin/aarch64-linux-gnu-g++
 
Then I type
 
cd ${SNPE_ROOT}/examples/NativeCpp/SampleCode
 
make -f Makefile.aarch64-linux-gcc4.9
 
I got the following error:
 
...(ignore most of compiling message)...
 
/usr/bin/aarch64-linux-gnu-g++ -c -std=c++11 -fPIC -march=armv8-a -I /home/wzchen/snpe-1.13.0//include/zdl jni/Util.cpp -o obj/local/aarch64-linux-gcc4.9/Util.o
/usr/bin/aarch64-linux-gnu-g++ -L /home/wzchen/snpe-1.13.0//lib/aarch64-linux-gcc4.9 obj/local/aarch64-linux-gcc4.9/CheckRuntime.o obj/local/aarch64-linux-gcc4.9/CreateUserBuffer.o obj/local/aarch64-linux-gcc4.9/ExecuteNetwork.o obj/local/aarch64-linux-gcc4.9/LoadContainer.o obj/local/aarch64-linux-gcc4.9/LoadInputTensor.o obj/local/aarch64-linux-gcc4.9/main.o obj/local/aarch64-linux-gcc4.9/NV21Load.o obj/local/aarch64-linux-gcc4.9/SetBuilderOptions.o obj/local/aarch64-linux-gcc4.9/udlExample.o obj/local/aarch64-linux-gcc4.9/Util.o /home/wzchen/snpe-1.13.0//lib/aarch64-linux-gcc4.9/libSNPE.so /home/wzchen/snpe-1.13.0//lib/aarch64-linux-gcc4.9/libsymphony-cpu.so -o obj/local/aarch64-linux-gcc4.9/snpe-sample
/home/wzchen/snpe-1.13.0//lib/aarch64-linux-gcc4.9/libSNPE.so: undefined reference to `__cxa_throw_bad_array_new_length@CXXABI_1.3.8'
/home/wzchen/snpe-1.13.0//lib/aarch64-linux-gcc4.9/libSNPE.so: undefined reference to `std::__throw_out_of_range_fmt(char const*, ...)@GLIBCXX_3.4.20'
collect2: error: ld returned 1 exit status
make: *** [obj/local/aarch64-linux-gcc4.9/snpe-sample] Error 1
 
Thanks,
Jerry
  • Up0
  • Down0
jihoonk
Profile picture
Join Date: 28 Jan 13
Location: Seoul
Posts: 55
Posted: Wed, 2018-04-18 00:11

Hi jerry.wj_chen,

The build succeeds in my environment.

Ubuntu 16.04 / aarch64-linux-gnu-g++ 5.4.0

strings /usr/aarch64-linux-gnu/lib/libstdc++.so.6.0.21 | grep GLIBCXX

GLIBCXX_3.4
GLIBCXX_3.4.1
GLIBCXX_3.4.2
GLIBCXX_3.4.3
GLIBCXX_3.4.4
GLIBCXX_3.4.5
GLIBCXX_3.4.6
GLIBCXX_3.4.7
GLIBCXX_3.4.8
GLIBCXX_3.4.9
GLIBCXX_3.4.10
GLIBCXX_3.4.11
GLIBCXX_3.4.12
GLIBCXX_3.4.13
GLIBCXX_3.4.14
GLIBCXX_3.4.15
GLIBCXX_3.4.16
GLIBCXX_3.4.17
GLIBCXX_3.4.18
GLIBCXX_3.4.19
GLIBCXX_3.4.20
GLIBCXX_3.4.21
GLIBCXX_DEBUG_MESSAGE_LENGTH
 
$ strings /usr/aarch64-linux-gnu/lib/libstdc++.so.6.0.21 | grep CXXABI
CXXABI_1.3
CXXABI_1.3.1
CXXABI_1.3.2
CXXABI_1.3.3
CXXABI_1.3.4
CXXABI_1.3.5
CXXABI_1.3.6
CXXABI_1.3.7
CXXABI_1.3.8
CXXABI_1.3.9
CXXABI_TM_1
 
It seems your libstdc++.so version is not compatible with SNPE. You'd better install g++ at least 4.9 version. You might be able to install g++ 4.9 or 5 without upgrading OS version. Googling can help you hopefully.
 
Thanks,
Jihoon

 

  • Up0
  • Down0
jerry.wj_chen
Join Date: 5 Mar 18
Posts: 7
Posted: Wed, 2018-04-18 01:35

Okay, I will upgrade my OS. It seems much easier.

Actually, I use Ubuntu 14.04 only because of the suggestion of SNPE document.

Anyway, thanks for solving my problem! It helps me a lot!

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