Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ubuntu graphviz 'sfdp' not working

I'm trying to make some Networkx Graphviz graphs.

After running: pos = nx.graphviz_layout(G, prog = 'sfdp'). An error occured, saying:

Error: remove_overlap: Graphviz not built with triangulation library

After some Google research I found that GTS is the problem. Bug report stated:

The Graphviz package is built --without-gts. This is bad news for sfdp, which complains “Error: remove_overlap: Graphviz not built with triangulation library” and fails to produce the beautiful output it creates when compiled --with-gts

Looking at comments ( on bug report ), someone said that the upstream sources for Graphviz are kept at link but I couldn't find new versions to download.

On package list I have the latest one (2.36 for trusty).

Anyone else having problems with sfdp?

Any help will be greatly appreciated!

like image 442
VlS Avatar asked Dec 11 '15 16:12

VlS


Video Answer


2 Answers

I know the question is for Ubuntu, but in case someone is having the same problem on macOS using homebrew the following worked for me:

brew reinstall graphviz --with-gts
like image 174
Matthias Winkelmann Avatar answered Sep 29 '22 17:09

Matthias Winkelmann


For the ubuntu users, this is how I got grapvhiz to work on 16.04,compiling graphviz-2.40.1 from source:

In a first step , GTS needs to be installed , as graphviz looks for the gts.pc file.

Running

apt-file search gts.pc

Informs me I have to install 'libgts-dev' :

sudo apt install libgts-dev

next make pkg-config aware of the files:

pkg-config --libs gts

pkg-config --cflags gts

run configure to link in the gts library:

./configure --with-gts  --prefix ~
make
make install

SFDP no longer throws the error 'Error: remove_overlap: Graphviz not built with triangulation library'

The command line codes for the pkg config I modified from this answer.

like image 29
Sam Windels Avatar answered Sep 29 '22 18:09

Sam Windels