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

[Installation error] 'cddlib/setoper.h' file not found #73

Closed shuoyang2000 closed 1 month ago

shuoyang2000 commented 1 month ago

Hi! I encountered the following error while trying to install the package (on macosx-13.2-arm64 with python3.10), could you help me on it? Thanks!

Building wheel for pycddlib (pyproject.toml) ... error error: subprocess-exited-with-error

× Building wheel for pycddlib (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [29 lines of output] running bdist_wheel running build running build_py running egg_info writing src/pycddlib.egg-info/PKG-INFO writing dependency_links to src/pycddlib.egg-info/dependency_links.txt writing requirements to src/pycddlib.egg-info/requires.txt writing top-level names to src/pycddlib.egg-info/top_level.txt reading manifest file 'src/pycddlib.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' no previously-included directories found matching 'test' adding license file 'LICENSE.md' adding license file 'AUTHORS' writing manifest file 'src/pycddlib.egg-info/SOURCES.txt' creating build/lib.macosx-13.2-arm64-cpython-310/cdd copying src/cdd/init.pyi -> build/lib.macosx-13.2-arm64-cpython-310/cdd copying src/cdd/gmp.pyi -> build/lib.macosx-13.2-arm64-cpython-310/cdd copying src/cdd/py.typed -> build/lib.macosx-13.2-arm64-cpython-310/cdd running build_ext Compiling cython/_cdd.pyx because it changed. [1/1] Cythonizing cython/_cdd.pyx building 'cdd.init' extension creating build/temp.macosx-13.2-arm64-cpython-310/cython clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -I/Users/user_name/safe-control-gym/new_drone_venv/include -I/Users/user_name/.pyenv/versions/3.10.10/include/python3.10 -c cython/_cdd.c -o build/temp.macosx-13.2-arm64-cpython-310/cython/_cdd.o cython/_cdd.c:1248:10: fatal error: 'cddlib/setoper.h' file not found

include "cddlib/setoper.h"

           ^~~~~~~~~~~~~~~~~~
  1 error generated.
  error: command '/usr/bin/clang' 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 Successfully built safe-control-gym ecos Failed to build pycddlib ERROR: Could not build wheels for pycddlib, which is required to install pyproject.toml-based projects

bobmyhill commented 1 month ago

I had the same problem. Running brew install cddlib gmp first fixed this for me. This page suggests this for installing from source, but I also needed it for installing using pip.

shuoyang2000 commented 1 month ago

It works for me, thanks a lot Bob! I also need to install use pip as suggested in the document env "CFLAGS=-I$(brew --prefix)/include -L$(brew --prefix)/lib" pip install pycddlib

mattiejastje commented 1 month ago

Yes, all those steps are necessary. Thanks for the help @bobmyhill!