python3-protobuf yocto receipe, getting compiler error - python

I have been trying to compile python3-protobuf package from Yocto dunfell release, but I am getting compiler error.
I am below recipe from Yocto without any change:
python3-protobuf_3.11.3.bb
inherit setuptools3
require python-protobuf.inc
BBCLASSEXTEND = "native nativesdk"
DEPENDS += "protobuf"
DISTUTILS_BUILD_ARGS += "--cpp_implementation"
DISTUTILS_INSTALL_ARGS += "--cpp_implementation"
do_compile_prepend_class-native () {
export KOKORO_BUILD_NUMBER="1"
}
I am getting below error
aarch64-oe-linux-gcc -march=armv8-a+crc -fstack-protector-strong -pie -fPIE -D_FORTIFY_SOURCE=2 -Wa,--noexecstack -Wformat -Wformat-security -Werror=format-security --sysroot=/home/admin/build/distro-debug/tmp-glibc/work/aarch64-oe-linux/python3-protobuf/3.11.3-r0/recipe-sysroot -Wno-unused-result -Wsign-compare -DNDEBUG -g -O3 -Wall -O2 -g -Wa,--noexecstack -fexpensive-optimizations -frename-registers -ftree-vectorize -finline-functions -finline-limit=64 -Wno-error=maybe-uninitialized -Wno-error=unused-result -O2 -g -Wa,--noexecstack -fexpensive-optimizations -frename-registers -ftree-vectorize -finline-functions -finline-limit=64 -Wno-error=maybe-uninitialized -Wno-error=unused-result -O2 -g -Wa,--noexecstack -fexpensive-optimizations -frename-registers -ftree-vectorize -finline-functions -finline-limit=64 -Wno-error=maybe-uninitialized -Wno-error=unused-result -fPIC -I. -I../src -I/home/admin/build/distro-debug/tmp-glibc/work/aarch64-oe-linux/python3-protobuf/3.11.3-r0/recipe-sysroot/usr/include/python3.8 -c google/protobuf/pyext/message.cc -o /home/admin/build/distro-debug/tmp-glibc/work/aarch64-oe-linux/python3-protobuf/3.11.3-r0/build/temp.linux-x86_64-3.8/google/protobuf/pyext/message.o -Wno-write-strings -Wno-invalid-offsetof -Wno-sign-compare -Wno-unused-variable -std=c++11
google/protobuf/pyext/message.cc:70:10: fatal error: google/protobuf/stubs/map_util.h: No such file or directory
70 | #include <google/protobuf/stubs/map_util.h>
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
error: command 'aarch64-oe-linux-gcc' failed with exit status 1
ERROR: 'python3 setup.py build --cpp_implementation' execution failed.
WARNING: /home/admin/build/distro-debug/tmp-glibc/work/aarch64-oe-linux/python3-protobuf/3.11.3-r0/temp/run.do_compile.15287:1 exit 1 from 'exit 1'
If I remove below from recipe
DISTUTILS_BUILD_ARGS += "--cpp_implementation"
DISTUTILS_INSTALL_ARGS += "--cpp_implementation"
from the recipe, then I do not get any error.
Thanks

Related

Python encountered a configuration problem when installing spams package

I encountered some configuration problems when installing spams package in python
The version of my Visual Studio is 14.0. I made the VERSION of the code in the msvc9compiler.py file equal to 14.0 and solved the problem of not finding the version; and added the distutils.cfg file: [build] compiler=mingw32 solved some bugs. Now I have encountered a missing spams-tst.h file and gcc status 1 problem, cry...
D:\software\anaconda3\anzhuang_k\spams-2.6.1>python setup.py install
running install
running build
running build_py
running build_ext
building '_spams_wrap' extension
C compiler: gcc -g -DDEBUG -DMS_WIN64 -O0 -Wall -Wstrict-prototypes
compile options: '-DNPY_MINGW_USE_CUSTOM_MSVCR -D__MSVCRT_VERSION__=0x1900 -I. -Ispams\linalg -Ispams\prox -Ispams\decomp -Ispams\dictLearn -ID:\software\anaconda3\lib\site-packages\numpy\core\include -ID:\software\anaconda3\include -ID:\software\anaconda3\include -ID:\software\anaconda3\include -ID:\software\anaconda3\include -c'
extra options: '-DNDEBUG -DUSE_BLAS_LIB -fPIC -fopenmp -Wunused-variable -m64'
gcc -g -DDEBUG -DMS_WIN64 -O0 -Wall -Wstrict-prototypes -DNPY_MINGW_USE_CUSTOM_MSVCR -D__MSVCRT_VERSION__=0x1900 -I. -Ispams\linalg -Ispams\prox -Ispams\decomp -Ispams\dictLearn -ID:\software\anaconda3\lib\site-packages\numpy\core\include -ID:\software\anaconda3\include -ID:\software\anaconda3\include -ID:\software\anaconda3\include -ID:\software\anaconda3\include -c spams_wrap.cpp -o build\temp.win-amd64-3.6\Release\spams_wrap.o -DNDEBUG -DUSE_BLAS_LIB -fPIC -fopenmp -Wunused-variable -m64
cc1plus.exe: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
spams_wrap.cpp:1:0: warning: -fPIC ignored for target (all code is position independent)
/* ----------------------------------------------------------------------------
^
spams_wrap.cpp:3134:23: fatal error: spams-tst.h: No such file or directory
compilation terminated.
error: Command "gcc -g -DDEBUG -DMS_WIN64 -O0 -Wall -Wstrict-prototypes -DNPY_MINGW_USE_CUSTOM_MSVCR -D__MSVCRT_VERSION__=0x1900 -I. -Ispams\linalg -Ispams\prox -Ispams\decomp -Ispams\dictLearn -ID:\software\anaconda3\lib\site-packages\numpy\core\include -ID:\software\anaconda3\include -ID:\software\anaconda3\include -ID:\software\anaconda3\include -ID:\software\anaconda3\include -c spams_wrap.cpp -o build\temp.win-amd64-3.6\Release\spams_wrap.o -DNDEBUG -DUSE_BLAS_LIB -fPIC -fopenmp -Wunused-variable -m64" failed with exit status 1
D:\software\anaconda3\anzhuang_k\spams-2.6.1>
Installation failed

Why an unknown gcc is required to compile spaCy?

When installing spaCy under Ubuntu, but I got the following compile error.
The installation code is simply using pip install spacy.
/opt/rh/devtoolset-2/root/usr/bin/gcc -pthread -fPIC -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/mnt/nfs/lijin/local/opt/include/python2.7 -I/tmp/pip-install-ikyFEg/spacy/include -I/mnt/nfs/lijin/local/opt/include/python2.7 -c spacy/parts_of_speech.cpp -o build/temp.linux-x86_64-2.7/spacy/parts_of_speech.o -O2 -Wno-strict-prototypes -Wno-unused-function
unable to execute '/opt/rh/devtoolset-2/root/usr/bin/gcc': No such file or directory
error: command '/opt/rh/devtoolset-2/root/usr/bin/gcc' failed with exit status 1
My system has a /usr/bin/gcc but not in /opt/rh/xxx. Can anyone help fix this problem? Thank you.

PyOpt installation causes undefined reference to `__intrinsic_setjmpex'

I am trying to install the optimization library pyOpt on Windows 7 (64-bit - Python 3.6) following the instructions on PyOpt\Installing.
I have installed the required dependencies but I get the following error:
compiling C sources
C compiler: gcc -g -DDEBUG -DMS_WIN64 -O0 -Wall -Wstrict-prototypes
compile options: '-DNPY_MINGW_USE_CUSTOM_MSVCR -D__MSVCRT_VERSION__=0x1900 -Ibuild\src.win-amd64-3.6\build\src.win-amd64-3.6\pyALGENCAN\source\f2py -IC:\Users\gporzio\AppData\Local\Programs\Python\Python36\Lib\site-packages\numpy\core\include -IC:\Users\gporzio\AppData\Local\Programs\Python\Python36\include -IC:\Users\gporzio\AppData\Local\Programs\Python\Python36\include -c'
gcc -g -DDEBUG -DMS_WIN64 -O0 -Wall -Wstrict-prototypes -DNPY_MINGW_USE_CUSTOM_MSVCR -D__MSVCRT_VERSION__=0x1900 -Ibuild\src.win-amd64-3.6\build\src.win-amd64-3.6\pyALGENCAN\source\f2py -IC:\Users\gporzio\AppData\Local\Programs\Python\Python36\Lib\site-packages\numpy\core\include -IC:\Users\gporzio\AppData\Local\Programs\Python\Python36\include -IC:\Users\gporzio\AppData\Local\Programs\Python\Python36\include -c build\src.win-amd64-3.6\pyALGENCAN\source\f2py\algencanmodule.c -o build\temp.win-amd64-3.6\Release\build\src.win-amd64-3.6\pyalgencan\source\f2py\algencanmodule.o
gcc -g -DDEBUG -DMS_WIN64 -O0 -Wall -Wstrict-prototypes -DNPY_MINGW_USE_CUSTOM_MSVCR -D__MSVCRT_VERSION__=0x1900 -Ibuild\src.win-amd64-3.6\build\src.win-amd64-3.6\pyALGENCAN\source\f2py -IC:\Users\gporzio\AppData\Local\Programs\Python\Python36\Lib\site-packages\numpy\core\include -IC:\Users\gporzio\AppData\Local\Programs\Python\Python36\include -IC:\Users\gporzio\AppData\Local\Programs\Python\Python36\include -c build\src.win-amd64-3.6\build\src.win-amd64-3.6\pyALGENCAN\source\f2py\fortranobject.c -o build\temp.win-amd64-3.6\Release\build\src.win-amd64-3.6\build\src.win-amd64-3.6\pyalgencan\source\f2py\fortranobject.o
compiling Fortran sources
Fortran f77 compiler: C:\Program Files\mingw-w64\x86_64-7.3.0-win32-seh-rt_v5-rev0\mingw64\bin\gfortran.exe -Wall -g -ffixed-form -fno-second-underscore -O3 -funroll-loops
Fortran f90 compiler: C:\Program Files\mingw-w64\x86_64-7.3.0-win32-seh-rt_v5-rev0\mingw64\bin\gfortran.exe -Wall -g -fno-second-underscore -O3 -funroll-loops
Fortran fix compiler: C:\Program Files\mingw-w64\x86_64-7.3.0-win32-seh-rt_v5-rev0\mingw64\bin\gfortran.exe -Wall -g -ffixed-form -fno-second-underscore -Wall -g -fno-second-underscore -O3 -funroll-loops
compile options: '-Ibuild\src.win-amd64-3.6\build\src.win-amd64-3.6\pyALGENCAN\source\f2py -IC:\Users\gporzio\AppData\Local\Programs\Python\Python36\Lib\site-packages\numpy\core\include -IC:\Users\gporzio\AppData\Local\Programs\Python\Python36\include -IC:\Users\gporzio\AppData\Local\Programs\Python\Python36\include -c'
gfortran.exe:f77: build\src.win-amd64-3.6\pyALGENCAN\source\f2py\algencan-f2pywrappers.f
C:\Program Files\mingw-w64\x86_64-7.3.0-win32-seh-rt_v5-rev0\mingw64\bin\gfortran.exe -Wall -g -Wall -g -shared build\temp.win-amd64-3.6\Release\build\src.win-amd64-3.6\pyalgencan\source\f2py\algencanmodule.o build\temp.win-amd64-3.6\Release\build\src.win-amd64-3.6\build\src.win-amd64-3.6\pyalgencan\source\f2py\fortranobject.o build\temp.win-amd64-3.6\Release\build\src.win-amd64-3.6\pyALGENCAN\source\f2py\algencan-f2pywrappers.o -L"C:\Program Files\mingw-w64\x86_64-7.3.0-win32-seh-rt_v5-rev0\mingw64\lib\gcc\x86_64-w64-mingw32\7.3.0" -LC:\Users\gporzio\AppData\Local\Programs\Python\Python36\libs -LC:\Users\gporzio\AppData\Local\Programs\Python\Python36\PCbuild\amd64 -Lbuild\temp.win-amd64-3.6 -lalgencan -lpython36 -lgfortran -o build\lib.win-amd64-3.6\pyOpt\pyALGENCAN\algencan.cp36-win_amd6
4.pyd
build\temp.win-amd64-3.6\Release\build\src.win-amd64-3.6\pyalgencan\source\f2py\algencanmodule.o: In function `f2py_rout_algencan_algencan':
C:\Users\gporzio\Desktop\pyOpt-1.2.0\pyOpt/build/src.win-amd64-3.6/pyALGENCAN/source/f2py/algencanmodule.c:3397: undefined reference to `__intrinsic_setjmpex'
C:\Users\gporzio\Desktop\pyOpt-1.2.0\pyOpt/build/src.win-amd64-3.6/pyALGENCAN/source/f2py/algencanmodule.c:3397: undefined reference to `__intrinsic_setjmpex'
C:\Users\gporzio\Desktop\pyOpt-1.2.0\pyOpt/build/src.win-amd64-3.6/pyALGENCAN/source/f2py/algencanmodule.c:3397: undefined reference to `__intrinsic_setjmpex'
C:\Users\gporzio\Desktop\pyOpt-1.2.0\pyOpt/build/src.win-amd64-3.6/pyALGENCAN/source/f2py/algencanmodule.c:3397: undefined reference to `__intrinsic_setjmpex'
C:\Users\gporzio\Desktop\pyOpt-1.2.0\pyOpt/build/src.win-amd64-3.6/pyALGENCAN/source/f2py/algencanmodule.c:3397: undefined reference to `__intrinsic_setjmpex'
build\temp.win-amd64-3.6\Release\build\src.win-amd64-3.6\pyalgencan\source\f2py\algencanmodule.o:C:\Users\gporzio\Desktop\pyOpt-1.2.0\pyOpt/build/src.win-amd64-3.6/pyALGENCAN/source/f2py/algencanmodule.c:3397: more undefined references to `__intrinsic_setjmpex' follow
collect2.exe: error: ld returned 1 exit status
error: Command "C:\Program Files\mingw-w64\x86_64-7.3.0-win32-seh-rt_v5-rev0\mingw64\bin\gfortran.exe -Wall -g -Wall -g -shared build\temp.win-amd64-3.6\Release\build\src.win-amd64-3.6\pyalgencan\source\f2py\algencanmodule.o build\temp.win-amd64-3.6\Release\build\src.win-amd64-3.6\build\src.win-amd64-3.6\pyalgencan\source\f2py\fortranobject.o build\temp.win-amd64-3.6\Release\build\src.win-amd64-3.6\pyALGENCAN\source\f2py\algencan-f2pywrappers.o -L"C:\Program Files\mingw-w64\x86_64-7.3.0-win32-seh-rt_v5-rev0\mingw64\lib\gcc\x86_64-w64-mingw32\7.3.0" -LC:\Users\gporzio\AppData\Local\Programs\Python\Python36\libs -LC:\Users\gporzio\AppData\Local\Programs\Python\Python36\PCbuild\amd64 -Lbuild\temp.win-amd64-3.6 -lalgencan -lpython36 -lgfortran -o build\lib.win-amd64-3.6\pyOpt\pyALGENCAN\algenc
an.cp36-win_amd64.pyd" failed with exit status 1
I've tried both with python setup.py install and with python setup.py build --compiler=mingw32 but I always get the same error.
Could someone give me some suggestion?

aarch64-poky-linux-gcc: error: : No such file or directory

I am trying to include mlpack to my yocto build. Without enabling the python bindings my recipe bakes successfully.
But while building the python bindings I get the following error:
aarch64-poky-linux-gcc -march=armv8-a -mtune=cortex-a57.cortex-a53
--sysroot=/builds/build-h3/tmp/sysroots/h3ulcb -DNDEBUG -g -O3 -Wall
-Wstrict-prototypes -O2 -pipe -g -feliminate-unused-debug-types -fPIC
-I/builds/build-h3/tmp/sysroots/x86_64-linux/usr/lib/python2.7/site-packages/numpy/core/include
-I/builds/build-h3/tmp/work/aarch64-poky-linux/mlpack/git-r0/build/src/mlpack/bindings/python/
-I/builds/build-h3/tmp/work/aarch64-poky-linux/mlpack/git-r0/git/src
-I/builds/build-h3/tmp/sysroots/h3ulcb/usr/include
-I/builds/build-h3/tmp/sysroots/h3ulcb/usr/include
-I/builds/build-h3/tmp/work/aarch64-poky-linux/mlpack/git-r0/build/src/mlpack/..
-I/builds/build-h3/tmp/sysroots/h3ulcb/usr/include/python2.7 -c /builds/build-h3/tmp/work/aarch64-poky-linux/mlpack/git-r0/build/src/mlpack/bindings/python/mlpack/sparse_coding.cpp
-o build/temp.linux-x86_64-2.7/builds/build-h3/tmp/work/aarch64-poky-linux/mlpack/git-r0/build/src/mlpack/bindings/python/mlpack/sparse_coding.o
-DBINDING_TYPE=BINDING_TYPE_PYX -std=c++11 -march=armv8-a
-mtune=cortex-a57.cortex-a53
--sysroot=/builds/build-h3/tmp/sysroots/h3ulcb -O2 -pipe -g
-feliminate-unused-debug-types -fvisibility-inlines-hidden -Wall
-Wextra -ftemplate-depth=1000 -O3 -fopenmp aarch64-poky-linux-gcc: error: : No such file or directory aarch64-poky-linux-gcc: error: : No such file or directory error: command 'aarch64-poky-linux-gcc' failed with exit status 1 src/mlpack/methods/sparse_coding/CMakeFiles/build_pyx_sparse_coding.dir/build.make:60: recipe for target 'src/mlpack/methods/sparse_coding/CMakeFiles/build_pyx_sparse_coding' failed make[2]: *** [src/mlpack/methods/sparse_coding/CMakeFiles/build_pyx_sparse_coding] Error 1 make[2]: Leaving directory '/builds/build-h3/tmp/work/aarch64-poky-linux/mlpack/git-r0/build' CMakeFiles/Makefile2:6651: recipe for target 'src/mlpack/methods/sparse_coding/CMakeFiles/build_pyx_sparse_coding.dir/all' failed make[1]: *** [src/mlpack/methods/sparse_coding/CMakeFiles/build_pyx_sparse_coding.dir/all] Error 2 make[1]: *** Waiting for unfinished jobs.... /builds/build-h3/tmp/sysroots/x86_64-linux/usr/lib/python2.7/site-packages/setuptools-36.2.7-py2.7.egg/setuptools/dist.py:350: UserWarning: The version specified ('3.0.x') is an invalid version, this may not work as expected with newer versions of setuptools, pip, and PyPI. Please see PEP 440 for more details. running build_ext cythoning /builds/build-h3/tmp/work/aarch64-poky-linux/mlpack/git-r0/build/src/mlpack/bindings/python/mlpack/preprocess_split.pyx to /builds/build-h3/tmp/work/aarch64-poky-linux/mlpack/git-r0/build/src/mlpack/bindings/python/mlpack/preprocess_split.cpp building 'mlpack.preprocess_split' extension aarch64-poky-linux-gcc
-march=armv8-a -mtune=cortex-a57.cortex-a53
--sysroot=/builds/build-h3/tmp/sysroots/h3ulcb -DNDEBUG -g -O3 -Wall
-Wstrict-prototypes -O2 -pipe -g -feliminate-unused-debug-types -fPIC
-I/builds/build-h3/tmp/sysroots/x86_64-linux/usr/lib/python2.7/site-packages/numpy/core/include
-I/builds/build-h3/tmp/work/aarch64-poky-linux/mlpack/git-r0/build/src/mlpack/bindings/python/
-I/builds/build-h3/tmp/work/aarch64-poky-linux/mlpack/git-r0/git/src
-I/builds/build-h3/tmp/sysroots/h3ulcb/usr/include
-I/builds/build-h3/tmp/sysroots/h3ulcb/usr/include
-I/builds/build-h3/tmp/work/aarch64-poky-linux/mlpack/git-r0/build/src/mlpack/..
-I/builds/build-h3/tmp/sysroots/h3ulcb/usr/include/python2.7 -c /builds/build-h3/tmp/work/aarch64-poky-linux/mlpack/git-r0/build/src/mlpack/bindings/python/mlpack/preprocess_split.cpp
-o build/temp.linux-x86_64-2.7/builds/build-h3/tmp/work/aarch64-poky-linux/mlpack/git-r0/build/src/mlpack/bindings/python/mlpack/preprocess_split.o
-DBINDING_TYPE=BINDING_TYPE_PYX -std=c++11 -march=armv8-a
-mtune=cortex-a57.cortex-a53
--sysroot=/builds/build-h3/tmp/sysroots/h3ulcb -O2 -pipe -g
-feliminate-unused-debug-types -fvisibility-inlines-hidden -Wall
-Wextra -ftemplate-depth=1000 -O3 -fopenmp aarch64-poky-linux-gcc: error: : No such file or directory aarch64-poky-linux-gcc: error: : No such file or directory error: command 'aarch64-poky-linux-gcc' failed with exit status 1 src/mlpack/methods/preprocess/CMakeFiles/build_pyx_preprocess_split.dir/build.make:60: recipe for target 'src/mlpack/methods/preprocess/CMakeFiles/build_pyx_preprocess_split' failed make[2]: *** [src/mlpack/methods/preprocess/CMakeFiles/build_pyx_preprocess_split] Error 1 make[2]: Leaving directory '/builds/build-h3/tmp/work/aarch64-poky-linux/mlpack/git-r0/build' CMakeFiles/Makefile2:1387: recipe for target 'src/mlpack/methods/preprocess/CMakeFiles/build_pyx_preprocess_split.dir/all' failed make[1]: *** [src/mlpack/methods/preprocess/CMakeFiles/build_pyx_preprocess_split.dir/all] Error 2 [ 89%] Linking CXX executable ../../../../bin/generate_pyx_softmax_regression cd /builds/build-h3/tmp/work/aarch64-poky-linux/mlpack/git-r0/build/src/mlpack/methods/softmax_regression && /builds/build-h3/tmp/sysroots/x86_64-linux/usr/bin/cmake -E cmake_link_script CMakeFiles/generate_pyx_softmax_regression.dir/link.txt --verbose=1 /builds/build-h3/tmp/sysroots/x86_64-linux/usr/bin/aarch64-poky-linux/aarch64-poky-linux-g++
-march=armv8-a -mtune=cortex-a57.cortex-a53
--sysroot=/builds/build-h3/tmp/sysroots/h3ulcb -O2 -pipe -g
-feliminate-unused-debug-types -fvisibility-inlines-hidden -Wall
-Wextra -ftemplate-depth=1000 -O3 -fopenmp -O2 -pipe -g
-feliminate-unused-debug-types -O2 -pipe -g
-feliminate-unused-debug-types -fvisibility-inlines-hidden -DNDEBUG
-march=armv8-a -mtune=cortex-a57.cortex-a53
--sysroot=/builds/build-h3/tmp/sysroots/h3ulcb -O2 -pipe -g
-feliminate-unused-debug-types -fvisibility-inlines-hidden -Wl,-O1
-Wl,--hash-style=gnu -Wl,--as-needed -Wl,-O1 -Wl,--hash-style=gnu
-Wl,--as-needed CMakeFiles/generate_pyx_softmax_regression.dir/__/__/bindings/python/generate_pyx_softmax_regression.cpp.o CMakeFiles/generate_pyx_softmax_regression.dir/__/__/bindings/python/print_pyx.cpp.o
-o ../../../../bin/generate_pyx_softmax_regression -rdynamic ../../../../lib/libmlpack.so.2.0 -lrt -larmadillo
-lboost_program_options-mt -lboost_unit_test_framework
-lboost_serialization-mt cd /builds/build-h3/tmp/work/aarch64-poky-linux/mlpack/git-r0/build/src/mlpack/methods/softmax_regression && /builds/build-h3/tmp/sysroots/x86_64-linux/usr/bin/cmake
-DGENERATE_PYX_PROGRAM=/builds/build-h3/tmp/work/aarch64-poky-linux/mlpack/git-r0/build/bin/generate_pyx_softmax_regression
-DPYX_OUTPUT_FILE=/builds/build-h3/tmp/work/aarch64-poky-linux/mlpack/git-r0/build/src/mlpack/bindings/python/mlpack/softmax_regression.pyx
-P /builds/build-h3/tmp/work/aarch64-poky-linux/mlpack/git-r0/git/CMake/GeneratePYX.cmake /builds/build-h3/tmp/work/aarch64-poky-linux/mlpack/git-r0/build/bin/generate_pyx_softmax_regression: /builds/build-h3/tmp/work/aarch64-poky-linux/mlpack/git-r0/build/bin/generate_pyx_softmax_regression: cannot execute binary file make[2]: Leaving directory '/builds/build-h3/tmp/work/aarch64-poky-linux/mlpack/git-r0/build' [ 89%] Built target generate_pyx_softmax_regression [ 89%] Linking CXX executable ../../../../bin/generate_pyx_knn cd /builds/build-h3/tmp/work/aarch64-poky-linux/mlpack/git-r0/build/src/mlpack/methods/neighbor_search && /builds/build-h3/tmp/sysroots/x86_64-linux/usr/bin/cmake -E cmake_link_script CMakeFiles/generate_pyx_knn.dir/link.txt --verbose=1 /builds/build-h3/tmp/sysroots/x86_64-linux/usr/bin/aarch64-poky-linux/aarch64-poky-linux-g++
-march=armv8-a -mtune=cortex-a57.cortex-a53
--sysroot=/builds/build-h3/tmp/sysroots/h3ulcb -O2 -pipe -g
-feliminate-unused-debug-types -fvisibility-inlines-hidden -Wall
-Wextra -ftemplate-depth=1000 -O3 -fopenmp -O2 -pipe -g
-feliminate-unused-debug-types -O2 -pipe -g
-feliminate-unused-debug-types -fvisibility-inlines-hidden -DNDEBUG
-march=armv8-a -mtune=cortex-a57.cortex-a53
--sysroot=/builds/build-h3/tmp/sysroots/h3ulcb -O2 -pipe -g
-feliminate-unused-debug-types -fvisibility-inlines-hidden -Wl,-O1
-Wl,--hash-style=gnu -Wl,--as-needed -Wl,-O1 -Wl,--hash-style=gnu
-Wl,--as-needed CMakeFiles/generate_pyx_knn.dir/__/__/bindings/python/generate_pyx_knn.cpp.o CMakeFiles/generate_pyx_knn.dir/__/__/bindings/python/print_pyx.cpp.o
-o ../../../../bin/generate_pyx_knn -rdynamic ../../../../lib/libmlpack.so.2.0 -lrt -larmadillo
-lboost_program_options-mt -lboost_unit_test_framework
-lboost_serialization-mt cd /builds/build-h3/tmp/work/aarch64-poky-linux/mlpack/git-r0/build/src/mlpack/methods/neighbor_search && /builds/build-h3/tmp/sysroots/x86_64-linux/usr/bin/cmake
-DGENERATE_PYX_PROGRAM=/builds/build-h3/tmp/work/aarch64-poky-linux/mlpack/git-r0/build/bin/generate_pyx_knn
-DPYX_OUTPUT_FILE=/builds/build-h3/tmp/work/aarch64-poky-linux/mlpack/git-r0/build/src/mlpack/bindings/python/mlpack/knn.pyx
-P /builds/build-h3/tmp/work/aarch64-poky-linux/mlpack/git-r0/git/CMake/GeneratePYX.cmake /builds/build-h3/tmp/work/aarch64-poky-linux/mlpack/git-r0/build/bin/generate_pyx_knn: /builds/build-h3/tmp/work/aarch64-poky-linux/mlpack/git-r0/build/bin/generate_pyx_knn: cannot execute binary file make[2]: Leaving directory '/builds/build-h3/tmp/work/aarch64-poky-linux/mlpack/git-r0/build' [ 89%] Built target generate_pyx_knn [ 89%] Linking CXX executable ../../../../bin/generate_pyx_kfn cd /builds/build-h3/tmp/work/aarch64-poky-linux/mlpack/git-r0/build/src/mlpack/methods/neighbor_search && /builds/build-h3/tmp/sysroots/x86_64-linux/usr/bin/cmake -E cmake_link_script CMakeFiles/generate_pyx_kfn.dir/link.txt --verbose=1 /builds/build-h3/tmp/sysroots/x86_64-linux/usr/bin/aarch64-poky-linux/aarch64-poky-linux-g++
-march=armv8-a -mtune=cortex-a57.cortex-a53
--sysroot=/builds/build-h3/tmp/sysroots/h3ulcb -O2 -pipe -g
-feliminate-unused-debug-types -fvisibility-inlines-hidden -Wall
-Wextra -ftemplate-depth=1000 -O3 -fopenmp -O2 -pipe -g
-feliminate-unused-debug-types -O2 -pipe -g
-feliminate-unused-debug-types -fvisibility-inlines-hidden -DNDEBUG
-march=armv8-a -mtune=cortex-a57.cortex-a53
--sysroot=/builds/build-h3/tmp/sysroots/h3ulcb -O2 -pipe -g
-feliminate-unused-debug-types -fvisibility-inlines-hidden -Wl,-O1
-Wl,--hash-style=gnu -Wl,--as-needed -Wl,-O1 -Wl,--hash-style=gnu
-Wl,--as-needed CMakeFiles/generate_pyx_kfn.dir/__/__/bindings/python/generate_pyx_kfn.cpp.o CMakeFiles/generate_pyx_kfn.dir/__/__/bindings/python/print_pyx.cpp.o
-o ../../../../bin/generate_pyx_kfn -rdynamic ../../../../lib/libmlpack.so.2.0 -lrt -larmadillo
-lboost_program_options-mt -lboost_unit_test_framework
-lboost_serialization-mt cd /builds/build-h3/tmp/work/aarch64-poky-linux/mlpack/git-r0/build/src/mlpack/methods/neighbor_search && /builds/build-h3/tmp/sysroots/x86_64-linux/usr/bin/cmake
-DGENERATE_PYX_PROGRAM=/builds/build-h3/tmp/work/aarch64-poky-linux/mlpack/git-r0/build/bin/generate_pyx_kfn
-DPYX_OUTPUT_FILE=/builds/build-h3/tmp/work/aarch64-poky-linux/mlpack/git-r0/build/src/mlpack/bindings/python/mlpack/kfn.pyx
-P /builds/build-h3/tmp/work/aarch64-poky-linux/mlpack/git-r0/git/CMake/GeneratePYX.cmake /builds/build-h3/tmp/work/aarch64-poky-linux/mlpack/git-r0/build/bin/generate_pyx_kfn: /builds/build-h3/tmp/work/aarch64-poky-linux/mlpack/git-r0/build/bin/generate_pyx_kfn: cannot execute binary file make[2]: Leaving directory '/builds/build-h3/tmp/work/aarch64-poky-linux/mlpack/git-r0/build' [ 89%] Built target generate_pyx_kfn [ 89%] Linking CXX executable ../../../../bin/generate_pyx_krann cd /builds/build-h3/tmp/work/aarch64-poky-linux/mlpack/git-r0/build/src/mlpack/methods/rann && /builds/build-h3/tmp/sysroots/x86_64-linux/usr/bin/cmake -E cmake_link_script CMakeFiles/generate_pyx_krann.dir/link.txt
--verbose=1 /builds/build-h3/tmp/sysroots/x86_64-linux/usr/bin/aarch64-poky-linux/aarch64-poky-linux-g++
-march=armv8-a -mtune=cortex-a57.cortex-a53
--sysroot=/builds/build-h3/tmp/sysroots/h3ulcb -O2 -pipe -g
-feliminate-unused-debug-types -fvisibility-inlines-hidden -Wall
-Wextra -ftemplate-depth=1000 -O3 -fopenmp -O2 -pipe -g
-feliminate-unused-debug-types -O2 -pipe -g
-feliminate-unused-debug-types -fvisibility-inlines-hidden -DNDEBUG
-march=armv8-a -mtune=cortex-a57.cortex-a53
--sysroot=/builds/build-h3/tmp/sysroots/h3ulcb -O2 -pipe -g
-feliminate-unused-debug-types -fvisibility-inlines-hidden -Wl,-O1
-Wl,--hash-style=gnu -Wl,--as-needed -Wl,-O1 -Wl,--hash-style=gnu
-Wl,--as-needed CMakeFiles/generate_pyx_krann.dir/__/__/bindings/python/generate_pyx_krann.cpp.o CMakeFiles/generate_pyx_krann.dir/__/__/bindings/python/print_pyx.cpp.o
-o ../../../../bin/generate_pyx_krann -rdynamic ../../../../lib/libmlpack.so.2.0 -lrt -larmadillo
-lboost_program_options-mt -lboost_unit_test_framework
-lboost_serialization-mt cd /builds/build-h3/tmp/work/aarch64-poky-linux/mlpack/git-r0/build/src/mlpack/methods/rann && /builds/build-h3/tmp/sysroots/x86_64-linux/usr/bin/cmake
-DGENERATE_PYX_PROGRAM=/builds/build-h3/tmp/work/aarch64-poky-linux/mlpack/git-r0/build/bin/generate_pyx_krann
-DPYX_OUTPUT_FILE=/builds/build-h3/tmp/work/aarch64-poky-linux/mlpack/git-r0/build/src/mlpack/bindings/python/mlpack/krann.pyx
-P /builds/build-h3/tmp/work/aarch64-poky-linux/mlpack/git-r0/git/CMake/GeneratePYX.cmake /builds/build-h3/tmp/work/aarch64-poky-linux/mlpack/git-r0/build/bin/generate_pyx_krann: /builds/build-h3/tmp/work/aarch64-poky-linux/mlpack/git-r0/build/bin/generate_pyx_krann: cannot execute binary file make[2]: Leaving directory '/builds/build-h3/tmp/work/aarch64-poky-linux/mlpack/git-r0/build' [ 89%] Built target generate_pyx_krann make[1]: Leaving directory '/builds/build-h3/tmp/work/aarch64-poky-linux/mlpack/git-r0/build' Makefile:141: recipe for target 'all' failed make: *** [all] Error 2 ERROR: oe_runmake failed ERROR: Function failed: do_compile (log file is located at /builds/build-h3/tmp/work/aarch64-poky-linux/mlpack/git-r0/temp/log.do_compile.17361)
My recipe looks like this:
DEPENDS = "boost armadillo python-native python-setuptools-native
python-pandas-native python-numpy-native python-cython-native
python-pytest-runner-native doxygen-native"
LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=3cee6555b8c975c14d29687fe7e78038"
SRC_URI = "git://github.com/mlpack/mlpack.git;protocol=https \
"
SRCREV = "b8ee319818e6213da4b92cb69dab94b956795401"
S = "${WORKDIR}/git"
inherit cmake pythonnative
EXTRA_OECMAKE = "-DDEBUG:BOOL=OFF \
-DPROFILE:BOOL=OFF \
-DBUILD_TESTS:BOOL=OFF \
-DCMAKE_BUILD_TYPE:STRING=Release \
-DCMAKE_SKIP_INSTALL_RPATH:BOOL=YES \
-DCMAKE_SKIP_RPATH:BOOL=YES \
-DPY_PANDAS:PATH=${STAGING_LIBDIR_NATIVE}/python2.7/site-packages/pandas \
"
do_compile_prepend() {
export STAGING_LIBDIR="${STAGING_LIBDIR}"
export STAGING_INCDIR="${STAGING_INCDIR}"
}
Is there something else that needs to be included in my recipe?
Or is the build environment missing something?
Any pointers would really help.
mlpack builds the Python bindings in multiple steps:
build a generate_pyx_<name> program to generate the Cython .pyx file that will be compiled
run the generate_pyx_<name> program and save the output .pyx file
use Cython and setuptools to generate a .cpp file from the .pyx file then compile it
It's a bit of a roundabout process, but I believe what is happening here is that the generate_pyx_<name> programs are being compiled for the device instead of the host, and therefore can't be run to generate the .pyx files. There won't be a particularly easy way to fix this, unfortunately, because CMake will be compiling the generate_pyx_<name> target with the same options you are compiling the rest of the library with (which in your case targets the device).
In order to make this work, you'll need to modify src/mlpack/bindings/python/CMakeLists.txt, specifically the line
add_executable(generate_pyx_${name}
${CMAKE_BINARY_DIR}/src/mlpack/bindings/python/generate_pyx_${name}.cpp
${CMAKE_SOURCE_DIR}/src/mlpack/bindings/python/print_pyx.hpp
${CMAKE_SOURCE_DIR}/src/mlpack/bindings/python/print_pyx.cpp)
and related lines. In essence you will need to make sure that the CXXFLAGS like -march=armv8-a -mtune=cortex-a57.cortex-a53 do not get used for that particular target.
Run "ldd aarch64-poky-linux-gcc" first, check if all the libraries it linked with were existed in your machine, if not the system will tell you "No such file or directory".

Makefile:107: recipe for target '_shtns.so' failed

I am having a problem while trying to compile the shtns library with python support. I do:
./configure --prefix=$HOME/local --enable-python
make
and I get:
(...)
building '_shtns' extension
gcc -march=native -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-lMBuS3/python2.7-2.7.12=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/home/david/.local/lib/python2.7/site-packages/numpy/core/include -I/usr/include/python2.7 -c shtns_numpy_wrap.c -o build/temp.linux-x86_64-2.7/shtns_numpy_wrap.o -fopenmp
x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-lMBuS3/python2.7-2.7.12=. -fstack-protector-strong -Wformat -Werror=format-security -L/home/david/local/lib -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-lMBuS3/python2.7-2.7.12=. -fstack-protector-strong -Wformat -Werror=format-security build/temp.linux-x86_64-2.7/shtns_numpy_wrap.o sht_init.o sht_fly.o sht_omp.o -L/home/david/local/lib -lfftw3_omp -lfftw3 -lm -o build/lib.linux-x86_64-2.7/_shtns.so -L/home/david/local/lib
/usr/bin/ld: /home/david/local/lib/libfftw3.a(assert.o): relocation R_X86_64_PC32 against symbol `stdout##GLIBC_2.2.5' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
Makefile:107: recipe for target '_shtns.so' failed
make: *** [_shtns.so] Error 1
I think those are the relevant lines. It suggests to compile using the -fpic flag, but that is already in my CFLAGS environment variable, as you can see in the first gcc line. The problem is with the 'x86_64-linux-gnu-gcc' bit. Any suggestions?

Categories