Closed Edenharder closed 2 years ago
Thanks for reporting and for the detailed log. This definitely looks like an issue with Cython. Can you try to install by generating the cdd.c file yourself? Removing cdd.c from the source tarball should trigger this, or alternatively building from the git source (this is slightly more tricky).
If removing cdd.c fixes it, I think I might release the source tarball without cdd.c in the future to ensure no incompatibilities occur.
Thank you for the suggestion. In fact, I do not know where to download the source tarball. Then I used pip
to install from github. There is still the error.
pip install git+https://github.com/mcmtroffaes/pycddlib@develop
Defaulting to user installation because normal site-packages is not writeable
Collecting git+https://github.com/mcmtroffaes/pycddlib@develop
Cloning https://github.com/mcmtroffaes/pycddlib (to revision develop) to /tmp/pip-req-build-udxawz4a
Running command git clone -q https://github.com/mcmtroffaes/pycddlib /tmp/pip-req-build-udxawz4a
Running command git submodule update --init --recursive -q
Building wheels for collected packages: pycddlib
Building wheel for pycddlib (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /usr/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-udxawz4a/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-udxawz4a/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-b_tx9tmv
cwd: /tmp/pip-req-build-udxawz4a/
Complete output (18 lines):
/usr/lib/python3.10/site-packages/setuptools/installer.py:27: SetuptoolsDeprecationWarning: setuptools.installer is deprecated. Requirements should be satisfied by a PEP 517 installer.
warnings.warn(
running bdist_wheel
running build
running build_ext
cythoning cdd.pyx to cdd.c
building 'cdd' extension
creating build
creating build/temp.linux-x86_64-3.10
creating build/temp.linux-x86_64-3.10/cddlib
creating build/temp.linux-x86_64-3.10/cddlib/lib-src
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -flto -ffat-lto-objects -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -flto -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -flto -fPIC -DGMPRATIONAL -Icddlib/lib-src -I/usr/include/python3.10 -c cdd.c -o build/temp.linux-x86_64-3.10/cdd.o
In file included from cdd.c:684:
cddlib/lib-src/cdd.h:26:10: fatal error: cdd_f.h: No such file or directory
26 | #include "cdd_f.h"
| ^~~~~~~~~
compilation terminated.
error: command '/usr/bin/gcc' failed with exit code 1
----------------------------------------
ERROR: Failed building wheel for pycddlib
Running setup.py clean for pycddlib
Failed to build pycddlib
Installing collected packages: pycddlib
Running setup.py install for pycddlib ... error
ERROR: Command errored out with exit status 1:
command: /usr/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-udxawz4a/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-udxawz4a/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-t8aa5nsp/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/x/.local/include/python3.10/pycddlib
cwd: /tmp/pip-req-build-udxawz4a/
Complete output (20 lines):
/usr/lib/python3.10/site-packages/setuptools/installer.py:27: Seirements should be satisfied by a PEP 517 installer.
warnings.warn(
running install
/usr/lib/python3.10/site-packages/setuptools/command/install.py:e build and pip and other standards-based tools.
warnings.warn(
running build
running build_ext
cythoning cdd.pyx to cdd.c
building 'cdd' extension
creating build
creating build/temp.linux-x86_64-3.10
creating build/temp.linux-x86_64-3.10/cddlib
creating build/temp.linux-x86_64-3.10/cddlib/lib-src
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrations -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fsta86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_fcf-protection -flto -march=x86-64 -mtune=generic -O3 -pipe -fno-pltty -fstack-clash-protection -fcf-protection -flto -fPIC -DGMPRATIONAlinux-x86_64-3.10/cdd.o
In file included from cdd.c:684:
cddlib/lib-src/cdd.h:26:10: fatal error: cdd_f.h: No such file o
26 | #include "cdd_f.h"
| ^~~~~~~~~
compilation terminated.
error: command '/usr/bin/gcc' failed with exit code 1
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python -u -cbuild-udxawz4a/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-udxaw);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec-record-t8aa5nsp/install-record.txt --single-version-externally-manaude/python3.10/pycddlib Check the logs for full command output.
Yeah, it is a bit tricky... you can't install directly from the github link, you have to clone the project and then run a script to generate the missing files: https://github.com/mcmtroffaes/pycddlib/blob/develop/cddlib-makefile-gmp.sh I apologize for making you go through this complicated steps, but that's just how cddlib is set up. Alternatively, the tarball can be found here:
https://pypi.org/project/pycddlib/2.1.4/#files
This will include missing the generated headers. If you remove the cdd.c file, Cython will do the generation for you and I guess this will fix the problem. If not, we'll have to dig deeper...
(BTW it seems I forgot to make a source release for 2.1.5 🤦♂️ - I'll correct that.)
Removing cdd.c from the source tarball should trigger this
Thank you! It works. I can install it successfully in this way.
Awesome! In the next week, I'll try to put together a fresh release with source tarball that doesn't include this file, so cython can do its thing.
@anagorko @Edenharder I got this running now on github actions, which means that the current package is now much better tested against linux. Could you download the .tar.gz from the "dist" artifact from the build below, and let me know if you can install it locally straight from this tarball?
https://github.com/mcmtroffaes/pycddlib/actions/runs/2287368270 (zip can be downloaded by clicking on "dist" at the bottom of the page, you have to unzip it first to get to the tarball itself)
I've done further testing and I'm pretty confident that this should be fixed now with the latest 2.1.6 release. Thanks again for reporting! Please do reopen if the same issue were to sustain somehow.
I'm getting this error or similar now, when trying to
pip install pycddlib
or
pip install pycddlib==2.1.6
Collecting pycddlib==2.1.6
Using cached pycddlib-2.1.6.tar.gz (159 kB)
Preparing metadata (setup.py) ... done
Building wheels for collected packages: pycddlib
Building wheel for pycddlib (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [23 lines of output]
/usr/lib/python3/dist-packages/pkg_resources/init.py:116: PkgResourcesDeprecationWarning: 1.1build1 is an invalid version and will not be supported in a future release
warnings.warn(
/usr/lib/python3/dist-packages/pkg_resources/init.py:116: PkgResourcesDeprecationWarning: 0.1.43ubuntu1 is an invalid version and will not be supported in a future release
warnings.warn(
/usr/lib/python3/dist-packages/setuptools/installer.py:27: SetuptoolsDeprecationWarning: setuptools.installer is deprecated. Requirements should be satisfied by a PEP 517 installer.
warnings.warn(
running bdist_wheel
running build
running build_ext
cythoning cdd.pyx to cdd.c
building 'cdd' extension
creating build
creating build/temp.linux-x86_64-3.10
creating build/temp.linux-x86_64-3.10/cddlib
creating build/temp.linux-x86_64-3.10/cddlib/lib-src
x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DGMPRATIONAL -Icddlib/lib-src -I/usr/include/python3.10 -c cdd.c -o build/temp.linux-x86_64-3.10/cdd.o
In file included from cddlib/lib-src/cdd.h:17,
from cdd.c:749:
cddlib/lib-src/cddmp.h:30:11: fatal error: gmp.h: No such file or directory
30 | #include "gmp.h"
| ^~~~~~~
compilation terminated.
error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for pycddlib
Running setup.py clean for pycddlib
Failed to build pycddlib
Installing collected packages: pycddlib
Running setup.py install for pycddlib ... error
error: subprocess-exited-with-error
× Running setup.py install for pycddlib did not run successfully.
│ exit code: 1
╰─> [25 lines of output]
/usr/lib/python3/dist-packages/pkg_resources/init.py:116: PkgResourcesDeprecationWarning: 1.1build1 is an invalid version and will not be supported in a future release
warnings.warn(
/usr/lib/python3/dist-packages/pkg_resources/init.py:116: PkgResourcesDeprecationWarning: 0.1.43ubuntu1 is an invalid version and will not be supported in a future release
warnings.warn(
/usr/lib/python3/dist-packages/setuptools/installer.py:27: SetuptoolsDeprecationWarning: setuptools.installer is deprecated. Requirements should be satisfied by a PEP 517 installer.
warnings.warn(
running install
/usr/lib/python3/dist-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
running build
running build_ext
skipping 'cdd.c' Cython extension (up-to-date)
building 'cdd' extension
creating build
creating build/temp.linux-x86_64-3.10
creating build/temp.linux-x86_64-3.10/cddlib
creating build/temp.linux-x86_64-3.10/cddlib/lib-src
x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DGMPRATIONAL -Icddlib/lib-src -I/usr/include/python3.10 -c cdd.c -o build/temp.linux-x86_64-3.10/cdd.o
In file included from cddlib/lib-src/cdd.h:17,
from cdd.c:749:
cddlib/lib-src/cddmp.h:30:11: fatal error: gmp.h: No such file or directory
30 | #include "gmp.h"
| ^~~~~~~
compilation terminated.
error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> pycddlib
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.```
I'm also on Ubuntu 22.04.
This problem is very different from the one originally posted. It seems you don't have the gmp headers installed; did you follow the instructions for ubuntu? See https://pycddlib.readthedocs.io/en/latest/quickstart.html#installation If you did that and the issue remains, please submit a fresh ticket.
Thanks, I did miss the GMP instructions, and apologies for the misplaced comment, I associated the issues because of the "failed building wheel" and did not know what the rest of the error meant.
I know, it's ok. Glad it worked!
@mcmtroffaes I'm using Archlinux. There is a similar problem when I try to install pycddlib:
BTW, there is no problem to install pycddlib 2.1.2. I have indeed installed
gmp
in Archlinux. Even after I have installedgmpy2
with pip for Python, there is still such errors.