maurerle / eralchemy2

Entity Relation Diagrams generation tool based on https://github.com/Alexis-benoist/eralchemy
Apache License 2.0
63 stars 15 forks source link

graphviz/cgraph.h not found (Linux aarch64) #28

Closed alexwilson1 closed 1 month ago

alexwilson1 commented 5 months ago

Installing on aarch64 (Linux) gives the error described in this thread:

      gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DSWIG_PYTHON_STRICT_BYTE_CHAR -I/usr/local/include/python3.10 -c pygraphviz/graphviz_wrap.c -o build/temp.linux-aarch64-cpython-310/pygraphviz/graphviz_wrap.o
      pygraphviz/graphviz_wrap.c:3020:10: fatal error: graphviz/cgraph.h: No such file or directory
       3020 | #include "graphviz/cgraph.h"
            |          ^~~~~~~~~~~~~~~~~~~
      compilation terminated.
      error: command '/usr/bin/gcc' failed with exit code 1
      [end of output]

Workaround for me was to run this:

sudo apt update
sudo apt install graphviz libgraphviz-dev
export C_INCLUDE_PATH="/usr/include/graphviz:$C_INCLUDE_PATH"
export LIBRARY_PATH="/usr/lib/aarch64-linux-gnu/graphviz:$LIBRARY_PATH"
pip install --use-pep517 pygraphviz
pip install eralchemy2
maurerle commented 5 months ago

Thats not a problem of eralchemy2 but of the pygraphviz installation.

I thought that installing libgraphviz-dev is enough. Is that not the case? Should we update installation instructions to make it clearer that this is required?

alexwilson1 commented 5 months ago

I just tested it and running sudo apt install graphviz libgraphviz-dev prior to installation does seem sufficient. The instructions only mention installing graphviz, but on Aarch64 I was receiving the error given above (which libgraphviz-dev solved). Thanks!

TortoiseHam commented 4 months ago

On Mac you may need to run: pip install --use-pep517 --config-settings=--global-option=build_ext --config-settings=--global-option="-I$(brew --prefix graphviz)/include" --config-settings=--global-option="-L$(brew --prefix graphviz)/lib" pygraphviz

maurerle commented 1 month ago

When using conda, you can also simply install with conda install -c conda-forge eralchemy2, which also brings the graphviz dependency through pygraphviz from conda :)

The latest release also includes install instructions in the REAMDE. I will therefore close this issue.