Cannot build graphs in VisionSDK_S32V2_RTM_1_2_0

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Cannot build graphs in VisionSDK_S32V2_RTM_1_2_0

1,590 Views
svofski
Contributor I

Hi, I'm trying to build some of the demos in VisionSDK_S32V2_RTM_1_2_0. They used to build fine in the pre-release version, but in that version some of the dependencies were simply included as precompiled .a libraries. Now it's not the case, they must be built and something is wrong.

For example, to build pedestrian_detection app, apexcv_pro_pyramid.a is required, so I'm in:

~/VisionSDK_S32V2_RTM_1_2_0/s32v234_sdk/libs/apexcv_pro/image_pyramid/graphs/build-apu-nxp-sa-d

When I run make, it appears to ignore the build environment and compiles using the host compiler:

Current SDK ROOT is /home/user/VisionSDK_S32V2_RTM_1_2_0/s32v234_sdk
apu-kernel-getgraphs.mk: updating pyramid_up_apu_process_desc_main.cpp
apu-kernel-getgraphs.mk: updating pyramid_up_apu_process_desc_main.cpp_g++.d
apu-kernel-getgraphs.mk: updating pyramid_down_apu_process_desc_main.cpp
apu-kernel-getgraphs.mk: updating pyramid_down_apu_process_desc_main.cpp_g++.d
Current SDK ROOT is /home/svo/VisionSDK_S32V2_RTM_1_2_0/s32v234_sdk
 offline/X86 CX pyramid_down_apu_process_desc_main.o
 offline/X86 LD pyramid_down_apu_process_desc_main.exe <= pyramid_down_apu_process_desc_main.o ../../../../../libs/apex/acf_offline/build-x86-gnu-linux-d/libacf_offline.a ../../../../../kernels/apu/apexcv_pro_pyramid/build-apu-nxp-sa-d/apexcv_pro_pyramidacf.a
../../../../../libs/apex/acf_offline/build-x86-gnu-linux-d/libacf_offline.a(acf_process_desc_apu-cpp.obj): In function `ACF_Process_Desc_APU::AnalyzeScenarios()':
/work/agent_home/xml-data/build-dir/AVS-CI174-LIN/vsdk/s32v234_sdk/libs/apex/acf_offline/build-x86-gnu-linux-d/../../../../libs/apex/acf_offline/src/acf_process_desc_apu.cpp:338: undefined reference to `__cxa_throw_bad_array_new_length'
/work/agent_home/xml-data/build-dir/AVS-CI174-LIN/vsdk/s32v234_sdk/libs/apex/acf_offline/build-x86-gnu-linux-d/../../../../libs/apex/acf_offline/src/acf_process_desc_apu.cpp:339: undefined reference to `__cxa_throw_bad_array_new_length'
collect2: error: ld returned 1 exit status
make: *** [pyramid_down_apu_process_desc_main.exe] Error 1

These error messages are just garbage caused by incompatible object file formats. It's not that surprising. If I run make V=1, I can see that it invokes host "g++" without prefix. This is also confirmed by probing some of the .o files:

$ file pyramid_down_apu_process_desc_main.o
pyramid_down_apu_process_desc_main.o: ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), not stripped

The suffix .exe is also confusing, when building a linux library on linux host it seems out of place.

Relevant exports:

CROSS_COMPILE="aarch64-linux-gnu-"
CROSS_COMPILE_AARCH64_ELF="aarch64-none-elf-"
CROSS_COMPILE_M0_ELF="arm-none-eabi-"
APU_TOOLS=/home/svo/NXP/APU_Compiler_v1.0/
APU_COMP=nxp

This is on Linux Ubuntu 14.04.1, VisionSDK_S32V2_RTM_1_2_0 and NXP APU_Compiler_b530.

I guess the build system is missing some crucial environment variable but I don't know which one. Any help is greatly appreciated!

Labels (2)
3 Replies

969 Views
svofski
Contributor I

Found the problem. 

Ubuntu 14.04 uses gcc-4.8. Some of the libraries in the SDK are still binary-only and they appear to be compiled with gcc-4.9 or higher. 

Possible solutions:

1) Install gcc-4.9 and update-alternatives to make it default. The procedure is described in this article:

apt - Updating to latest gcc and g++ on Ubuntu 16.04 - Ask Ubuntu 

2) This is more of a quick workaround: create and compile a C source that defines void __cxa_throw_bad_array_new_length() {} and add it to the project.

969 Views
beijianfeng
Contributor II

2) This is more of a quick workaround: create and compile a C source that defines void __cxa_throw_bad_array_new_length() {} and add it to the project.

Could you show me how you add it to the project?

0 Kudos

969 Views
KushalShahNXP
NXP Employee
NXP Employee

Hi,

According to release notes...

If you are using ubuntu compilers, it supports gcc 4.9.4.

It also supports gcc 6.3.1. You can download it from here:

https://releases.linaro.org/components/toolchain/binaries/6.3-2017.05/aarch64-linux-gnu/gcc-linaro-6...
https://releases.linaro.org/components/toolchain/binaries/6.3-2017.05/aarch64-elf/gcc-linaro-6.3.1-2...
https://releases.linaro.org/components/toolchain/binaries/6.3-2017.05/arm-eabi/gcc-linaro-6.3.1-2017...

NXP also supports gcc 6.3.1 compiler with NXP patches. It will be available soon.

And followings are the critical environment variables you need to set up:

   export ARCH=arm
   export PATH=/path/to/“aarch64-elf”/cross/compiler/binaries:$PATH
   export PATH=/path/to/“aarch64-linux-gnu”/cross/compiler/binaries:$PATH
   export PATH=/path/to/“arm-eabi”/cross/compiler/binaries:$PATH
   export S32V234_VSDK_DIR=/path/to/vsdk_installation_dir/s32v234_sdk/
   export APU_COMP=nxp
   export APU_TOOLS=/path/to/apu/compiler/APU_Compiler_vx.x/
   export PATH=/path/to/apu/compiler/APU_Compiler_vx.x/bin/:$PATH

For future questions:

This is not a proper community page for VSDK questions. If you have further questions on VSDK or S32K as a general please post it on nxp.com/support using support request option and an expert will help you.

Regards,

Kushal