Daniel@0: Daniel@0: Daniel@0: graphviz build notes Daniel@0: Daniel@0: Daniel@0:

graphviz build notes

Daniel@0:

External packages

Daniel@0: The full build requires external libraries that you must Daniel@0: obtain elsewhere. Most, if not all of these are optional, Daniel@0: and configure will build graphviz with reduced functionality Daniel@0: if an external library is not found. Newer versions of these Daniel@0: libraries should be fine - if not, please let us know. Daniel@0: Daniel@0:

Daniel@0: These libraries (either static or dynamic) and their Daniel@0: interface header files must already be on your system. Daniel@0: It's OK if you install your own copies of these packages, Daniel@0: though you may need to tell make or configure where to find them. Daniel@0: Run "configure --help" for details. Daniel@0:

Daniel@0: On most Linux distributions these packages are already installed Daniel@0: or installable from packages included in the distribution. Daniel@0: You might need to install some -devel packages to get the include Daniel@0: header files. Daniel@0: Daniel@0:

Abbreviated Build Instructions (GNU tools)

Daniel@0: Daniel@0:

If you are using GNU tools, the recommended method for building Daniel@0: graphviz is the usual: Daniel@0:

Daniel@0: 
Daniel@0: 	./configure
Daniel@0: 	make
Daniel@0: 	make install
Daniel@0: 
Daniel@0: Daniel@0:

If you are building from CVS sources, then you must have Daniel@0: recent versions of "libtool", "automake", and "autoconf". Daniel@0: Build with: Daniel@0:

Daniel@0: 
Daniel@0: 	./autogen.sh
Daniel@0: 	./configure
Daniel@0: 	make
Daniel@0: 	make install
Daniel@0: 
Daniel@0: Daniel@0:

If you are not building with GNU tools, then there are some Daniel@0: tried-and-true old-style Makefiles that can be used instead. Daniel@0: Details below. Daniel@0: Daniel@0:

Detailed Build Instructions

Daniel@0: Daniel@0:

Daniel@0: There are a handful of preprocessor defines that control the Daniel@0: image driver configuration. These preprocessor defines need to Daniel@0: agree with the libraries used in the Makefile. Daniel@0:

Daniel@0: The generic raster driver is gd and it can be configured to Daniel@0: generate GIF (no compression), PNG (lossless compression), JPEG Daniel@0: (lossy compression), and wireless bitmap (WBMP) files. Daniel@0: The compressors all need zlib. In the current build we Daniel@0: have a top-level config.h file that defines various symbols, such as: Daniel@0:

Daniel@0: HAVE_JPEG
Daniel@0: HAVE_PNG
Daniel@0:

Daniel@0: If you don't enable the gd based drivers, graphviz will Daniel@0: still have the printf style drivers for Postscript and SVG. Daniel@0: (However, even these benefit from better text size estimation via Daniel@0: Freetype, when it is available.) Daniel@0:

Daniel@0:

Build tools for Unix

Daniel@0: You have several choices. Daniel@0:

Daniel@0: 1. (Recommended for Linux) Use configure generated by GNU autoconf. Daniel@0: This often works well on a vanilla Linux distribution with Daniel@0: Tcl/Tk, freetype-devel and libjpeg already installed by root Daniel@0: under /usr. Probably works OK with Solaris, too. Daniel@0: Otherwise some adjusting of command line arguments Daniel@0: to configure will be needed. Daniel@0: For Linux you can also just pick up the source tarball Daniel@0: or RPMs here. Daniel@0:

Daniel@0: First, if you are using sources from CVS, run "./autogen.sh" Daniel@0: to generate the "configure" script. If you are using sources Daniel@0: from graphviz-<version>.tar.gz this autogen.sh step should not be Daniel@0: needed. Daniel@0:

Daniel@0: Next, run configure. For help on possible configure options, run: Daniel@0:
Daniel@0:

Daniel@0: ./configure --help
Daniel@0: 
Daniel@0:

Daniel@0: For example, I use
Daniel@0:

Daniel@0: ./configure  --prefix=$HOME/arch/sgi.mips3 \
Daniel@0: 	--with-freetypeincludedir=$HOME/arch/$ARCH/include/freetype2 \
Daniel@0: 	--with-freetypelibdir=$HOME/arch/$ARCH/lib \
Daniel@0: 	--with-tcl=/usr/common/tcl8.3.3 
Daniel@0:

Daniel@0: Obviously you would change the pathnames to reflect your installation. Daniel@0:

Daniel@0: Note that the directory ${prefix}/include is automatically searched Daniel@0: for headers, and ${prefix}/lib for libraries. Daniel@0:

Daniel@0: If you have problems with one or more of the optional script language bindings, Daniel@0: they can be disabled with e.g. --disable-perl. Daniel@0:

Daniel@0: 2. (Recommend for other Unix platforms.) As above, you need Daniel@0: the external packages to be installed somewhere. Daniel@0:

Daniel@0:
Daniel@0: make
Daniel@0: make install
Daniel@0: make clean
Daniel@0: 
Daniel@0: Daniel@0:

Daniel@0: 3. (Recommended for Dave Korn and Eleftheris Koutsofios) Use AT&T/Lucent Daniel@0: nmake. Daniel@0:

Daniel@0: You have to install the AST tools first. Daniel@0:

Daniel@0: Then edit Makeargs in the top source directory appropriately Daniel@0: and nmake install. Some fiddling with X11 libs is probably Daniel@0: necessary to compile 'lefty'. This usually involes editing Daniel@0: $INSTALLROOT/lib/lib/Xt or X11 (or less portably, edit nmakefile). Daniel@0: You may also need... Daniel@0:

Daniel@0: export PACKAGE_tcl=/where/tcl/is/installed
Daniel@0: 
Daniel@0:

Daniel@0: When nmake works, it's absolutely great, but it's usually Daniel@0: some work to get the environment right including the Daniel@0: actions of tools like iffe (the AST equivalent Daniel@0: of what GNU configure does). If you're Lefty Daniel@0: or Dave Korn, you already knew that. Daniel@0:

Daniel@0:

Build tools for win32

Daniel@0:

See separate Daniel@0: Daniel@0: build notes for Microsoft Windows (in native mode). Daniel@0:

Daniel@0: With some persistence you can likely get Graphviz to build on Daniel@0: UWIN Daniel@0: or Cygwin installed on Daniel@0: Microsoft Windows. You will still need various third-party packages Daniel@0: to enable all the Graphviz drivers. Daniel@0: Daniel@0: Daniel@0: We haven't tried to build tcldot or webdot in win32. Daniel@0: Daniel@0:

Unix platform-specific build notes

Daniel@0:

AIX

Daniel@0: Matt Fago tells us that "--enable-shared=no" is required or the Daniel@0: executables segfault after seemingly correct compiles. (Bug #421) Daniel@0:

SGI

Daniel@0: The default Irix libjpeg is obsolescent. We need at least Daniel@0: version 62. It wasn't at all clear to me where to get sources for Daniel@0: this - eventually I found the source for v61 and patches for v62 Daniel@0: using a search engine. We may eventually remove JPEG support Daniel@0: (lossy compression seems good for photos, not technical diagrams) Daniel@0: so if you can't get this to work, the loss of -Tjpeg is no big deal. Daniel@0:

Daniel@0: Daniel@0: We found that on some platforms (Solaris?) Daniel@0: gd/dotneato and freetype MUST be compiled with the Daniel@0: same C compiler (e.g. gcc, or the native cc). Daniel@0: Otherwise there are are weird stack argument errors in Daniel@0: the call to TT_Open_Face. I don't have time to try Daniel@0: to figure out what's wrong. Daniel@0: Daniel@0:

Solaris

Daniel@0: Put /usr/ccs/bin in PATH Daniel@0: Daniel@0:

HP-UX

Daniel@0: The X11 package must include /usr/contrib/X11R6 Daniel@0: as well as the base stuff. For some reason GNU autoconf doesn't seem to find Daniel@0: X11 in this location so you may need to add the following to the Daniel@0: ./configure line: Daniel@0:
Daniel@0: --with-Xawincludedir=/usr/contrib/X11R6/include --with-Xawlibdir=/usr/contrib/X11R6/lib
Daniel@0: 
Daniel@0: Daniel@0:

Apple Mac OS/X

Daniel@0:

Daniel@0: Currently, PixelGlow (Glen Low) provides a full featured Daniel@0: Daniel@0: port of Graphviz including a very nice Aqua-based graph Daniel@0: document container. Highly recommended. We merged his patches Daniel@0: into our source, but we don't build or test on OS X. Talk to Glen. Daniel@0:

Daniel@0: The following are old pre-Pixelglow build notes: Daniel@0:

Daniel@0: dot and neato build with old make. (Didn't bother with tcldot.) Daniel@0:

Daniel@0: There could still be problems with case-sensitive names, Daniel@0: though we fixed all the ones we could find. Daniel@0:

Daniel@0: It's weird that Mac OSX declares lrand48() but it's not Daniel@0: defined in any of the standard system library functions. Daniel@0: Daniel@0:

GNU style building

Daniel@0: Daniel@0:
Daniel@0: 
Daniel@0: To produce graphviz-(ver).tar.gz from GIT sources using cogito.
Daniel@0: 	cg clone http://www.graphviz.org/pub/scm/graphviz2/.git
Daniel@0: 	cd graphviz2
Daniel@0: or to update from GIT
Daniel@0: 	cd graphviz2
Daniel@0: 	cg update
Daniel@0: then
Daniel@0: 	./autogen.sh
Daniel@0: 	make dist
Daniel@0: 
Daniel@0: (Cogito & GIT are available from http://www.kernel.org/pub/software/scm/
Daniel@0: or as binary packages in Fedora-Extras )
Daniel@0: 
Daniel@0: To build source and binary rpms (results are left in /usr/src/redhat/ ):
Daniel@0: 
Daniel@0: 	rpm -ta graphviz-(ver).tar.gz
Daniel@0: 
Daniel@0: To build locally:
Daniel@0: 
Daniel@0: 	zcat graphviz-(ver).tar.gz | tar xfvo -
Daniel@0: 	cd graphviz-(ver)
Daniel@0: 	./configure
Daniel@0: 	make
Daniel@0: 	make install
Daniel@0: 
Daniel@0: Daniel@0: Daniel@0: