mcmtroffaes / pycddlib

A Python wrapper for Komei Fukuda's cddlib.
http://packages.python.org/pycddlib/
GNU General Public License v2.0
61 stars 9 forks source link

installing pycddlib with python3 #42

Closed ahmadgazar closed 4 years ago

ahmadgazar commented 4 years ago

Hi, I am trying to install pycddlib on ububtu 18.04 using pip3 but the build fails with the following error:

Collecting pycddlib Downloading https://files.pythonhosted.org/packages/7c/cc/b2c11e9a494a029e840284fdc5a1108a03be2f4be3fdcc35cd670a903f7e/pycddlib-2.1.2.tar.gz (304kB) 100% |████████████████████████████████| 307kB 2.6MB/s Building wheels for collected packages: pycddlib Running setup.py bdist_wheel for pycddlib ... error Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;file='/tmp/pip-build-q03lt_5j/pycddlib/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/tmpddxzss_fpip-wheel- --python-tag cp36: running bdist_wheel 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.6 creating build/temp.linux-x86_64-3.6/cddlib creating build/temp.linux-x86_64-3.6/cddlib/lib-src x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DGMPRATIONAL -Icddlib/lib-src -I/usr/include/python3.6m -c cdd.c -o build/temp.linux-x86_64-3.6/cdd.o In file included from cddlib/lib-src/cdd.h:18:0, from cdd.c:793: cddlib/lib-src/cddmp.h:31:11: fatal error: gmp.h: No such file or directory

include "gmp.h"

         ^~~~~~~

compilation terminated. error: command 'x86_64-linux-gnu-gcc' failed with exit status 1


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 Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;file='/tmp/pip-build-q03lt_5j/pycddlib/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-8rk_jttn-record/install-record.txt --single-version-externally-managed --compile --user --prefix=: running install 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.6 creating build/temp.linux-x86_64-3.6/cddlib creating build/temp.linux-x86_64-3.6/cddlib/lib-src x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DGMPRATIONAL -Icddlib/lib-src -I/usr/include/python3.6m -c cdd.c -o build/temp.linux-x86_64-3.6/cdd.o In file included from cddlib/lib-src/cdd.h:18:0, from cdd.c:793: cddlib/lib-src/cddmp.h:31:11: fatal error: gmp.h: No such file or directory

include "gmp.h"

           ^~~~~~~
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

----------------------------------------

Command "/usr/bin/python3 -u -c "import setuptools, tokenize;file='/tmp/pip-build-q03lt_5j/pycddlib/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-8rk_jttn-record/install-record.txt --single-version-externally-managed --compile --user --prefix=" failed with error code 1 in /tmp/pip-build-q03lt_5j/pycddlib/

I did not have an issue installing pycddlib a year ago on ubuntu 16 and python2. Do you think pycddlib is not compatible with ubuntu 18 or higher? thanks.

ahmadgazar commented 4 years ago

Turns out I did not have GMP installed on my fresh ubuntu 20 installation. This was resolved as: $ sudo apt install libgmp3-dev

Hope this can be useful for someone.