Error when running make build on remote machine - linux

So, I developed a python performance test to run some tests on an HSM. I am following directions to download PyKCS11, an important module I need on the remote machine. I have latest version of swig installed, and I'm trying to run a make build on the PyKCS11 folder I have downloaded in my directory on the machine. I'm getting an ungodly amount of errors when running the make build. An suggestions on what is happening with these errors?
make build
python setup.py build
running build
running build_py
running build_ext
building 'PyKCS11._LowLevel' extension
gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fe xceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU _SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexce ptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SO URCE -fPIC -fwrapv -fPIC -Isrc -I/usr/local/include -I/usr/include/python2.6 -c src/ck_attribute_smart.cpp -o build/temp.linux-x86_64-2.6/src/ck_attribute_smart .o
gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fe xceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU _SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexce ptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SO URCE -fPIC -fwrapv -fPIC -Isrc -I/usr/local/include -I/usr/include/python2.6 -c src/pkcs11lib.cpp -o build/temp.linux-x86_64-2.6/src/pkcs11lib.o
gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fe xceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU _SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexce ptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SO URCE -fPIC -fwrapv -fPIC -Isrc -I/usr/local/include -I/usr/include/python2.6 -c src/pykcs11string.cpp -o build/temp.linux-x86_64-2.6/src/pykcs11string.o
gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fe xceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU _SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexce ptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SO URCE -fPIC -fwrapv -fPIC -Isrc -I/usr/local/include -I/usr/include/python2.6 -c src/utility.cpp -o build/temp.linux-x86_64-2.6/src/utility.o
gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fe xceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU _SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexce ptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SO URCE -fPIC -fwrapv -fPIC -Isrc -I/usr/local/include -I/usr/include/python2.6 -c src/pykcs11_wrap.cpp -o build/temp.linux-x86_64-2.6/src/pykcs11_wrap.o
src/pykcs11_wrap.cpp:173:21: error: Python.h: No such file or directory
src/pykcs11_wrap.cpp:3050:4: error: #error "This python version requires swig to be run with the '-classic' option"
src/pykcs11_wrap.cpp:803: error: ‘PyObject’ was not declared in this scope
src/pykcs11_wrap.cpp:803: error: ‘str’ was not declared in this scope
src/pykcs11_wrap.cpp:804: error: expected ‘,’ or ‘;’ before ‘{’ token
src/pykcs11_wrap.cpp:827: error: expected initializer before ‘*’ token
src/pykcs11_wrap.cpp:853: error: expected initializer before ‘*’ token
src/pykcs11_wrap.cpp:903: error: expected initializer before ‘*’ token
src/pykcs11_wrap.cpp:918: error: ‘inquiry’ does not name a type
src/pykcs11_wrap.cpp:919: error: ‘intargfunc’ does not name a type
src/pykcs11_wrap.cpp:920: error: ‘intintargfunc’ does not name a type
src/pykcs11_wrap.cpp:921: error: ‘intobjargproc’ does not name a type
src/pykcs11_wrap.cpp:922: error: ‘intintobjargproc’ does not name a type
src/pykcs11_wrap.cpp:923: error: ‘getreadbufferproc’ does not name a type
src/pykcs11_wrap.cpp:924: error: ‘getwritebufferproc’ does not name a type
src/pykcs11_wrap.cpp:925: error: ‘getsegcountproc’ does not name a type
src/pykcs11_wrap.cpp:926: error: ‘getcharbufferproc’ does not name a type
src/pykcs11_wrap.cpp:927: error: ‘PyObject’ was not declared in this scope
src/pykcs11_wrap.cpp:927: error: ‘x’ was not declared in this scope
src/pykcs11_wrap.cpp:927: error: expected primary-expression before ‘void’
src/pykcs11_wrap.cpp:927: error: initializer expression list treated as compound expression
src/pykcs11_wrap.cpp:928: error: expected ‘,’ or ‘;’ before ‘{’ token
In file included from /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include /c++/4.4.7/stdexcept:38,
from src/pykcs11_wrap.cpp:3074:
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/exception:3 5: error: expected declaration before end of line
error: command 'gcc' failed with exit status 1
make: *** [build-stamp] Error 1
Sorry for the insanely long stack trace. Wasn't sure how to condense it so it was showing the right error messages for a possbile solution. Anyway, here's what i get when I run my python script in the remote machine.
I believe the problem to be with finding the correct compiler, but I'm not entirely sure.
Furthermore I tried to import PyKCS11 when invoking the interpreter to see a more simplified version of the error.
>>> import PyKCS11
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "PyKCS11/__init__.py", line 20, in <module>
import PyKCS11.LowLevel
File "PyKCS11/LowLevel.py", line 39, in <module>
LowLevel = swig_import_helper()
File "PyKCS11/LowLevel.py", line 31, in swig_import_helper
import _LowLevel
ImportError: No module named _LowLevel

Related

unable to install mpich for building lammps

I was following https://computationalmechanics.in/lammps-installation-for-parallel-run-in-linux/ steps to build lammps but was unable to install mpich properly and am unable to spot the mistake I am doing. Error generated at terminal mentioned below
(base) manoj#labpc:~/packages/openmpi/openmpi-4.0.7$ mpiexec --version
HYDRA build details:
Version: 3.3.2
Release Date: Tue Nov 12 21:23:16 CST 2019
CC: x86_64-conda_cos6-linux-gnu-cc -I/home/manoj/anaconda3/include -I/home/manoj/anaconda3/include -L/home/manoj/anaconda3/lib -Wl,-rpath,/home/manoj/anaconda3/lib
CXX: x86_64-conda_cos6-linux-gnu-c++ -I/home/manoj/anaconda3/include -I/home/manoj/anaconda3/include -L/home/manoj/anaconda3/lib -Wl,-rpath,/home/manoj/anaconda3/lib
F77: x86_64-conda_cos6-linux-gnu-gfortran -I/home/manoj/anaconda3/include -L/home/manoj/anaconda3/lib -Wl,-rpath,/home/manoj/anaconda3/lib
F90: x86_64-conda_cos6-linux-gnu-gfortran -I/home/manoj/anaconda3/include -L/home/manoj/anaconda3/lib -Wl,-rpath,/home/manoj/anaconda3/lib
Configure options: '--disable-option-checking' '--prefix=/home/manoj/anaconda3' '--disable-dependency-tracking' '--enable-cxx' '--enable-fortran' '--disable-wrapper-rpath' 'MPICHLIB_CFLAGS=-march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -I/home/manoj/anaconda3/include -fdebug-prefix-map=/tmp/build/80754af9/mpich-mpi_1575396103289/work=/usr/local/src/conda/mpich-3.3.2 -fdebug-prefix-map=/home/manoj/anaconda3=/usr/local/src/conda-prefix' 'MPICHLIB_CPPFLAGS=-DNDEBUG -D_FORTIFY_SOURCE=2 -O2 -I/home/manoj/anaconda3/include' 'MPICHLIB_CXXFLAGS=-fvisibility-inlines-hidden -std=c++17 -fmessage-length=0 -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -I/home/manoj/anaconda3/include -fdebug-prefix-map=/tmp/build/80754af9/mpich-mpi_1575396103289/work=/usr/local/src/conda/mpich-3.3.2 -fdebug-prefix-map=/home/manoj/anaconda3=/usr/local/src/conda-prefix' 'MPICHLIB_FFLAGS=-fopenmp -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -I/home/manoj/anaconda3/include -fdebug-prefix-map=/tmp/build/80754af9/mpich-mpi_1575396103289/work=/usr/local/src/conda/mpich-3.3.2 -fdebug-prefix-map=/home/manoj/anaconda3=/usr/local/src/conda-prefix' 'MPICHLIB_FCFLAGS=-fopenmp -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -I/home/manoj/anaconda3/include -fdebug-prefix-map=/tmp/build/80754af9/mpich-mpi_1575396103289/work=/usr/local/src/conda/mpich-3.3.2 -fdebug-prefix-map=/home/manoj/anaconda3=/usr/local/src/conda-prefix' 'CC=x86_64-conda_cos6-linux-gnu-cc' 'CFLAGS=-I/home/manoj/anaconda3/include -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -I/home/manoj/anaconda3/include -fdebug-prefix-map=/tmp/build/80754af9/mpich-mpi_1575396103289/work=/usr/local/src/conda/mpich-3.3.2 -fdebug-prefix-map=/home/manoj/anaconda3=/usr/local/src/conda-prefix -O2' 'LDFLAGS=-L/home/manoj/anaconda3/lib -Wl,-rpath,/home/manoj/anaconda3/lib' 'CPPFLAGS=-I/home/manoj/anaconda3/include -DNDEBUG -D_FORTIFY_SOURCE=2 -O2 -I/home/manoj/anaconda3/include -I/tmp/build/80754af9/mpich-mpi_1575396103289/work/src/mpl/include -I/tmp/build/80754af9/mpich-mpi_1575396103289/work/src/mpl/include -I/tmp/build/80754af9/mpich-mpi_1575396103289/work/src/openpa/src -I/tmp/build/80754af9/mpich-mpi_1575396103289/work/src/openpa/src -D_REENTRANT -I/tmp/build/80754af9/mpich-mpi_1575396103289/work/src/mpi/romio/include' 'CPP=/home/manoj/anaconda3/bin/x86_64-conda_cos6-linux-gnu-cpp' 'CXX=x86_64-conda_cos6-linux-gnu-c++' 'CXXFLAGS=-I/home/manoj/anaconda3/include -fvisibility-inlines-hidden -std=c++17 -fmessage-length=0 -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -I/home/manoj/anaconda3/include -fdebug-prefix-map=/tmp/build/80754af9/mpich-mpi_1575396103289/work=/usr/local/src/conda/mpich-3.3.2 -fdebug-prefix-map=/home/manoj/anaconda3=/usr/local/src/conda-prefix -O2' 'FC=x86_64-conda_cos6-linux-gnu-gfortran' 'FCFLAGS=-I/home/manoj/anaconda3/include -fopenmp -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -I/home/manoj/anaconda3/include -fdebug-prefix-map=/tmp/build/80754af9/mpich-mpi_1575396103289/work=/usr/local/src/conda/mpich-3.3.2 -fdebug-prefix-map=/home/manoj/anaconda3=/usr/local/src/conda-prefix -O2' 'FFLAGS=-I/home/manoj/anaconda3/include -fopenmp -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -I/home/manoj/anaconda3/include -fdebug-prefix-map=/tmp/build/80754af9/mpich-mpi_1575396103289/work=/usr/local/src/conda/mpich-3.3.2 -fdebug-prefix-map=/home/manoj/anaconda3=/usr/local/src/conda-prefix -O2' '--cache-file=/dev/null' '--srcdir=.' 'LIBS=' 'MPLLIBNAME=mpl'
Process Manager: pmi
Launchers available: ssh rsh fork slurm ll lsf sge manual persist
Topology libraries available: hwloc
Resource management kernels available: user slurm ll lsf sge pbs cobalt
Checkpointing libraries available:
Demux engines available: poll select
(base) manoj#labpc:~/packages/openmpi/openmpi-4.0.7$ mpiexec --version
[mpiexec#labpc] set_default_values (ui/mpich/utils.c:1570): no executable provided
[mpiexec#labpc] HYD_uii_mpx_get_parameters (ui/mpich/utils.c:1783): setting default values failed
[mpiexec#labpc] main (ui/mpich/mpiexec.c:148): error parsing parameters

Fail to install modules for python 3.9.6 on Raspberry Pi

I have a problem that when I try to install python 3 modules, using setup.py, I get this messsage
python3 /home/pi/Python-3.9.6/setup.py build
running build
running build_ext
INFO: Can't locate Tcl/Tk libs and/or headers
building '_struct' extension
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I. -I/usr/include/arm-linux-gnueabihf -I/usr/local/include -I/usr/local/include/python3.9 -c _struct.c -o build/temp.linux-armv7l-3.9/_struct.o
gcc: error: _struct.c: No such file or directory
gcc: fatal error: no input files
compilation terminated.
building 'array' extension
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I. -I/usr/include/arm-linux-gnueabihf -I/usr/local/include -I/usr/local/include/python3.9 -c arraymodule.c -o build/temp.linux-armv7l-3.9/arraymodule.o
gcc: error: arraymodule.c: No such file or directory
gcc: fatal error: no input files
compilation terminated.
building '_contextvars' extension
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I. -I/usr/include/arm-linux-gnueabihf -I/usr/local/include -I/usr/local/include/python3.9 -c _contextvarsmodule.c -o build/temp.linux-armv7l-3.9/_contextvarsmodule.o
gcc: error: _contextvarsmodule.c: No such file or directory
gcc: fatal error: no input files
compilation terminated.
building 'math' extension
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I. -I/usr/include/arm-linux-gnueabihf -I/usr/local/include -I/usr/local/include/python3.9 -c mathmodule.c -o build/temp.linux-armv7l-3.9/mathmodule.o -DPy_BUILD_CORE_MODULE
gcc: error: mathmodule.c: No such file or directory
gcc: fatal error: no input files
compilation terminated.
building 'cmath' extension
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I. -I/usr/include/arm-linux-gnueabihf -I/usr/local/include -I/usr/local/include/python3.9 -c cmathmodule.c -o build/temp.linux-armv7l-3.9/cmathmodule.o -DPy_BUILD_CORE_MODULE
gcc: error: cmathmodule.c: No such file or directory
gcc: fatal error: no input files
compilation terminated.
building '_datetime' extension
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I. -I/usr/include/arm-linux-gnueabihf -I/usr/local/include -I/usr/local/include/python3.9 -c _datetimemodule.c -o build/temp.linux-armv7l-3.9/_datetimemodule.o
gcc: error: _datetimemodule.c: No such file or directory
gcc: fatal error: no input files
compilation terminated.
building '_zoneinfo' extension
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I. -I/usr/include/arm-linux-gnueabihf -I/usr/local/include -I/usr/local/include/python3.9 -c _zoneinfo.c -o build/temp.linux-armv7l-3.9/_zoneinfo.o
gcc: error: _zoneinfo.c: No such file or directory
gcc: fatal error: no input files
compilation terminated.
building '_random' extension
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I. -I/usr/include/arm-linux-gnueabihf -I/usr/local/include -I/usr/local/include/python3.9 -c _randommodule.c -o build/temp.linux-armv7l-3.9/_randommodule.o -DPy_BUILD_CORE_MODULE
gcc: error: _randommodule.c: No such file or directory
gcc: fatal error: no input files
compilation terminated.
building '_bisect' extension
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I. -I/usr/include/arm-linux-gnueabihf -I/usr/local/include -I/usr/local/include/python3.9 -c _bisectmodule.c -o build/temp.linux-armv7l-3.9/_bisectmodule.o
gcc: error: _bisectmodule.c: No such file or directory
gcc: fatal error: no input files
compilation terminated.
building '_heapq' extension
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I. -I/usr/include/arm-linux-gnueabihf -I/usr/local/include -I/usr/local/include/python3.9 -c _heapqmodule.c -o build/temp.linux-armv7l-3.9/_heapqmodule.o
gcc: error: _heapqmodule.c: No such file or directory
gcc: fatal error: no input files
compilation terminated.
building '_pickle' extension
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I. -I/usr/include/arm-linux-gnueabihf -I/usr/local/include -I/usr/local/include/python3.9 -c _pickle.c -o build/temp.linux-armv7l-3.9/_pickle.o -DPy_BUILD_CORE_MODULE
gcc: error: _pickle.c: No such file or directory
gcc: fatal error: no input files
compilation terminated.
building '_json' extension
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I. -I/usr/include/arm-linux-gnueabihf -I/usr/local/include -I/usr/local/include/python3.9 -c _json.c -o build/temp.linux-armv7l-3.9/_json.o -DPy_BUILD_CORE_MODULE
gcc: error: _json.c: No such file or directory
gcc: fatal error: no input files
compilation terminated.
building '_lsprof' extension
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I. -I/usr/include/arm-linux-gnueabihf -I/usr/local/include -I/usr/local/include/python3.9 -c _lsprof.c -o build/temp.linux-armv7l-3.9/_lsprof.o
gcc: error: _lsprof.c: No such file or directory
gcc: fatal error: no input files
compilation terminated.
building 'unicodedata' extension
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I. -I/usr/include/arm-linux-gnueabihf -I/usr/local/include -I/usr/local/include/python3.9 -c unicodedata.c -o build/temp.linux-armv7l-3.9/unicodedata.o
gcc: error: unicodedata.c: No such file or directory
gcc: fatal error: no input files
compilation terminated.
building '_opcode' extension
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I. -I/usr/include/arm-linux-gnueabihf -I/usr/local/include -I/usr/local/include/python3.9 -c _opcode.c -o build/temp.linux-armv7l-3.9/_opcode.o
gcc: error: _opcode.c: No such file or directory
gcc: fatal error: no input files
compilation terminated.
building '_asyncio' extension
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I. -I/usr/include/arm-linux-gnueabihf -I/usr/local/include -I/usr/local/include/python3.9 -c _asynciomodule.c -o build/temp.linux-armv7l-3.9/_asynciomodule.o -DPy_BUILD_CORE_MODULE
gcc: error: _asynciomodule.c: No such file or directory
gcc: fatal error: no input files
compilation terminated.
building '_queue' extension
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I. -I/usr/include/arm-linux-gnueabihf -I/usr/local/include -I/usr/local/include/python3.9 -c _queuemodule.c -o build/temp.linux-armv7l-3.9/_queuemodule.o
gcc: error: _queuemodule.c: No such file or directory
gcc: fatal error: no input files
compilation terminated.
building '_statistics' extension
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I. -I/usr/include/arm-linux-gnueabihf -I/usr/local/include -I/usr/local/include/python3.9 -c _statisticsmodule.c -o build/temp.linux-armv7l-3.9/_statisticsmodule.o
gcc: error: _statisticsmodule.c: No such file or directory
gcc: fatal error: no input files
compilation terminated.
building 'fcntl' extension
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I. -I/usr/include/arm-linux-gnueabihf -I/usr/local/include -I/usr/local/include/python3.9 -c fcntlmodule.c -o build/temp.linux-armv7l-3.9/fcntlmodule.o
gcc: error: fcntlmodule.c: No such file or directory
gcc: fatal error: no input files
compilation terminated.
building 'grp' extension
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I. -I/usr/include/arm-linux-gnueabihf -I/usr/local/include -I/usr/local/include/python3.9 -c grpmodule.c -o build/temp.linux-armv7l-3.9/grpmodule.o
gcc: error: grpmodule.c: No such file or directory
gcc: fatal error: no input files
compilation terminated.
building 'spwd' extension
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I. -I/usr/include/arm-linux-gnueabihf -I/usr/local/include -I/usr/local/include/python3.9 -c spwdmodule.c -o build/temp.linux-armv7l-3.9/spwdmodule.o
gcc: error: spwdmodule.c: No such file or directory
gcc: fatal error: no input files
compilation terminated.
building 'select' extension
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I. -I/usr/include/arm-linux-gnueabihf -I/usr/local/include -I/usr/local/include/python3.9 -c selectmodule.c -o build/temp.linux-armv7l-3.9/selectmodule.o
gcc: error: selectmodule.c: No such file or directory
gcc: fatal error: no input files
compilation terminated.
building 'parser' extension
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I. -I/usr/include/arm-linux-gnueabihf -I/usr/local/include -I/usr/local/include/python3.9 -c parsermodule.c -o build/temp.linux-armv7l-3.9/parsermodule.o
gcc: error: parsermodule.c: No such file or directory
gcc: fatal error: no input files
compilation terminated.
building 'mmap' extension
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I. -I/usr/include/arm-linux-gnueabihf -I/usr/local/include -I/usr/local/include/python3.9 -c mmapmodule.c -o build/temp.linux-armv7l-3.9/mmapmodule.o
gcc: error: mmapmodule.c: No such file or directory
gcc: fatal error: no input files
compilation terminated.
building 'syslog' extension
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I. -I/usr/include/arm-linux-gnueabihf -I/usr/local/include -I/usr/local/include/python3.9 -c syslogmodule.c -o build/temp.linux-armv7l-3.9/syslogmodule.o
gcc: error: syslogmodule.c: No such file or directory
gcc: fatal error: no input files
compilation terminated.
building '_xxsubinterpreters' extension
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I. -I/usr/include/arm-linux-gnueabihf -I/usr/local/include -I/usr/local/include/python3.9 -c _xxsubinterpretersmodule.c -o build/temp.linux-armv7l-3.9/_xxsubinterpretersmodule.o
gcc: error: _xxsubinterpretersmodule.c: No such file or directory
gcc: fatal error: no input files
compilation terminated.
building 'audioop' extension
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I. -I/usr/include/arm-linux-gnueabihf -I/usr/local/include -I/usr/local/include/python3.9 -c audioop.c -o build/temp.linux-armv7l-3.9/audioop.o
gcc: error: audioop.c: No such file or directory
gcc: fatal error: no input files
compilation terminated.
building '_csv' extension
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I. -I/usr/include/arm-linux-gnueabihf -I/usr/local/include -I/usr/local/include/python3.9 -c _csv.c -o build/temp.linux-armv7l-3.9/_csv.o
gcc: error: _csv.c: No such file or directory
gcc: fatal error: no input files
compilation terminated.
building '_posixsubprocess' extension
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I. -I/usr/include/arm-linux-gnueabihf -I/usr/local/include -I/usr/local/include/python3.9 -c _posixsubprocess.c -o build/temp.linux-armv7l-3.9/_posixsubprocess.o
gcc: error: _posixsubprocess.c: No such file or directory
gcc: fatal error: no input files
compilation terminated.
building '_testcapi' extension
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I. -I/usr/include/arm-linux-gnueabihf -I/usr/local/include -I/usr/local/include/python3.9 -c _testcapimodule.c -o build/temp.linux-armv7l-3.9/_testcapimodule.o
gcc: error: _testcapimodule.c: No such file or directory
gcc: fatal error: no input files
compilation terminated.
building '_testinternalcapi' extension
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I. -I/usr/include/arm-linux-gnueabihf -I/usr/local/include -I/usr/local/include/python3.9 -c _testinternalcapi.c -o build/temp.linux-armv7l-3.9/_testinternalcapi.o -DPy_BUILD_CORE_MODULE
gcc: error: _testinternalcapi.c: No such file or directory
gcc: fatal error: no input files
compilation terminated.
building '_testbuffer' extension
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I. -I/usr/include/arm-linux-gnueabihf -I/usr/local/include -I/usr/local/include/python3.9 -c _testbuffer.c -o build/temp.linux-armv7l-3.9/_testbuffer.o
gcc: error: _testbuffer.c: No such file or directory
gcc: fatal error: no input files
compilation terminated.
building '_testimportmultiple' extension
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I. -I/usr/include/arm-linux-gnueabihf -I/usr/local/include -I/usr/local/include/python3.9 -c _testimportmultiple.c -o build/temp.linux-armv7l-3.9/_testimportmultiple.o
gcc: error: _testimportmultiple.c: No such file or directory
gcc: fatal error: no input files
compilation terminated.
building '_testmultiphase' extension
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I. -I/usr/include/arm-linux-gnueabihf -I/usr/local/include -I/usr/local/include/python3.9 -c _testmultiphase.c -o build/temp.linux-armv7l-3.9/_testmultiphase.o
gcc: error: _testmultiphase.c: No such file or directory
gcc: fatal error: no input files
compilation terminated.
building '_xxtestfuzz' extension
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I. -I/usr/include/arm-linux-gnueabihf -I/usr/local/include -I/usr/local/include/python3.9 -c _xxtestfuzz/_xxtestfuzz.c -o build/temp.linux-armv7l-3.9/_xxtestfuzz/_xxtestfuzz.o
gcc: error: _xxtestfuzz/_xxtestfuzz.c: No such file or directory
gcc: fatal error: no input files
compilation terminated.
building '_crypt' extension
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I. -I/usr/include/arm-linux-gnueabihf -I/usr/local/include -I/usr/local/include/python3.9 -c _cryptmodule.c -o build/temp.linux-armv7l-3.9/_cryptmodule.o
gcc: error: _cryptmodule.c: No such file or directory
gcc: fatal error: no input files
compilation terminated.
building '_socket' extension
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I. -I/usr/include/arm-linux-gnueabihf -I/usr/local/include -I/usr/local/include/python3.9 -c socketmodule.c -o build/temp.linux-armv7l-3.9/socketmodule.o
gcc: error: socketmodule.c: No such file or directory
gcc: fatal error: no input files
compilation terminated.
building '_sha256' extension
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I. -I/usr/include/arm-linux-gnueabihf -I/usr/local/include -I/usr/local/include/python3.9 -c sha256module.c -o build/temp.linux-armv7l-3.9/sha256module.o -DPy_BUILD_CORE_MODULE
gcc: error: sha256module.c: No such file or directory
gcc: fatal error: no input files
compilation terminated.
building '_sha512' extension
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I. -I/usr/include/arm-linux-gnueabihf -I/usr/local/include -I/usr/local/include/python3.9 -c sha512module.c -o build/temp.linux-armv7l-3.9/sha512module.o -DPy_BUILD_CORE_MODULE
gcc: error: sha512module.c: No such file or directory
gcc: fatal error: no input files
compilation terminated.
building '_md5' extension
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I. -I/usr/include/arm-linux-gnueabihf -I/usr/local/include -I/usr/local/include/python3.9 -c md5module.c -o build/temp.linux-armv7l-3.9/md5module.o
gcc: error: md5module.c: No such file or directory
gcc: fatal error: no input files
compilation terminated.
building '_sha1' extension
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I. -I/usr/include/arm-linux-gnueabihf -I/usr/local/include -I/usr/local/include/python3.9 -c sha1module.c -o build/temp.linux-armv7l-3.9/sha1module.o
gcc: error: sha1module.c: No such file or directory
gcc: fatal error: no input files
compilation terminated.
building '_blake2' extension
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I. -I/usr/include/arm-linux-gnueabihf -I/usr/local/include -I/usr/local/include/python3.9 -c _blake2/blake2b_impl.c -o build/temp.linux-armv7l-3.9/_blake2/blake2b_impl.o
gcc: error: _blake2/blake2b_impl.c: No such file or directory
gcc: fatal error: no input files
compilation terminated.
building '_sha3' extension
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I. -I/usr/include/arm-linux-gnueabihf -I/usr/local/include -I/usr/local/include/python3.9 -c _sha3/sha3module.c -o build/temp.linux-armv7l-3.9/_sha3/sha3module.o
gcc: error: _sha3/sha3module.c: No such file or directory
gcc: fatal error: no input files
compilation terminated.
building 'termios' extension
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I. -I/usr/include/arm-linux-gnueabihf -I/usr/local/include -I/usr/local/include/python3.9 -c termios.c -o build/temp.linux-armv7l-3.9/termios.o
gcc: error: termios.c: No such file or directory
gcc: fatal error: no input files
compilation terminated.
building 'resource' extension
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I. -I/usr/include/arm-linux-gnueabihf -I/usr/local/include -I/usr/local/include/python3.9 -c resource.c -o build/temp.linux-armv7l-3.9/resource.o
gcc: error: resource.c: No such file or directory
gcc: fatal error: no input files
compilation terminated.
building 'ossaudiodev' extension
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I. -I/usr/include/arm-linux-gnueabihf -I/usr/local/include -I/usr/local/include/python3.9 -c ossaudiodev.c -o build/temp.linux-armv7l-3.9/ossaudiodev.o
gcc: error: ossaudiodev.c: No such file or directory
gcc: fatal error: no input files
compilation terminated.
building 'nis' extension
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I. -I/usr/include/arm-linux-gnueabihf -I/usr/local/include -I/usr/local/include/python3.9 -c nismodule.c -o build/temp.linux-armv7l-3.9/nismodule.o
gcc: error: nismodule.c: No such file or directory
gcc: fatal error: no input files
compilation terminated.
building 'zlib' extension
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I. -I/usr/include/arm-linux-gnueabihf -I/usr/local/include -I/usr/local/include/python3.9 -c zlibmodule.c -o build/temp.linux-armv7l-3.9/zlibmodule.o
gcc: error: zlibmodule.c: No such file or directory
gcc: fatal error: no input files
compilation terminated.
building 'binascii' extension
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I. -I/usr/include/arm-linux-gnueabihf -I/usr/local/include -I/usr/local/include/python3.9 -c binascii.c -o build/temp.linux-armv7l-3.9/binascii.o -DUSE_ZLIB_CRC32
gcc: error: binascii.c: No such file or directory
gcc: fatal error: no input files
compilation terminated.
building 'pyexpat' extension
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DHAVE_EXPAT_CONFIG_H=1 -DXML_POOR_ENTROPY=1 -I/usr/local/lib/python3.9/config-3.9-arm-linux-gnueabihf/Modules/expat -I. -I/usr/include/arm-linux-gnueabihf -I/usr/local/include -I/usr/local/include/python3.9 -c expat/xmlparse.c -o build/temp.linux-armv7l-3.9/expat/xmlparse.o -Wno-unreachable-code
gcc: error: expat/xmlparse.c: No such file or directory
gcc: fatal error: no input files
compilation terminated.
building '_multibytecodec' extension
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I. -I/usr/include/arm-linux-gnueabihf -I/usr/local/include -I/usr/local/include/python3.9 -c cjkcodecs/multibytecodec.c -o build/temp.linux-armv7l-3.9/cjkcodecs/multibytecodec.o
gcc: error: cjkcodecs/multibytecodec.c: No such file or directory
gcc: fatal error: no input files
compilation terminated.
building '_codecs_kr' extension
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I. -I/usr/include/arm-linux-gnueabihf -I/usr/local/include -I/usr/local/include/python3.9 -c cjkcodecs/_codecs_kr.c -o build/temp.linux-armv7l-3.9/cjkcodecs/_codecs_kr.o
gcc: error: cjkcodecs/_codecs_kr.c: No such file or directory
gcc: fatal error: no input files
compilation terminated.
building '_codecs_jp' extension
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I. -I/usr/include/arm-linux-gnueabihf -I/usr/local/include -I/usr/local/include/python3.9 -c cjkcodecs/_codecs_jp.c -o build/temp.linux-armv7l-3.9/cjkcodecs/_codecs_jp.o
gcc: error: cjkcodecs/_codecs_jp.c: No such file or directory
gcc: fatal error: no input files
compilation terminated.
building '_codecs_cn' extension
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I. -I/usr/include/arm-linux-gnueabihf -I/usr/local/include -I/usr/local/include/python3.9 -c cjkcodecs/_codecs_cn.c -o build/temp.linux-armv7l-3.9/cjkcodecs/_codecs_cn.o
gcc: error: cjkcodecs/_codecs_cn.c: No such file or directory
gcc: fatal error: no input files
compilation terminated.
building '_codecs_tw' extension
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I. -I/usr/include/arm-linux-gnueabihf -I/usr/local/include -I/usr/local/include/python3.9 -c cjkcodecs/_codecs_tw.c -o build/temp.linux-armv7l-3.9/cjkcodecs/_codecs_tw.o
gcc: error: cjkcodecs/_codecs_tw.c: No such file or directory
gcc: fatal error: no input files
compilation terminated.
building '_codecs_hk' extension
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I. -I/usr/include/arm-linux-gnueabihf -I/usr/local/include -I/usr/local/include/python3.9 -c cjkcodecs/_codecs_hk.c -o build/temp.linux-armv7l-3.9/cjkcodecs/_codecs_hk.o
gcc: error: cjkcodecs/_codecs_hk.c: No such file or directory
gcc: fatal error: no input files
compilation terminated.
building '_codecs_iso2022' extension
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I. -I/usr/include/arm-linux-gnueabihf -I/usr/local/include -I/usr/local/include/python3.9 -c cjkcodecs/_codecs_iso2022.c -o build/temp.linux-armv7l-3.9/cjkcodecs/_codecs_iso2022.o
gcc: error: cjkcodecs/_codecs_iso2022.c: No such file or directory
gcc: fatal error: no input files
compilation terminated.
building '_decimal' extension
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DCONFIG_32=1 -DANSI=1 -I/usr/local/lib/python3.9/config-3.9-arm-linux-gnueabihf/Modules/_decimal/libmpdec -I. -I/usr/include/arm-linux-gnueabihf -I/usr/local/include -I/usr/local/include/python3.9 -c _decimal/_decimal.c -o build/temp.linux-armv7l-3.9/_decimal/_decimal.o
gcc: error: _decimal/_decimal.c: No such file or directory
gcc: fatal error: no input files
compilation terminated.
building '_ctypes_test' extension
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I. -I/usr/include/arm-linux-gnueabihf -I/usr/local/include -I/usr/local/include/python3.9 -c _ctypes/_ctypes_test.c -o build/temp.linux-armv7l-3.9/_ctypes/_ctypes_test.o
gcc: error: _ctypes/_ctypes_test.c: No such file or directory
gcc: fatal error: no input files
compilation terminated.
building '_posixshmem' extension
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -IModules/_multiprocessing -I. -I/usr/include/arm-linux-gnueabihf -I/usr/local/include -I/usr/local/include/python3.9 -c _multiprocessing/posixshmem.c -o build/temp.linux-armv7l-3.9/_multiprocessing/posixshmem.o
gcc: error: _multiprocessing/posixshmem.c: No such file or directory
gcc: fatal error: no input files
compilation terminated.
building '_multiprocessing' extension
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -IModules/_multiprocessing -I. -I/usr/include/arm-linux-gnueabihf -I/usr/local/include -I/usr/local/include/python3.9 -c _multiprocessing/multiprocessing.c -o build/temp.linux-armv7l-3.9/_multiprocessing/multiprocessing.o
gcc: error: _multiprocessing/multiprocessing.c: No such file or directory
gcc: fatal error: no input files
compilation terminated.
building '_uuid' extension
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/usr/include/uuid -I. -I/usr/include/arm-linux-gnueabihf -I/usr/local/include -I/usr/local/include/python3.9 -c _uuidmodule.c -o build/temp.linux-armv7l-3.9/_uuidmodule.o
gcc: error: _uuidmodule.c: No such file or directory
gcc: fatal error: no input files
compilation terminated.
building 'xxlimited' extension
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPy_LIMITED_API=0x03050000 -I. -I/usr/include/arm-linux-gnueabihf -I/usr/local/include -I/usr/local/include/python3.9 -c xxlimited.c -o build/temp.linux-armv7l-3.9/xxlimited.o
gcc: error: xxlimited.c: No such file or directory
gcc: fatal error: no input files
compilation terminated.
building '_ctypes' extension
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I. -I/usr/include/arm-linux-gnueabihf -I/usr/local/include -I/usr/local/include/python3.9 -c _ctypes/_ctypes.c -o build/temp.linux-armv7l-3.9/_ctypes/_ctypes.o -DPy_BUILD_CORE_MODULE
gcc: error: _ctypes/_ctypes.c: No such file or directory
gcc: fatal error: no input files
compilation terminated.
Python build finished successfully!
The necessary bits to build these optional modules were not found:
_bz2 _curses _curses_panel
_dbm _elementtree _gdbm
_hashlib _lzma _sqlite3
_ssl _tkinter readline
To find the necessary bits, look in setup.py in detect_modules() for the module's name.
The following modules found by detect_modules() in setup.py, have been
built by the Makefile instead, as configured by the Setup files:
_abc atexit pwd
time
Failed to build these modules:
_asyncio _bisect _blake2
_codecs_cn _codecs_hk _codecs_iso2022
_codecs_jp _codecs_kr _codecs_tw
_contextvars _crypt _csv
_ctypes _ctypes_test _datetime
_decimal _heapq _json
_lsprof _md5 _multibytecodec
_multiprocessing _opcode _pickle
_posixshmem _posixsubprocess _queue
_random _sha1 _sha256
_sha3 _sha512 _socket
_statistics _struct _testbuffer
_testcapi _testimportmultiple _testinternalcapi
_testmultiphase _uuid _xxsubinterpreters
_xxtestfuzz _zoneinfo array
audioop binascii cmath
fcntl grp math
mmap nis ossaudiodev
parser pyexpat resource
select spwd syslog
termios unicodedata xxlimited
zlib
Could not build the ssl module!
Python requires an OpenSSL 1.0.2 or 1.1 compatible libssl with X509_VERIFY_PARAM_set1_host().
LibreSSL 2.6.4 and earlier do not provide the necessary APIs, https://github.com/libressl-portable/portable/issues/381
running build_scripts
error: file '/usr/local/lib/python3.9/config-3.9-arm-linux-gnueabihf/Tools/scripts/pydoc3' does not exist.
As you can see, about 30 modules failed to load, can anyone tell me why? Thank you in advance.
I think this is the cause, in setup.py:
def build_extensions(self):
self.srcdir = sysconfig.get_config_var('srcdir')
self.srcdir = os.path.abspath(self.srcdir)
[SNIP]
# Fix up the autodetected modules, prefixing all the source files
# with Modules/.
moddirlist = [os.path.join(self.srcdir, 'Modules')]
It's picking the wrong source directory.
I replaced the second line of the function above with:
self.srcdir = os.path.dirname(os.path.abspath(__file__))

/usr/bin/ld: final link failed: Bad value while installing h5py

I'm trying to install on RHLE via pip3 h5py but I get through this problem
gcc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mcpu=power8 -mtune=power8 -D_GNU_SOURCE -fPIC -fwrapv -I/opt/rh/rh-python36/root/usr/include -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mcpu=power8 -mtune=power8 -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DH5_USE_16_API -I./h5py -I/tmp/pip-install-k08hsnjl/h5py/lzf -I/opt/local/include -I/usr/local/include -I/opt/rh/rh-python36/root/usr/lib64/python3.6/site-packages/numpy/core/include -I/opt/rh/rh-python36/root/usr/include/python3.6m -c /tmp/pip-install-k08hsnjl/h5py/h5py/defs.c -o build/temp.linux-ppc64le-3.6/tmp/pip-install-k08hsnjl/h5py/h5py/defs.o
In file included from /opt/rh/rh-python36/root/usr/include/numpy/ndarraytypes.h:1830:0,
from /opt/rh/rh-python36/root/usr/include/numpy/ndarrayobject.h:12,
from /opt/rh/rh-python36/root/usr/include/numpy/arrayobject.h:4,
from /tmp/pip-install-k08hsnjl/h5py/h5py/api_compat.h:26,
from /tmp/pip-install-k08hsnjl/h5py/h5py/defs.c:642:
/opt/rh/rh-python36/root/usr/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
#warning "Using deprecated NumPy API, disable it with " \
^
In file included from /opt/rh/rh-python36/root/usr/include/numpy/ndarrayobject.h:21:0,
from /opt/rh/rh-python36/root/usr/include/numpy/arrayobject.h:4,
from /tmp/pip-install-k08hsnjl/h5py/h5py/api_compat.h:26,
from /tmp/pip-install-k08hsnjl/h5py/h5py/defs.c:642:
/opt/rh/rh-python36/root/usr/include/numpy/__multiarray_api.h:1463:1: warning: ‘_import_array’ defined but not used [-Wunused-function]
_import_array(void)
^
gcc -pthread -shared -L/opt/rh/rh-python36/root/usr/lib64-Wl,-z,relro -Wl,-rpath,/opt/rh/rh-python36/root/usr/lib64 -Wl,--enable-new-dtags build/temp.linux-ppc64le-3.6/tmp/pip-install-k08hsnjl/h5py/h5py/defs.o -L/opt/local/lib -L/usr/local/lib -L/opt/rh/rh-python36/root/usr/lib64 -Wl,--enable-new-dtags,-R/opt/local/lib -Wl,--enable-new-dtags,-R/usr/local/lib -lhdf5 -lhdf5_hl -lpython3.6m -o build/lib.linux-ppc64le-3.6/h5py/defs.cpython-36m-ppc64le-linux-gnu.so
/usr/bin/ld: /usr/local/lib/libpython3.6m.a(Python-ast.o): nella funzione "obj2ast_keyword":
/home/axyonrl/Python-3.6.9/Python/Python-ast.c:7768:(.text.unlikely+0x608): call to `_Py_keyword' lacks nop, can't restore toc; recompile with -fPIC
/usr/bin/ld: /usr/local/lib/libpython3.6m.a(Python-ast.o): nella funzione "obj2ast_comprehension":
/home/axyonrl/Python-3.6.9/Python/Python-ast.c:7420:(.text.unlikely+0x9f4): call to `_Py_comprehension' lacks nop, can't restore toc; recompile with -fPIC
/usr/bin/ld: /usr/local/lib/libpython3.6m.a(Python-ast.o): nella funzione "obj2ast_alias":
/home/axyonrl/Python-3.6.9/Python/Python-ast.c:7803:(.text.unlikely+0xbec): call to `_Py_alias' lacks nop, can't restore toc; recompile with -fPIC
/usr/bin/ld: /usr/local/lib/libpython3.6m.a(Python-ast.o): nella funzione "obj2ast_withitem":
/home/axyonrl/Python-3.6.9/Python/Python-ast.c:7838:(.text.unlikely+0xdd4): call to `_Py_withitem' lacks nop, can't restore toc; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
error: command 'gcc' failed with exit status 1
I tried to do CFLAGS=--enable-shared pip3 install h5py and CFLAGS=-fPIC pip3 install h5py
but with no success. Can someone help me, please?

Cannot build rgdal package on amazon linux AMI

I am unable to build rgdal (see output in code chunk below) on my AWS server. I understand from the discussion here, and here that this has something to do with missing libraries for geos and gdal, but none of the solutions suggested appears to work. If I run sudo yum install libgdal1 libgdal1-dev libgeos libgeos-dev I get the following output:
Loaded plugins: priorities, update-motd, upgrade-helper amzn-main
| 2.1 kB 00:00:00 amzn-updates
| 2.5 kB 00:00:00 1045 packages excluded due to repository
priority protections No package libgdal1 available. No package
libgdal1-dev available. Package geos-3.4.2-1.4.amzn1.x86_64 already
installed and latest version No package libgeos-dev available. Nothing
to do
I have already enabled EPEL, but it does not solve the problem.
Unfortunately I'm not very experienced with Linux, and have no idea how to move forward...
R output after attempting to install rgdal:
> install.packages("rgdal", type="source")
Installing package into ‘/home/andrea/R/x86_64-redhat-linux-gnu-library’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/src/contrib/rgdal_1.3-2.tar.gz'
Content type 'application/x-gzip' length 1667049 bytes (1.6 MB)
==================================================
downloaded 1.6 MB
* installing *source* package ‘rgdal’ ...
** package ‘rgdal’ successfully unpacked and MD5 sums checked
configure: CC: gcc -m64 -std=gnu99
configure: CXX: g++ -m64
configure: rgdal: 1.3-2
checking for /usr/bin/svnversion... no
configure: svn revision: 755
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ -m64 accepts -g... yes
checking whether g++ -m64 supports C++11 features by default... no
checking whether g++ -m64 supports C++11 features with -std=gnu++11... yes
configure: C++11 support available
checking for gdal-config... /usr/local/bin/gdal-config
checking gdal-config usability... yes
configure: GDAL: 2.0.0
checking GDAL version >= 1.11.4... yes
checking gdal: linking with --libs only... yes
checking GDAL: /usr/local/share/gdal/pcs.csv readable... yes
checking proj_api.h presence and usability... yes
./configure: line 3395: test: =: unary operator expected
checking PROJ version >= 4.8.0... yes
checking projects.h presence and usability... yes
/tmp/ccV0TCuc.o: In function `main':
/tmp/Rtmp52ge38/R.INSTALL4e4e42b08a4a/rgdal/proj_conf_test2.c:14: undefined reference to `pj_get_default_ctx'
/tmp/Rtmp52ge38/R.INSTALL4e4e42b08a4a/rgdal/proj_conf_test2.c:20: undefined reference to `pj_ctx_fclose'
collect2: error: ld returned 1 exit status
./configure: line 3511: ./proj_conf_test2: No such file or directory
checking PROJ.4: epsg found and readable... yes
/tmp/cczdLgSd.o: In function `main':
/tmp/Rtmp52ge38/R.INSTALL4e4e42b08a4a/rgdal/proj_conf_test3.c:14: undefined reference to `pj_get_default_ctx'
/tmp/Rtmp52ge38/R.INSTALL4e4e42b08a4a/rgdal/proj_conf_test3.c:20: undefined reference to `pj_ctx_fclose'
collect2: error: ld returned 1 exit status
./configure: line 3570: ./proj_conf_test3: No such file or directory
checking PROJ.4: conus found and readable... yes
configure: Package CPP flags: -I/usr/local/include
configure: Package LIBS: -L/usr/local/lib -lgdal -lproj
configure: creating ./config.status
config.status: creating src/Makevars
** libs
g++ -m64 -std=gnu++11 -I/usr/include/R -DNDEBUG -I/usr/local/include -I"/home/andrea/R/x86_64-redhat-linux-gnu-library/sp/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c OGR_write.cpp -o OGR_write.o
g++ -m64 -std=gnu++11 -I/usr/include/R -DNDEBUG -I/usr/local/include -I"/home/andrea/R/x86_64-redhat-linux-gnu-library/sp/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c gdal-bindings.cpp -o gdal-bindings.o
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -I/usr/local/include -I"/home/andrea/R/x86_64-redhat-linux-gnu-library/sp/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c init.c -o init.o
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -I/usr/local/include -I"/home/andrea/R/x86_64-redhat-linux-gnu-library/sp/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c inverser.c -o inverser.o
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -I/usr/local/include -I"/home/andrea/R/x86_64-redhat-linux-gnu-library/sp/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c local_stubs.c -o local_stubs.o
g++ -m64 -std=gnu++11 -I/usr/include/R -DNDEBUG -I/usr/local/include -I"/home/andrea/R/x86_64-redhat-linux-gnu-library/sp/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c ogr_geom.cpp -o ogr_geom.o
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -I/usr/local/include -I"/home/andrea/R/x86_64-redhat-linux-gnu-library/sp/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c ogr_polygons.c -o ogr_polygons.o
g++ -m64 -std=gnu++11 -I/usr/include/R -DNDEBUG -I/usr/local/include -I"/home/andrea/R/x86_64-redhat-linux-gnu-library/sp/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c ogr_proj.cpp -o ogr_proj.o
g++ -m64 -std=gnu++11 -I/usr/include/R -DNDEBUG -I/usr/local/include -I"/home/andrea/R/x86_64-redhat-linux-gnu-library/sp/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c ogrdrivers.cpp -o ogrdrivers.o
g++ -m64 -std=gnu++11 -I/usr/include/R -DNDEBUG -I/usr/local/include -I"/home/andrea/R/x86_64-redhat-linux-gnu-library/sp/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c ogrsource.cpp -o ogrsource.o
g++ -m64 -std=gnu++11 -I/usr/include/R -DNDEBUG -I/usr/local/include -I"/home/andrea/R/x86_64-redhat-linux-gnu-library/sp/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c projectit.cpp -o projectit.o
g++ -m64 -std=gnu++11 -shared -L/usr/lib64/R/lib -L/usr/local/lib64 -o rgdal.so OGR_write.o gdal-bindings.o init.o inverser.o local_stubs.o ogr_geom.o ogr_polygons.o ogr_proj.o ogrdrivers.o ogrsource.o projectit.o -L/usr/local/lib -lgdal -lproj -L/usr/lib64/R/lib -lR
installing to /home/andrea/R/x86_64-redhat-linux-gnu-library/rgdal/libs
** R
** data
** inst
** preparing package for lazy loading
** help
*** installing help indices
converting help for package ‘rgdal’
finding HTML links ... done
CRS-class html
GDALDataset-class html
GDALDriver-class html
GDALMajorObject-class html
GDALRasterBand-class html
GDALReadOnlyDataset-class html
GDALReadOnlyDataset-methods html
GDALTransientDataset-class html
GridsDatums html
RGB2PCT html
SGDF2PCT html
SpatialGDAL-class html
closeDataset-methods html
displayDataset html
llgrid html
Rd warning: /tmp/Rtmp52ge38/R.INSTALL4e4e42b08a4a/rgdal/man/llgrid.Rd:11: missing file link ‘Spatial’
Rd warning: /tmp/Rtmp52ge38/R.INSTALL4e4e42b08a4a/rgdal/man/llgrid.Rd:16: missing file link ‘gridat’
Rd warning: /tmp/Rtmp52ge38/R.INSTALL4e4e42b08a4a/rgdal/man/llgrid.Rd:17: missing file link ‘gridat’
make_EPSG html
nor2k html
projInfo html
project html
readGDAL html
Rd warning: /tmp/Rtmp52ge38/R.INSTALL4e4e42b08a4a/rgdal/man/readGDAL.Rd:136: missing file link ‘flipVertical’
readOGR html
showWKT html
spTransform-methods html
wrappers html
writeOGR html
** building package indices
** installing vignettes
** testing if installed package can be loaded
Error: package or namespace load failed for ‘rgdal’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/home/andrea/R/x86_64-redhat-linux-gnu-library/rgdal/libs/rgdal.so':
libgdal.so.20: cannot open shared object file: No such file or directory
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/home/andrea/R/x86_64-redhat-linux-gnu-library/rgdal’
Warning in install.packages :
installation of package ‘rgdal’ had non-zero exit status
The downloaded source packages are in
‘/tmp/RtmpnAqQL2/downloaded_packages’
The issue is that, while GDAL is correctly built, rgdal cannot find its libraries. This is because the AWS ec2 AMI does not include /usr/local/lib in the default search path for libraries. The solution is provided in an answer to this question.
In brief:
edit /etc/ld.so.conf using sudo vi /etc/ld.so.conf to make it contain: include /etc/ld.so.conf.d/*.conf.
Edit / create a file /etc/ld.so.conf.d/libc.conf so that it contains: /usr/local/lib
Run sudo ldconfig to save changes
This makes the libraries searchable when building rgdal.
Upgrade gcc version to 5.x.x, and then run the followings (depending on the gcc version, you may have a different file of libstdc++.so.6.0.25):
cp /usr/local/lib64/libstdc++.so.6.0.25 /lib64
cd /lib64
rm -rf libstdc++.so.6
ln -s libstdc++.so.6.0.25 libstdc++.so.6

How to override python's distutils gcc linker with icc?

I was able to successfully build cython on Ubuntu 14.04 from source as explained in this SE question/answer Compiling cython From source with icc and I downloaded the source code from here - Cython source code download.
The command to compile cython is
CC=icc LINKCC=icc python3.4 setup.py build
I am enclosing the build log. It is STILL using gcc for linking. Here is a sample of build log.
It appears CC=icc LINKCC=icc does NOT seem to change the linker to icc. It is still using x86_64-linux-gnu-gcc. When I set the environmental variable LDFLAGS = -lirc the environmental variable is being passed to gcc and not to icc.
Also when I put print statements in BuildExecutable.py they are not getting called.
icc -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.4m -c /home/aswin/libPython/Cython-0.24/Cython/Plex/Scanners.c -o build/temp.linux-x86_64-3.4/home/aswin/libPython/Cython-0.24/Cython/Plex/Scanners.o
icc: command line warning #10006: ignoring unknown option '-fwrapv'
creating build/lib.linux-x86_64-3.4
creating build/lib.linux-x86_64-3.4/Cython
creating build/lib.linux-x86_64-3.4/Cython/Plex
x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -lirc -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.4/home/aswin/libPython/Cython-0.24/Cython/Plex/Scanners.o -o build/lib.linux-x86_64-3.4/Cython/Plex/Scanners.cpython-34m.so
How do I fix it ?
You need to override the linker
by setting export LDSHARED="icc -shared". That generates the icc linker. Here is an example of the build log by typing
CC=icc python3.4 setup.py build_ext
Alternatively you can also do the same by typing
LDSHARED="icc -shared" CC=icc python3.4 setup.py build_ex
icc -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.4m -c /home/a/libPython/Cython-0.24/Cython/Plex/Scanners.c -o build/temp.linux-x86_64-3.4/home/a/libPython/Cython-0.24/Cython/Plex/Scanners.o
icc: command line warning #10006: ignoring unknown option '-fwrapv'
creating build/lib.linux-x86_64-3.4
creating build/lib.linux-x86_64-3.4/Cython
creating build/lib.linux-x86_64-3.4/Cython/Plex
icc -shared -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.4/home/a/libPython/Cython-0.24/Cython/Plex/Scanners.o -o build/lib.linux-x86_64-3.4/Cython/Plex/Scanners.cpython-34m.so
cythoning /home/a/libPython/Cython-0.24/Cython/Plex/Actions.py to /home/a/libPython/Cython-0.24/Cython/Plex/Actions.c
You could try to add -static-intel to link options so that all Intel specific functions will be static-linked.

Resources