ARM-software / armnn

Arm NN ML Software. The code here is a read-only mirror of https://review.mlplatform.org/admin/repos/ml/armnn
https://developer.arm.com/products/processors/machine-learning/arm-nn
MIT License
1.14k stars 307 forks source link

Error Building PyARMNN on 22.05.01 #676

Closed slntopp closed 1 year ago

slntopp commented 1 year ago

I used pre-built binaries from 22.05.01 release and as usual followed this manual

At the python setup.py build_ext --inplace step, building 'pyarmnn._generated._pyarmnn' extension fails. Here is the full log:

python setup.py build_ext --inplace
running build_ext
building 'pyarmnn._generated._pyarmnn_version' extension
creating build
creating build/temp.linux-x86_64-3.10
creating build/temp.linux-x86_64-3.10/src
creating build/temp.linux-x86_64-3.10/src/pyarmnn
creating build/temp.linux-x86_64-3.10/src/pyarmnn/_generated
gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -flto=auto -ffat-lto-objects -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -flto=auto -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -flto=auto -fPIC -I/home/user/project/armnn/include -I/home/user/project/armnn/profiling/common/include -I/home/user/project/venv/include -I/usr/include/python3.10 -c src/pyarmnn/_generated/armnn_version_wrap.cpp -o build/temp.linux-x86_64-3.10/src/pyarmnn/_generated/armnn_version_wrap.o -std=c++14
creating build/lib.linux-x86_64-3.10
creating build/lib.linux-x86_64-3.10/pyarmnn
creating build/lib.linux-x86_64-3.10/pyarmnn/_generated
g++ -shared -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -flto=auto -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -flto=auto build/temp.linux-x86_64-3.10/src/pyarmnn/_generated/armnn_version_wrap.o -L/home/user/project/armnnlib -L/usr/lib -Wl,--enable-new-dtags,-R/home/user/project/armnnlib -l:libarmnn.so -o build/lib.linux-x86_64-3.10/pyarmnn/_generated/_pyarmnn_version.cpython-310-x86_64-linux-gnu.so
building 'pyarmnn._generated._pyarmnn' extension
gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -flto=auto -ffat-lto-objects -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -flto=auto -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -flto=auto -fPIC -I/home/user/project/armnn/include -I/home/user/project/armnn/profiling/common/include -I/home/user/project/venv/include -I/usr/include/python3.10 -c src/pyarmnn/_generated/armnn_wrap.cpp -o build/temp.linux-x86_64-3.10/src/pyarmnn/_generated/armnn_wrap.o -std=c++14
In file included from src/pyarmnn/_generated/armnn_wrap.cpp:5941:
/home/user/project/armnn/include/armnn/IRuntime.hpp:19:10: fatal error: client/include/ILocalPacketHandler.hpp: No such file or directory
   19 | #include <client/include/ILocalPacketHandler.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
error: command '/usr/bin/gcc' failed with exit code 1

Python Version: 3.10.5 GCC Version: 12.1.0

kylesayrs commented 1 year ago

These headers are found in https://github.com/ARM-software/armnn/tree/branches/armnn_22_05/profiling/client/include. You'll want to include these in your build.

ArmRyan commented 1 year ago

I think adding the profiling base directory into the include will work better, since its searching for <client/include/ILocalPacketHandler.hpp>

As far as i'm aware all references to profiling includes should be resolved from profiling base directory. I think that guide might need an update.

ArmRyan commented 1 year ago

This worked for me, export ARMNN_INCLUDE=$HOME/dev/devenv/armnn/include/:$HOME/dev/devenv/armnn/profiling:$HOME/dev/devenv/armnn/profiling/common/include/ I will update the guide and try to fix the inconsistent includes.

regards, Ryan

slntopp commented 1 year ago

Great, i'll take a look. You tried with the latest version i suppose?

ArmRyan commented 1 year ago

I used v22.05.1 for the build. The latest binaries that are available