What dependencies beyond quartz and expat are useful for Graphviz on macOS?

Graphviz incorporates a lot of packages for its functionality. On the Mac, Graphviz gains much of this functionality with the Quartz plugin. How much of what Quartz provides overlaps with the functionality of other plugins, e.g GD and Pango? Is there a way to determine the set of package dependencies for a “minimally complete” construction of Graphviz for macOS?

The page Source Code | Graphviz identifies a number of dependencies for Graphviz. How many of these dependencies are relevant for macOS.

The ci/ folder includes some scripts that install build and runtime dependencies via homebrew. Pango, gts, gtk+, and qt5 show up here. Does Graphviz use GTS itself? Or is it a “dependency of a dependency,” e.g. pango? Does Graphviz gtk+ or qt5 support enable any capabilities for Mac users?

The Quartz plugin includes the cgimage, pict, and sgi formats. cgimage is not a file type, but regardless specifying it to dot causes a nil pointer exception (something about trying to copy a context to a window and then dereferencing it). Quartz no longer produces pict or sgi output. These are pretty old formats.

Are kitty, smyrna, gvedit macOS applications?

Is there a way to determine the set of package dependencies for a “minimally complete” construction of Graphviz for macOS?

I think the definition of “minimally complete” is subjective. You can look at the cmake-minimal-build in CI, but I am guessing this does not align with your definition.

Yes. Look in lib/neatogen and lib/sfdpgen. A frequent problem is Windows users experiencing inaccurate layout because their Graphviz builds lack libgts, which is unavailable on Windows.

Not really sure what you’re asking. GTK is used by Smyrna and the GTK plugin. AFAIK neither of these are buildable on macOS (#1848, #2290, #2422). Qt5 or Qt6 is used by Gvedit. This can be built on macOS through either Autotools or CMake, and I believe both macOS CI jobs do such.

Kitty is a third-party application. I have no idea if it runs on macOS. Smyrna is a Graphviz application that does not (see above). Gvedit is a Graphviz application that does (see above).

It would be ok to omit smyrna, if you want to build a minimal graphviz. It is not used much.

I don’t think pangocairo is required. It’s not necessary even to have external shape loaders, but if you want for example to load external SVG files as node shapes, that’s implemented with librsvg and they state that they are dependent on cairopango and gdk-pixbuf. I think loading external PS or PDF might be accomplished through Ghostview, so that’s also a lot of machinery.

There’s no need for qt unless you want gvedit.

IIRC, libgts and libANN are the most esoteric dependencies.


As I noted above, I don’t think macOS builders have a choice. The Smyrna dependencies are unavailable on contemporary macOS.

I think what action you take here will depend on if you’re building Graphviz for yourself or for others. E.g. here are some things you can omit but will almost certainly generate complaints from downstream users:

  • libgts: they will get “triangulation failed” errors and inaccurate layouts
  • expat: table formatting in HTML labels will be unavailable
  • pangocairo: the standard answer to “text is laid out poorly in my SVG” is “use -Tsvg:cairo instead of -Tsvg”. This will not work without pangocairo.

I have graphviz built with gts, cairo, and pango on macOS. I can now run dot with -Tsvg and -Tsvg:cairo. What should I look for in SVG output to help me distinguish and appreciate the differences? Are there samples in the contrib folder for example?

I have tried a couple of dot files but I haven’t done much with fancy text. The output files from svg:cairo are much larger however.

Building graphviz on macOS with Quartz and with the GTS, Pango, and GTS dependencies. Below are the results of the configure, and the output of dot -v. How well does this fit with the expectations of macOS Graphviz users? (Note that several dependencies are produced by Pango and Cairo as subprojects.)

  1. OpenGL and GLUT frameworks are still present in the macOS Command Line Tools, but are deprecated. From About OpenGL for OS X :

Important OpenGL was deprecated in macOS 10.14. To create high-performance code on GPUs, use the Metal framework instead. See Metal.

For what functionality might GLUT be used?

  1. What is ANN and where is it?
graphviz-10.0.0~dev.20231209.1015 will be compiled with the following:

  cgraph:        Yes (always enabled)
  digcola:       Yes
  expat:         Yes
  freetype:      Yes
  glut:          No (missing GL/glut.h)
  ann:           No (no ann.pc or ANN.h found)
  gts:           Yes
  ipsepcola:     Yes
  ltdl:          Yes
  ortho:         Yes
  sfdp:          Yes
  swig:          No (swig not available) (  )
  shared:        Yes
  static:        No (disabled by default)
  qt:            No (qmake not found)
  x:             No (disabled or unavailable)

  dot:           Yes (always enabled)
  neato:         Yes (always enabled)
  fdp:           Yes (always enabled)
  circo:         Yes (always enabled)
  twopi:         Yes (always enabled)
  gvpr:          Yes (always enabled)
  gvmap:         Yes (always enabled)
  smyrna:        No (requires: gtk+ gtkglext glade glut)
  gvedit:        No (qmake not found)

plugin libraries:
  dot_layout:    Yes (always enabled)
  neato_layout:  Yes (always enabled)
  core:          Yes (always enabled)
  devil:         No (missing library)
  gd:            No (gd headers not found)
  gdiplus:       No (disabled by default - Windows only)
  gdk:           No (gdk library not available)
  gdk_pixbuf:    No (gdk_pixbuf library not available)
  ghostscript:   No (missing Xrender)
  gtk:           No (gtk library not available)
  lasi:          No (lasi library not available)
  pangocairo:    Yes
  poppler:       No (poppler library not available)
  quartz:        Yes
  rsvg:          No (rsvg library not available)
  webp:          No (webp library not available)
  xlib:          No (disabled or unavailable)

language extensions:
  gv_sharp:      No (swig not available)
  gv_d:          No (disabled by default - incomplete)
  gv_go:         No (swig not available)
  gv_guile:      No (swig not available)
  gv_java:       No (swig not available)
  gv_javascript: No (disabled by default - incomplete)
  gv_lua:        No (swig not available)
  gv_ocaml:      No (swig not available)
  gv_perl:       No (swig not available)
  gv_php:        No (swig not available)
  gv_python3:    No (swig not available)
  gv_R:          No (swig not available)
  gv_ruby:       No (swig not available)
  gv_tcl:        No (tcl not available)

  tcldot:        No (tcl not available)
  tclpathplan:   No (tcl not available)
  gdtclft:       No (tcl not available)

The following is what dot -v shows is enabled:

dot - graphviz version 10.0.0~dev.20231209.1015 (20231209.1015)
libdir = "/usr/local/graphviz/lib/graphviz"
Activated plugin library: libgvplugin_dot_layout.6.dylib
Using layout: dot:dot_layout
Activated plugin library: libgvplugin_core.6.dylib
Using render: dot:core
Using device: dot:dot:core
The plugin configuration file:
		was successfully loaded.
    render	:  cairo dot dot_json fig json json0 map mp pic pov ps quartz svg svg_inline tk xdot xdot_json
    layout	:  circo dot fdp neato nop nop1 nop2 osage patchwork sfdp twopi
    textlayout	:  textlayout
    device	:  bmp canon cgimage cmap cmapx cmapx_np dot dot_json eps exr fig gif gv icns ico imap imap_np ismap jp2 jpe jpeg jpg json json0 kitty kittyz mp pct pdf pic pict plain plain-ext png pov ps ps2 psd sgi svg svg_inline svgz tga tif tiff tk vt vt-24bit xdot xdot1.2 xdot1.4 xdot_json
    loadimage	:  (lib) bmp eps gif jpe jpeg jpg pdf png ps svg

I believe libglut was only for smyrna, back when we were experimenting with 3D.

ANN is an approximate nearest-neighbors library, not really maintained, a little obscure, so it’s a thorn in our side for portability. On my computer I just build a private copy. It’s necessary for mingle, an edge bundling program.

It might improve portability to replace ANN with a popular library like Spotify annoy but might be a lot of work. Though, the caller is only a 180 line file.