graphviz 1.7 build notes

External packages

The full build requires external libraries that you must obtain elsewhere:

These libraries (either static or dynamic) and their interface header files must already be on the system. It's OK if you install your own copies of these packages, though you will need to tell make or configure where to find them.

It's probably still possible to build the tools without the above (by deleting the raster driver), and it's possible to build dot and neato without tcldot, but we haven't tried that in a while.

I had some trouble finding the right version of libjpeg v62 but you can get a source tarball of my patched copy if you have trouble with yours.

You can locate most of this stuff on places like SourceForge, freetype.org, and RPMfind (for Linux at least).

n.b. It is a little annoying that you must build and install freetype-devel just to get the header files that define the API in the freetype libraries (e.g. libttf.so). For convenience we put the header files for Linux here.

Abreviated Build Instructions (GNU tools)

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


	./configure
	make
	make install

If you are building from CVS sources, then you will need to have "libtool", "automake", and "autoconf" installed, then build with:


	./autogen.sh
	make
	make install

If you are not building with GNU tools, then there are some old-style Makefiles that can be used instead. Details below.

Detailed Build Instructions

There are a handful of preprocessor defines that control the image driver configuration. The generic driver is gd and it can be configured to generate GIF (no compression), PNG (lossless compression), JPEG (lossy compression), and Windows BMP files. The compressors all need zlib. In the current build we have a top-level config.h file that defines various symbols, such as:

HAVE_JPEG
HAVE_PNG

Build tools for Unix

You have several choices.

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

To do this, run

autogen.sh
possibly with some additional arguments. After running autogen.sh for the first time, you can use run configure directly with the same command line arguments. For example, I use
./autogen.sh  --prefix=$HOME/arch/sgi.mips3 \
	--with-extralibdir=$HOME/arch/sgi.mips3/lib \
	--with-extraincludedir=$HOME/arch/sgi.mips3/include \
	--with-freetypeincludedir=$HOME/arch/$ARCH/include/freetype2 \
	--with-freetypelibdir=$HOME/arch/$ARCH/lib \
	--with-tcl=/usr/common/tcl8.3.3 

Obviously you would change the pathnames to reflect your installation.

2. (Recommend for other Unix platforms.) As above, you need the external packages to be installed somewhere. Then use old make by editing Config.mk for your architecture and installation directory. Check settings in makearch/$(ARCH). See below for further notes on individual platforms.

Do the usual:

make
make install
make clean

3. (Recommended for Dave Korn and Elefteris Koutsofios) Use AT&T/Lucent nmake.

You have to install the AST tools first.

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

export PACKAGE_tcl=/where/tcl/is/installed

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

Build tools for win32

Not for the faint of heart. We're now building with Microsoft Visual Studio and are on the verge of a full source and binary release for thsi platform. If you're ambitious, we have also used nmake from AT&T UWIN to build for both the UWIN environment and the native win32 platform.
	export nativepp=-1 
nmake CC=ncc MSWIN32==1
(the nativepp thing seems fixed in UWIN 2.25).

Obviously you need to have native versions of zlib, libpng, jpeg and freetype. I've done this; it wasn't especially pleasant. See below If you're running UWIN, of course, you can always just go with either the old gviz 1.5 binaries of graphviz for UWIN (from Dave Korn's UWIN site ) or build graphviz 1.7 as a UWIN program using nmake or gmake.
More win32 notes...

Had to get cygwin versions of: zlib, png, jpeg-6b (required minor source mods), freetype.1.3.1.

Had to add extra fluff to globals.h to pull in astwin32.h but #undef _UWIN when compiling with CC=ncc.

Built zlib by configure CC=ncc --prefix=/home/users/north/src/usr then gmake install

Built png by copying scripts/makefile.gcc to makefile and editing slightly then gmake install

Built jpeg same as zlib. gmake install-lib install-headers

MSVC 5.0 C compiler dies when -O is invoked on neato/splines.c, required nmakefile CC.NOOPTIMIZE.

Needed to hand-craft a lib/lib/z to go with our libz.a in order to not unintentionally pull in /usr/lib/ast.lib (because of mistakenly binding the lib/lib/z that goes with /usr/lib/z.lib).

I haven't tried to build tcldot or webdot in win32.

Unix platform-specific build notes

SGI

The default Irix libjpeg is obsolescent. We need at least version 62. It wasn't at all clear to me where to get sources for this - eventually I found the source for v61 and patches for v62 using a search engine.

There are problems with iffe still being resolved.

Here's another clue for you all: gd/dotneato and freetype MUST be compiled with the same C compiler (e.g. gcc, or the native cc). Otherwise there are are weird stack argument errors in the call to TT_Open_Face. I don't have time to try to figure out what's wrong.

Solaris

Put /usr/ccs/bin in PATH

HP-UX

The X11 package must include /usr/contrib/X11R6 as well as the base stuff.

GNU style building

To produce graphviz-(ver).tar.gz from CVS sources.

	cvs checkout graphviz
	cd graphviz
	./autogen.sh
	make dist

To build source and binary rpms (results are left in /usr/src/redhat/ ):

	rpm -ta graphviz-(ver).tar.gz

To build locally:

	zcat graphviz-(ver).tar.gz | tar xfvo -
	cd graphviz-(ver)
	./configure
	make
	make install