why this happen in centos 6 ?
Python 3.6.6 CentOs 6.10
python3.6 -m pip install coincurve
Collecting coincurve
Using cached coincurve-15.0.0.tar.gz (219 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Installing backend dependencies ... done
Preparing wheel metadata ... done
Requirement already satisfied: cffi>=1.3.0 in /usr/local/lib/python3.6/site-packages (from coincurve) (1.3.0)
Requirement already satisfied: asn1crypto in /usr/local/lib/python3.6/site-packages (from coincurve) (1.4.0)
Requirement already satisfied: pycparser in /usr/local/lib/python3.6/site-packages (from cffi>=1.3.0->coincurve) (2.20)
Building wheels for collected packages: coincurve
Building wheel for coincurve (PEP 517) ... error
ERROR: Command errored out with exit status 1:
command: /usr/local/bin/python3.6 /usr/local/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py build_wheel /tmp/tmpgf834dif
cwd: /tmp/pip-install-2fm8b76q/coincurve_acc7c657b22b41cbb1caa277cfd64a45
Complete output (66 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.6
creating build/lib.linux-x86_64-3.6/coincurve
copying coincurve/utils.py -> build/lib.linux-x86_64-3.6/coincurve
copying coincurve/flags.py -> build/lib.linux-x86_64-3.6/coincurve
copying coincurve/_windows_libsecp256k1.py -> build/lib.linux-x86_64-3.6/coincurve
copying coincurve/types.py -> build/lib.linux-x86_64-3.6/coincurve
copying coincurve/context.py -> build/lib.linux-x86_64-3.6/coincurve
copying coincurve/keys.py -> build/lib.linux-x86_64-3.6/coincurve
copying coincurve/init.py -> build/lib.linux-x86_64-3.6/coincurve
copying coincurve/ecdsa.py -> build/lib.linux-x86_64-3.6/coincurve
copying coincurve/py.typed -> build/lib.linux-x86_64-3.6/coincurve
running build_clib
configure.ac:407: error: AC_PROG_CC cannot be called after AM_PROG_CC_C_O
build-aux/m4/ax_prog_cc_for_build.m4:38: AX_PROG_CC_FOR_BUILD is expanded from...
configure.ac:407: the top level
autom4te: /usr/bin/m4 failed with exit status: 1
aclocal: autom4te failed with exit status: 1
autoreconf: aclocal failed with exit status: 1
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py", line 280, in
Facing same issue on Centos 7, looking into it, there appears to be a failure related to autogen.sh in the temporary dir that pip sets up.
You probably will face same error output of:
/var/volatile/tmp/test/libsecp256k1# ./autogen.sh configure.ac:407: error: AC_PROG_CC cannot be called after AM_PROG_CC_C_O build-aux/m4/ax_prog_cc_for_build.m4:38: AX_PROG_CC_FOR_BUILD is expanded from... configure.ac:407: the top level autom4te: /usr/bin/env failed with exit status: 1 aclocal: /usr/bin/autom4te failed with exit status: 1 autoreconf: aclocal failed with exit status: 1
Hmm, any idea why?
Not sure, but I was able to run the build script from https://github.com/spesmilo/electrum just now and successfully built libsecp256k1.so.0
The script that was able to produce a working build is in contrib/make_libsecp256k1.sh in the https://github.com/spesmilo/electrum repo. The files built, but I'm having to move them by hand. No idea if this will fix the issue, but I'm going to try and install coincurve against those.
When I attempt to build coincurve with python3 setup.py build which calls: autogen.sh
Output here:
running build_clib downloading libsecp256k1 source code configure.ac:407: error: AC_PROG_CC cannot be called after AM_PROG_CC_C_O build-aux/m4/ax_prog_cc_for_build.m4:38: AX_PROG_CC_FOR_BUILD is expanded from... configure.ac:407: the top level autom4te: /usr/bin/env failed with exit status: 1 aclocal: /usr/bin/autom4te failed with exit status: 1 autoreconf: aclocal failed with exit status: 1 Traceback (most recent call last): File "/micNfs/tools/tmp/coincurve/setup.py", line 260, in <module> setup( File "/usr/lib/python3.9/site-packages/setuptools/__init__.py", line 153, in setup return distutils.core.setup(**attrs) File "/usr/lib/python3.9/distutils/core.py", line 148, in setup dist.run_commands() File "/usr/lib/python3.9/distutils/dist.py", line 966, in run_commands self.run_command(cmd) File "/usr/lib/python3.9/distutils/dist.py", line 985, in run_command cmd_obj.run() File "/usr/lib/python3.9/distutils/command/build.py", line 135, in run self.run_command(cmd_name) File "/usr/lib/python3.9/distutils/cmd.py", line 313, in run_command self.distribution.run_command(command) File "/usr/lib/python3.9/distutils/dist.py", line 985, in run_command cmd_obj.run() File "/micNfs/tools/tmp/coincurve/setup.py", line 152, in run subprocess.check_call([autogen], cwd=absolute('libsecp256k1')) File "/usr/lib/python3.9/subprocess.py", line 373, in check_call raise CalledProcessError(retcode, cmd)
I've set the ENV variables as follows:
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/micNfs/tools/tmp/electrum/contrib/secp256k1/dist/lib" export LIBDIR="$LIBDIR:/micNfs/tools/tmp/electrum/contrib/secp256k1/dist/lib" echo /micNfs/tools/tmp/electrum/contrib/secp256k1/dist/lib >> /etc/ld.so.conf
(Building on an Intel Xeon Phi 5110p)
Manually copied to:
./include/secp256k1.h ./include/secp256k1_preallocated.h ./include/secp256k1_ecdh.h ./include/secp256k1_recovery.h ./include/secp256k1_generator.h ./include/secp256k1_rangeproof.h ./include/secp256k1_whitelist.h ./include/secp256k1_surjectionproof.h ./include/secp256k1_ecdsa_s2c.h ./lib/pkgconfig/libsecp256k1.pc ./lib/libsecp256k1.la ./lib/libsecp256k1.a
Now executing python3 setup.py build in the coincurve dir, that failed.
I manually copied the built libsecp256k1 dir from electrum to the copy of the pip created coincurve dir, and the dir from the latest branch of this repo, commented out the portion of setup.py where the installer downloads the source and builds libsecp256k1 ... So far the installer stated that the contents of libsecp256k1 were already created and would need to be made distclean ... I ran that and still get the same error as before, but this time perhaps a bit better info?
python3 setup.py build running build running build_py running build_clib checking build system type... k1om-unknown-linux-gnu checking host system type... k1om-unknown-linux-gnu checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... /bin/mkdir -p checking for gawk... gawk checking whether make sets $(MAKE)... yes checking how to print strings... printf checking for style of include used by make... GNU checking for gcc... gcc checking whether the C compiler works... no configure: error: in/var/volatile/tmp/test2/build/temp.linux-k1om-3.9':
configure: error: C compiler cannot create executables
See config.log' for more details Traceback (most recent call last): File "/var/volatile/tmp/test2/setup.py", line 260, in <module> setup( File "/usr/lib/python3.9/site-packages/setuptools/__init__.py", line 153, in setup return distutils.core.setup(**attrs) File "/usr/lib/python3.9/distutils/core.py", line 148, in setup dist.run_commands() File "/usr/lib/python3.9/distutils/dist.py", line 966, in run_commands self.run_command(cmd) File "/usr/lib/python3.9/distutils/dist.py", line 985, in run_command cmd_obj.run() File "/usr/lib/python3.9/distutils/command/build.py", line 135, in run self.run_command(cmd_name) File "/usr/lib/python3.9/distutils/cmd.py", line 313, in run_command self.distribution.run_command(command) File "/usr/lib/python3.9/distutils/dist.py", line 985, in run_command cmd_obj.run() File "/var/volatile/tmp/test2/setup.py", line 191, in run subprocess.check_call(cmd, cwd=build_temp) File "/usr/lib/python3.9/subprocess.py", line 373, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['/var/volatile/tmp/test2/libsecp256k1/configure', '--disable-shared', '--enable-static', '--disable-dependency-tracking', '--with-pic', '--enable-module-recovery', '--prefix', '/var/volatile/tmp/test2/build/temp.linux-k1om-3.9', '--enable-experimental', '--enable-module-ecdh', '--enable-benchmark=no', '--enable-tests=no', '--enable-openssl-tests=no', '--enable-exhaustive-tests=no']' returned non-zero exit status 77.
So something is triggering the working gcc compiler to fail, but this works fine with electrums contrib libsecp256k1.
I'm surprised there isn't something checking to see if the libsecp256k1 libraries are installed already, instead of just building it.
Hmm, any idea why?
Interesting ... If you could do the same on your Centos 6 system - and preserve the files that get generated by python3.6 -m pip install coincurve you might be able to get some additional details from the autogen.sh output that gets run.
I saved my cached copy, there may be a flag for that...
pip --verbose install coincurve also might provide more info to what is failing.
from verbose output - the location pip attempts the install will be after the --prefix flag:
--prefix /var/volatile/tmp/pip-build-env-skxkqr4l/overlay on my most recent failure. 😆
Here are the flags from the "working" libsecp256k1 compile:
./configure --prefix=/micNfs/tools/tmp/electrum/contrib/secp256k1/dist --enable-module-recovery --enable-experimental --enable-module-ecdh --disable-benchmark --disable-tests --disable-exhaustive-tests --disable-static --enable-shared
the flags in coincurve from pip are:
cmd = [ absolute('libsecp256k1/configure'), '--disable-shared', '--enable-static', '--disable-dependency-tracking', '--with-pic', '--enable-module-recovery', '--prefix', os.path.abspath(self.build_clib), '--enable-experimental', '--enable-module-ecdh', '--enable-benchmark=no', '--enable-tests=no', '--enable-openssl-tests=no', '--enable-exhaustive-tests=no',
After hacking on it for some time, I have no idea if it's going to be stable, but I was able to build a weird version for my cpu on Centos 7:
`
root@heater-mic0:/var/volatile/tmp/test3# export CFLAGS="-m64"
root@heater-mic0:/var/volatile/tmp/test3# python setup.py
Traceback (most recent call last):
File "setup.py", line 15, in
Build Options: with endomorphism = no with ecmult precomp = yes with external callbacks = no with benchmarks = no with coverage = no module ecdh = yes module recovery = yes
asm = x86_64 bignum = gmp field = 64bit scalar = 64bit ecmult window size = 15 ecmult gen prec. bits = 4
valgrind = no CC = k1om-mpss-linux-gcc CFLAGS = -O2 -fvisibility=hidden -std=c89 -pedantic -Wall -Wextra -Wcast-align -Wnested-externs -Wshadow -Wstrict-prototypes -Wno-unused-function -Wno-long-long -Wno-overlength-strings -W -m64 CPPFLAGS = LDFLAGS =
(CDPATH="${ZSH_VERSION+.}:" && cd /var/volatile/tmp/test3/libsecp256k1 && /bin/sh /var/volatile/tmp/test3/libsecp256k1/build-aux/missing --run autoheader) rm -f src/stamp-h1 touch /var/volatile/tmp/test3/libsecp256k1/src/libsecp256k1-config.h.in cd . && /bin/sh ./config.status src/libsecp256k1-config.h config.status: creating src/libsecp256k1-config.h config.status: src/libsecp256k1-config.h is unchanged /usr/bin/gcc -I/var/volatile/tmp/test3/libsecp256k1 -I./src -Wall -Wextra -Wno-unused-function -g -O2 -c /var/volatile/tmp/test3/libsecp256k1/src/gen_context.c -o gen_context.o /usr/bin/gcc -Wall -Wextra -Wno-unused-function -g -O2 gen_context.o -o gen_context ./gen_context CC src/libsecp256k1_la-secp256k1.lo CCLD libsecp256k1.la make[1]: Entering directory `/var/volatile/tmp/test3/build/temp.linux-k1om-3.9' test -z "/usr/local/lib" || /bin/mkdir -p "/usr/local/lib" /bin/sh ./libtool --mode=install /usr/bin/install -c libsecp256k1.la '/usr/local/lib' libtool: install: /usr/bin/install -c .libs/libsecp256k1.so.0.0.0 /usr/local/lib/libsecp256k1.so.0.0.0 libtool: install: (cd /usr/local/lib && { ln -s -f libsecp256k1.so.0.0.0 libsecp256k1.so.0 || { rm -f libsecp256k1.so.0 && ln -s libsecp256k1.so.0.0.0 libsecp256k1.so.0; }; }) libtool: install: (cd /usr/local/lib && { ln -s -f libsecp256k1.so.0.0.0 libsecp256k1.so || { rm -f libsecp256k1.so && ln -s libsecp256k1.so.0.0.0 libsecp256k1.so; }; }) libtool: install: /usr/bin/install -c .libs/libsecp256k1.lai /usr/local/lib/libsecp256k1.la libtool: finish: PATH="/usr/bin:/usr/sbin:/bin:/sbin:/usr/local/bin:/usr/local/sbin:/sbin" ldconfig -n /usr/local/lib ldconfig: /usr/local/lib/libsecp256k1.so is for unknown machine 181.
ldconfig: /usr/local/lib/libsecp256k1.so.0 is for unknown machine 181.
ldconfig: /usr/local/lib/libsecp256k1.so.0.0.0 is for unknown machine 181.
ldconfig: /usr/local/lib/libexslt.so is for unknown machine 181.
ldconfig: /usr/local/lib/libexslt.so.0 is for unknown machine 181.
ldconfig: /usr/local/lib/libexslt.so.0.8.19 is for unknown machine 181.
ldconfig: /usr/local/lib/libxslt.so is for unknown machine 181.
ldconfig: /usr/local/lib/libxslt.so.1 is for unknown machine 181.
ldconfig: /usr/local/lib/libxslt.so.1.1.31 is for unknown machine 181.
Libraries have been installed in: /usr/local/lib
If you ever happen to want to link against installed libraries in a given directory, LIBDIR, you must either use libtool, and specify the full pathname of the library, or use the `-LLIBDIR' flag during linking and do at least one of the following:
- add LIBDIR to the `LD_LIBRARY_PATH' environment variable during execution
- add LIBDIR to the `LD_RUN_PATH' environment variable during linking
- use the `-Wl,-rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to `/etc/ld.so.conf'
See any operating system documentation about shared libraries for more information, such as the ld(1) and ld.so(8) manual pages.
test -z "/usr/local/include" || /bin/mkdir -p "/usr/local/include" /usr/bin/install -c -m 644 /var/volatile/tmp/test3/libsecp256k1/include/secp256k1.h /var/volatile/tmp/test3/libsecp256k1/include/secp256k1_preallocated.h /var/volatile/tmp/test3/libsecp256k1/include/secp256k1_ecdh.h /var/volatile/tmp/test3/libsecp256k1/include/secp256k1_recovery.h '/usr/local/include' test -z "/usr/local/lib/pkgconfig" || /bin/mkdir -p "/usr/local/lib/pkgconfig" /usr/bin/install -c -m 644 libsecp256k1.pc '/usr/local/lib/pkgconfig' make[1]: Leaving directory `/var/volatile/tmp/test3/build/temp.linux-k1om-3.9' running build_ext generating cffi module 'build/temp.linux-k1om-3.9/_libsecp256k1.c' building '_libsecp256k1' extension creating build/temp.linux-k1om-3.9/build creating build/temp.linux-k1om-3.9/build/temp.linux-k1om-3.9 gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -m64 -fPIC -DCFFI_ENABLE_RECOVERY -I/usr/include/python3.9 -Ibuild/temp.linux-k1om-3.9/include -I/usr/local/include -c build/temp.linux-k1om-3.9/_libsecp256k1.c -o build/temp.linux-k1om-3.9/build/temp.linux-k1om-3.9/_libsecp256k1.o gcc -pthread -shared -L /usr/local/lib64 -m64 build/temp.linux-k1om-3.9/build/temp.linux-k1om-3.9/_libsecp256k1.o -Lbuild/temp.linux-k1om-3.9/lib -L/usr/lib -L/usr/local/lib -Lbuild/temp.linux-k1om-3.9 -lsecp256k1 -lsecp256k1 -lgmp -o build/lib.linux-k1om-3.9/coincurve/_libsecp256k1.cpython-39-x86_64-linux-gnu.so root@heater-mic0:/var/volatile/tmp/test3# python3 setup.py install running install running bdist_egg running egg_info writing coincurve.egg-info/PKG-INFO writing dependency_links to coincurve.egg-info/dependency_links.txt writing requirements to coincurve.egg-info/requires.txt writing top-level names to coincurve.egg-info/top_level.txt adding license file 'LICENSE-MIT' (matched pattern 'LICEN[CS]E*') adding license file 'LICENSE-APACHE' (matched pattern 'LICEN[CS]E*') reading manifest file 'coincurve.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' writing manifest file 'coincurve.egg-info/SOURCES.txt' installing library code to build/bdist.linux-k1om/egg running install_lib running build_py running build_ext generating cffi module 'build/temp.linux-k1om-3.9/_libsecp256k1.c' already up-to-date creating build/bdist.linux-k1om creating build/bdist.linux-k1om/egg creating build/bdist.linux-k1om/egg/coincurve copying build/lib.linux-k1om-3.9/coincurve/_libsecp256k1.cpython-39-x86_64-linux-gnu.so -> build/bdist.linux-k1om/egg/coincurve copying build/lib.linux-k1om-3.9/coincurve/py.typed -> build/bdist.linux-k1om/egg/coincurve copying build/lib.linux-k1om-3.9/coincurve/init.py -> build/bdist.linux-k1om/egg/coincurve copying build/lib.linux-k1om-3.9/coincurve/_windows_libsecp256k1.py -> build/bdist.linux-k1om/egg/coincurve copying build/lib.linux-k1om-3.9/coincurve/context.py -> build/bdist.linux-k1om/egg/coincurve copying build/lib.linux-k1om-3.9/coincurve/ecdsa.py -> build/bdist.linux-k1om/egg/coincurve copying build/lib.linux-k1om-3.9/coincurve/flags.py -> build/bdist.linux-k1om/egg/coincurve copying build/lib.linux-k1om-3.9/coincurve/keys.py -> build/bdist.linux-k1om/egg/coincurve copying build/lib.linux-k1om-3.9/coincurve/types.py -> build/bdist.linux-k1om/egg/coincurve copying build/lib.linux-k1om-3.9/coincurve/utils.py -> build/bdist.linux-k1om/egg/coincurve byte-compiling build/bdist.linux-k1om/egg/coincurve/init.py to init.cpython-39.pyc byte-compiling build/bdist.linux-k1om/egg/coincurve/_windows_libsecp256k1.py to _windows_libsecp256k1.cpython-39.pyc byte-compiling build/bdist.linux-k1om/egg/coincurve/context.py to context.cpython-39.pyc byte-compiling build/bdist.linux-k1om/egg/coincurve/ecdsa.py to ecdsa.cpython-39.pyc byte-compiling build/bdist.linux-k1om/egg/coincurve/flags.py to flags.cpython-39.pyc byte-compiling build/bdist.linux-k1om/egg/coincurve/keys.py to keys.cpython-39.pyc byte-compiling build/bdist.linux-k1om/egg/coincurve/types.py to types.cpython-39.pyc byte-compiling build/bdist.linux-k1om/egg/coincurve/utils.py to utils.cpython-39.pyc creating stub loader for coincurve/_libsecp256k1.cpython-39-x86_64-linux-gnu.so byte-compiling build/bdist.linux-k1om/egg/coincurve/_libsecp256k1.py to _libsecp256k1.cpython-39.pyc creating build/bdist.linux-k1om/egg/EGG-INFO copying coincurve.egg-info/PKG-INFO -> build/bdist.linux-k1om/egg/EGG-INFO copying coincurve.egg-info/SOURCES.txt -> build/bdist.linux-k1om/egg/EGG-INFO copying coincurve.egg-info/dependency_links.txt -> build/bdist.linux-k1om/egg/EGG-INFO copying coincurve.egg-info/not-zip-safe -> build/bdist.linux-k1om/egg/EGG-INFO copying coincurve.egg-info/requires.txt -> build/bdist.linux-k1om/egg/EGG-INFO copying coincurve.egg-info/top_level.txt -> build/bdist.linux-k1om/egg/EGG-INFO writing build/bdist.linux-k1om/egg/EGG-INFO/native_libs.txt creating dist creating 'dist/coincurve-15.0.1-py3.9-linux-k1om.egg' and adding 'build/bdist.linux-k1om/egg' to it removing 'build/bdist.linux-k1om/egg' (and everything under it) Processing coincurve-15.0.1-py3.9-linux-k1om.egg creating /usr/lib/python3.9/site-packages/coincurve-15.0.1-py3.9-linux-k1om.egg Extracting coincurve-15.0.1-py3.9-linux-k1om.egg to /usr/lib/python3.9/site-packages Adding coincurve 15.0.1 to easy-install.pth file
Installed /usr/lib/python3.9/site-packages/coincurve-15.0.1-py3.9-linux-k1om.egg Processing dependencies for coincurve==15.0.1 Searching for asn1crypto Reading https://pypi.org/simple/asn1crypto/ Downloading https://files.pythonhosted.org/packages/b5/a8/56be92dcd4a5bf1998705a9b4028249fe7c9a035b955fe93b6a3e5b829f8/asn1crypto-1.4.0-py2.py3-none-any.whl#sha256=4bcdf33c861c7d40bdcd74d8e4dd7661aac320fcdf40b9a3f95b4ee12fde2fa8 Best match: asn1crypto 1.4.0 Processing asn1crypto-1.4.0-py2.py3-none-any.whl Installing asn1crypto-1.4.0-py2.py3-none-any.whl to /usr/lib/python3.9/site-packages Adding asn1crypto 1.4.0 to easy-install.pth file
Installed /usr/lib/python3.9/site-packages/asn1crypto-1.4.0-py3.9.egg Searching for cffi==1.14.6 Best match: cffi 1.14.6 Adding cffi 1.14.6 to easy-install.pth file
Using /usr/lib/python3.9/site-packages Searching for pycparser==2.20 Best match: pycparser 2.20 Adding pycparser 2.20 to easy-install.pth file
Using /usr/lib/python3.9/site-packages Finished processing dependencies for coincurve==15.0.1 `
I changed the flags in the setup.py file from the coincurve pip directory to match the flags from the electrum repo and had to add a -m64 to my CFLAG.
Anyhow, this likely was a different issue than @ofek ... but the steps to troubleshoot should be the same.