PyOpt installation causes undefined reference to `__intrinsic_setjmpex' - python

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?

Related

Compiling C with Python3.10 and OpenSSL-1.1: undefined symbol "OPENSSL_sk_num"

The configure script for nginx/unit fails because it is not able compile python extension code shown below:
#include <Python.h>
int main() {
Py_Initialize();
return 0;
}
I am using python3.10 which is compiled with openssl-1.1.1.
The compilation gives several symbol not found error including "OPENSSL_sk_num". It seems the symbol is in libcrypto which I have linked in the compile command manually.
Do I need to compile Python again so as to statically link libcrypto and libssl in libpython.a? Below is the full compile command.
cc -pipe -fPIC -fvisibility=hidden -O -W -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -fstrict-aliasing -Wstrict-overflow=5 -Wmissing-prototypes -Werror -g -I/home/shared/Builds/Python-3.1
0.0/include/python3.10 -I/home/shared/Builds/Python-3.10.0/include/python3.10 -o build/autotest build/autotest.c -L/home/shared/Builds/Python-3.10.0/lib/python3.10/config-3.10 -L/home/shared/Buil
ds/Python-3.10.0/lib -lcrypto -lssl -lpython3.10 -lpthread -lutil -lm -lm
Luckily, found the fix. Following works -- not sure why
cc -pipe -fPIC -fvisibility=hidden -O -W -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -fstrict-aliasing -Wstrict-overflow=5 -Wmissing-prototypes -Werror -g -I/home/shared/Builds/Python-3.10.0/include/python3.10 -I/home/shared/Builds/Python-3.10.0/include/python3.10 -o build/autotest build/autotest.c -L/home/shared/Builds/Python-3.10.0/lib/ -lpython3.10 -lpthread -lutil -lm -L/usr/local/lib/eopenssl11 -lssl -lcrypto
-lpython3.10 has to precede before -lssl which precedes -lcrypto.

python3-protobuf yocto receipe, getting compiler error

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

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

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

How to set CFLAGS and LDFLAGS to compile pycrypto

I am trying to install the fabric library to an old machine. There are some legacy libraries in /usr/lib, such as libgmp.
(py27)[qrtt1#hcservice app]$ ls /usr/lib|grep gmp
libgmp.a
libgmp.so
libgmp.so.3
libgmp.so.3.3.3
libgmpxx.a
libgmpxx.so
libgmpxx.so.3
libgmpxx.so.3.0.5
I have compiled the libgmp 5.x in my $HOME/app, and then am trying to install pycrypto (it is the dependency of fab):
CFLGAS=-I/home/qrtt1/app/include LDFLGAS=-L/home/qrtt1/app/lib pip install pycrypto
I observed that none of my include or lib directories are in the in the compilation / linking options:
gcc -pthread -fno-strict-aliasing -fwrapv -Wall -Wstrict-prototypes -fPIC -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/usr/include/ -I/home/qrtt1/app/include/python2.7 -c src/_fastmath.c -o build/temp.linux-i686-2.7/src/_fastmath.o
gcc -pthread -shared build/temp.linux-i686-2.7/src/_fastmath.o -lgmp -o build/lib.linux-i686-2.7/Crypto/PublicKey/_fastmath.so
building 'Crypto.Hash._MD2' extension
gcc -pthread -fno-strict-aliasing -fwrapv -Wall -Wstrict-prototypes -fPIC -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/home/qrtt1/app/include/python2.7 -c src/MD2.c -o build/temp.linux-i686-2.7/src/MD2.o
gcc -pthread -shared build/temp.linux-i686-2.7/src/MD2.o -o build/lib.linux-i686-2.7/Crypto/Hash/_MD2.so
building 'Crypto.Hash._MD4' extension
gcc -pthread -fno-strict-aliasing -fwrapv -Wall -Wstrict-prototypes -fPIC -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/home/qrtt1/app/include/python2.7 -c src/MD4.c -o build/temp.linux-i686-2.7/src/MD4.o
gcc -pthread -shared build/temp.linux-i686-2.7/src/MD4.o -o build/lib.linux-i686-2.
How do I assign the CFLAGS and LDFLAGS correctly for building pycrypto ?
I try to download pycrypto-2.5 and install it:
(py27)[qrtt1#hcservice pycrypto-2.5]$ CFLGAS=-I/home/qrtt1/app/include LDFLGAS=-L/home/qrtt1/app/lib python setup.py install
No CFLAGS or LDFLAGS set up with it. May be the pycrypto-2.5 going wrong ?
Please check what you have typed :
CFLAGS=-I/home/qrtt1/app/include LDFLAGS=-L/home/qrtt1/app/lib pip install pycrypto
it should be CFLAGS

Categories