nxp-imx / pyarmnn-release

PyArmNN is a python extension for Arm NN SDK. PyArmNN provides interface similar to Arm NN C++ Api.
MIT License
14 stars 3 forks source link

Cross-compiliation Yocto fails. #3

Open PetervdPerk-NXP opened 4 years ago

PetervdPerk-NXP commented 4 years ago

Trying to cross-compile this package through Yocto cmake it fails on

| aarch64-fsl-linux-g++: error: unrecognized command line option '-R'
| Failed to build extension pyarmnn._generated._pyarmnn_version.
|  command 'aarch64-fsl-linux-g++' failed with exit status 1

The paths generated by LazyArmnnFinderExtension are possibly wrong. Resulting in an include with "-R" instead of "-Wl,-R" see:

aarch64-fsl-linux-g++ -mcpu=cortex-a53+crc+crypto -fstack-protector-strong -D_FORTIFY_SOURCE=2
 -Wformat -Wformat-security -Werror=format-security --sysroot=/home/peter/hovergames/build-ubuntu/tmp/work/aarch64-fsl-linux/pyarmnn/19.08-r0/recipe-sysroot
 -shared -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -fstack-protector-strong -Wl,-z,relro,-z,now 
-L/home/peter/hovergames/build-ubuntu/tmp/work/aarch64-fsl-linux/pyarmnn/19.08-r0/recipe-sysroot 
-Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -fstack-protector-strong -Wl,-z,relro,-z,now -Wl,-O1 
-Wl,--hash-style=gnu -Wl,--as-needed -fstack-protector-strong -Wl,-z,relro,-z,now -O2 -pipe -g 
-feliminate-unused-debug-types -fmacro-prefix-map=/home/peter/hovergames/build-ubuntu/tmp/work/aarch64-fsl-linux/pyarmnn/19.08-r0=/usr/src/debug/pyarmnn/19.08-r0 
-fdebug-prefix-map=/home/peter/hovergames/build-ubuntu/tmp/work/aarch64-fsl-linux/pyarmnn/19.08-r0=/usr/src/debug/pyarmnn/19.08-r0
 -fdebug-prefix-map=/home/peter/hovergames/build-ubuntu/tmp/work/aarch64-fsl-linux/pyarmnn/19.08-r0/recipe-sysroot= 
-fdebug-prefix-map=/home/peter/hovergames/build-ubuntu/tmp/work/aarch64-fsl-linux/pyarmnn/19.08-r0/recipe-sysroot-native= 
-mcpu=cortex-a53+crc+crypto -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat 
-Wformat-security -Werror=format-security 
--sysroot=/home/peter/hovergames/build-ubuntu/tmp/work/aarch64-fsl-linux/pyarmnn/19.08-r0/recipe-sysroot build/temp.linux-x86_64-3.8/src/pyarmnn/_generated/armnn_version_wrap.o 
-L/home/peter/hovergames/build-ubuntu/tmp/work/aarch64-fsl-linux/pyarmnn/19.08-r0/recipe-sysroot/usr/lib 
-L/home/peter/hovergames/build-ubuntu/tmp/work/aarch64-fsl-linux/pyarmnn/19.08-r0/recipe-sysroot/usr/lib 
-R/home/peter/hovergames/build-ubuntu/tmp/work/aarch64-fsl-linux/pyarmnn/19.08-r0/recipe-sysroot/usr/lib 
-l:libarmnn.so
 -o build/lib.linux-x86_64-3.8/pyarmnn/_generated/_pyarmnn_version.cpython-38-aarch64-linux-gnu.so
pavel-macenauer-nxp commented 4 years ago

Hi @PetervdPerk-NXP thanks for the feedback, we will look into that. We are aware that PyArmNN is not cross-compilable currently, that's why there is the whl available for arm64, which is used to create Yocto images. Compilation only works with native compile. This issue is on our TODO list, and it should be resolved before we upgrade to Arm NN 20.05 (here for this repo and for any 20.05+ forks/upstream Arm repo), which will use the Arm NN repo to build PyArmNN, where the whl will no longer be available.

pavel-macenauer-nxp commented 3 years ago

@PetervdPerk-NXP For 5.10 Gatesgarth Yocto we will compile Arm NN (20.08) using the Arm NN recipe, so it will be cross-compilable using Yocto (bitbake), probably not using Yocto SDK.