annotate toolboxes/graph_visualisation/share/graphviz/doc/html/winbuild.html @ 0:e9a9cd732c1e tip

first hg version after svn
author wolffd
date Tue, 10 Feb 2015 15:05:51 +0000
parents
children
rev   line source
wolffd@0 1 <html>
wolffd@0 2 <head>
wolffd@0 3 <title>Graphviz Build Instructions for Windows</title>
wolffd@0 4 </head>
wolffd@0 5 <body bgcolor=#ffffff>
wolffd@0 6 <h2>Graphviz Build Instructions for Windows</h2>
wolffd@0 7 <P>
wolffd@0 8 <b>(Graphviz versions &ge; 2.22)</b>
wolffd@0 9 <P>
wolffd@0 10 We now build both Visual Studio and MinGW versions of Graphviz.
wolffd@0 11 In addition, the source package comes with project files for Visual Studio,
wolffd@0 12 so building from source should be fairly simple in either case.
wolffd@0 13 <UL>
wolffd@0 14 <LI>
wolffd@0 15 The first step is to add the third-party libraries. These are listed
wolffd@0 16 <A HREF="http://www.graphviz.org/Download_source.php">here</A>.
wolffd@0 17 This is most easily done by installing
wolffd@0 18 a Windows binary version of <A HREF="http://www.gtk.org">GTK 2.0</A> or later.
wolffd@0 19 <LI>
wolffd@0 20 Next, download and unwrap the Graphviz source package. Go to
wolffd@0 21 <A HREF=http://www.graphviz.org/Download_source.php>http://www.graphviz.org/Download_source.php</A>
wolffd@0 22 and copy over either the stable release
wolffd@0 23 or the development source package.
wolffd@0 24 </UL>
wolffd@0 25 Let $ROOT be the root directory (folder)
wolffd@0 26 in which you stored the Graphviz source.
wolffd@0 27 <h3>Building with Visual Studio</h3>
wolffd@0 28 <OL>
wolffd@0 29 <LI>
wolffd@0 30 Copy the file $ROOT/windows/config.h into $ROOT.
wolffd@0 31 <LI>
wolffd@0 32 Copy the folder $ROOT/windows/FEATURE into $ROOT.
wolffd@0 33 <LI>
wolffd@0 34 Start Visual Studio and read in $ROOT/graphviz.sln.
wolffd@0 35 There are project files for all of the parts of Graphviz.
wolffd@0 36 <LI>
wolffd@0 37 Modify the various settings for include file and library directories to find
wolffd@0 38 the third-party software.
wolffd@0 39 <LI>
wolffd@0 40 Modify the settings as to where you want the software installed.
wolffd@0 41 <LI>
wolffd@0 42 Build Graphviz.
wolffd@0 43 </OL>
wolffd@0 44 <h3>Building with MinGW</h3>
wolffd@0 45 <OL>
wolffd@0 46 <LI> Install MinGW and Msys. This gives a mini GNU-like compile environment
wolffd@0 47 <LI> Set environment variables based on your machine, giving values to the
wolffd@0 48 first six below:
wolffd@0 49 <CODE>
wolffd@0 50 <PRE>
wolffd@0 51 export INSTALLROOT # Root install directory
wolffd@0 52 export GTKDIR # Root of GTK tree
wolffd@0 53 export FONTCONFIGINCLUDEDIR # Path of fontconfig include dir
wolffd@0 54 export FONTCONFIGLIBDIR # Path of fontconfig lib dir
wolffd@0 55 export FREETYPEINCLUDEDIR # Path of freetype2 include dir
wolffd@0 56 export FREETYPELIBDIR # Path of freetype2 lib dir
wolffd@0 57
wolffd@0 58 export CFLAGS="-DGVDLL=1"
wolffd@0 59 export CPPFLAGS="-I$GTKDIR/include -I$GTKDIR/include/freetype2 "
wolffd@0 60 export LDFLAGS="-L$GTKDIR/lib -no-undefined"
wolffd@0 61 export FONTCONFIG_CFLAGS=-I$GTKDIR/include/
wolffd@0 62 export FONTCONFIG_LIBS="-L$FONTCONFIGLIBDIR -lfontconfig"
wolffd@0 63 export FREETYPE2_CFLAGS=-I$FREETYPEINCLUDEDIR
wolffd@0 64 export FREETYPE2_LIBS="-L$FREETYPELIBDIR
wolffd@0 65 export PKG_CONFIG=$GTKDIR/bin/pkg-config
wolffd@0 66 export PKG_CONFIG_PATH=$GTKDIR/lib/pkgconfig
wolffd@0 67
wolffd@0 68 export PANGOFLAGS="--with-fontconfig --with-fontconfiglibdir$FONTCONFIGLIBDIR --with-fontconfigincludedir=$FONTCONFIGINCLUDEDIR --with-pangocairo"
wolffd@0 69
wolffd@0 70 </PRE>
wolffd@0 71 </CODE>
wolffd@0 72 <LI> Change directory to $ROOT and run configure:<BR>
wolffd@0 73 <CODE>
wolffd@0 74 <PRE>
wolffd@0 75 ./configure -C --prefix=$INSTALLROOT --without-gdk-pixbuf --with-mylibgd --disable-swig --without-x --disable-tcl --without-ipsepcola --with-codegens --enable-shared --disable-static --with-freetype=$GTKDIR/lib --enable-ltdl $PANGOFLAGS --without-gtk --without-gtkgl
wolffd@0 76
wolffd@0 77 </PRE>
wolffd@0 78 </CODE>
wolffd@0 79 When configure finishes, it lists all of the Graphviz features that have been
wolffd@0 80 enabled. If there are problems, you can check for errors in <TT>config.log</TT>.
wolffd@0 81 You may have to add or modify
wolffd@0 82 other flags and environment variables for <TT>configure</TT> to give you the
wolffd@0 83 settings you want. Run <TT>configure --help</TT>
wolffd@0 84 to see the allowed options and environment variables.
wolffd@0 85 <LI> Run <TT>make</TT>
wolffd@0 86 <LI> Run <TT>make install</TT>
wolffd@0 87 </OL>
wolffd@0 88 These builds create a feature-full version of Graphviz. You can tailor
wolffd@0 89 them to your wants. This is fairly simple for MinGW: just remove or reset
wolffd@0 90 the flag of the option you don't want. For Visual Studio, you will probably
wolffd@0 91 need to reset some of the values in <TT>config.h</TT> and some of the
wolffd@0 92 compile-time options.
wolffd@0 93 <HR>
wolffd@0 94 <P>
wolffd@0 95 <b>(2.21 &gt;= Graphviz versions &gt; 2.14)</b>
wolffd@0 96 <P>
wolffd@0 97 To simplify our build process, especially as most Windows users only
wolffd@0 98 want a binary version of the software, the Graphviz build for Windows
wolffd@0 99 now uses <A HREF="http://www.research.att.com/sw/tools/uwin/"><B>uwin</B></A>,
wolffd@0 100 an open-source Unix layer on top of Windows. In this
wolffd@0 101 environment, we can use essentially the same tools and process
wolffd@0 102 used on Unix. In particular, we do not have to maintain multiple build
wolffd@0 103 files.
wolffd@0 104 <P>
wolffd@0 105 To build Graphviz:
wolffd@0 106 <OL>
wolffd@0 107 <LI>
wolffd@0 108 Install the third-party libraries. This is most easily done by installing
wolffd@0 109 a Windows binary verion of <A HREF="http://www.gtk.org">GTK 2.0</A> or later.
wolffd@0 110 <LI>
wolffd@0 111 Download the Graphviz source package:<BR>Go to
wolffd@0 112 <A HREF=http://www.graphviz.org/Download_source.php>http://www.graphviz.org/Download_source.php</A>
wolffd@0 113 and copy over either the stable release <TT>graphviz-</TT><I>VERSION</I><TT>.tar.gz</TT>
wolffd@0 114 or the development source package <TT>graphviz-working.tar.gz</TT>.
wolffd@0 115 <LI>
wolffd@0 116 Unwrap the package:<BR>
wolffd@0 117 You can use, for example,<BR><BR>
wolffd@0 118 <TT>gunzip < graphviz-working.tar.gz | tar xf -</TT><BR>
wolffd@0 119 <SPACER TYPE=VERTICAL SIZE=10>
wolffd@0 120 <BR>
wolffd@0 121 Let <TT>$ROOT</TT> be the directory in which you stored the Graphviz source.
wolffd@0 122 <LI>
wolffd@0 123 Configure the package for your system:<BR><BR>
wolffd@0 124 <TT>cd $ROOT</TT><BR>
wolffd@0 125 <TT>configure --disable-shared --enable-static --with-mylibgd --disable-swig --without-x --without-tclsh --with-codegens --disable-ltdl</TT><BR><BR>
wolffd@0 126 You will probably want to provide additional arguments to
wolffd@0 127 <TT>configure</TT> to indicate where you have installed GTK, where
wolffd@0 128 you want the results installed (<TT>--prefix</TT>) and which
wolffd@0 129 additional optional packages you want built. Run <TT>configure --help</TT>
wolffd@0 130 to see the available set of arguments.
wolffd@0 131 <LI>
wolffd@0 132 Build Graphviz:<BR><BR>
wolffd@0 133 <TT>make install</TT><BR><BR>
wolffd@0 134 </OL>
wolffd@0 135 <P>
wolffd@0 136 Presumably, a similar approach would work with Cygwin or MinGW.
wolffd@0 137 The following are some notes by
wolffd@0 138 <A HREF="https://mailman.research.att.com/pipermail/graphviz-devel/2007/000444.html">Steve Roush</A>
wolffd@0 139 describing how he
wolffd@0 140 made a static build of the libraries on MinGW.
wolffd@0 141 <MENU>
wolffd@0 142 <LI> Install MinGW and Msys. This gives a mini GNU-like compile environment
wolffd@0 143 that produces Windows-compatible results.
wolffd@0 144 <LI> You may need to configure and build in Windows "Safe mode". Try
wolffd@0 145 ./configure in normal mode; if it dies with "fork" problems, use Safe mode.
wolffd@0 146 <LI> Edit the "configure" file.<BR>
wolffd@0 147 after this line:<BR>
wolffd@0 148 <CODE>DEFS=-DHAVE_CONFIG_H</CODE><BR>
wolffd@0 149 add these lines:<BR>
wolffd@0 150 <CODE>
wolffd@0 151 <PRE>
wolffd@0 152 case "$host_os" in
wolffd@0 153 mingw*)
wolffd@0 154 DEFS="$DEFS -DWIN32 -DMSWIN32"
wolffd@0 155 ;;
wolffd@0 156 esac
wolffd@0 157 </PRE>
wolffd@0 158 </CODE>
wolffd@0 159 <LI> run configure:<BR>
wolffd@0 160 <CODE>
wolffd@0 161 <PRE>
wolffd@0 162 ./configure --enable-static=yes --enable-shared=no
wolffd@0 163 --prefix=/usr/local/ --with-libgd=no --enable-ltdl=no --disable-swig
wolffd@0 164 --disable-sharp --disable-guile --disable-io --disable-java
wolffd@0 165 --disable-lua --disable-ocaml --disable-perl --disable-php
wolffd@0 166 --disable-python --disable-ruby --disable-tcl
wolffd@0 167 </PRE>
wolffd@0 168 </CODE>
wolffd@0 169 <LI> edit lib/Makefile<BR>
wolffd@0 170 replace these lines:<BR>
wolffd@0 171 <CODE>
wolffd@0 172 <PRE>
wolffd@0 173 SUBDIRS = cdt graph agraph gd pathplan agutil sfio vmalloc ast vpsc \
wolffd@0 174 circogen dotgen fdpgen neatogen twopigen common pack gvc \
wolffd@0 175 ingraphs expr
wolffd@0 176 </PRE>
wolffd@0 177 </CODE>
wolffd@0 178
wolffd@0 179 with these lines:<BR>
wolffd@0 180 <CODE>
wolffd@0 181 <PRE>
wolffd@0 182 SUBDIRS = cdt graph agraph gd pathplan vpsc \
wolffd@0 183 circogen dotgen fdpgen neatogen twopigen common pack gvc \
wolffd@0 184 ingraphs
wolffd@0 185
wolffd@0 186 make # builds most of "lib" (see Makefile changes), cmd/dot and
wolffd@0 187 cmd/tools - stops on cmd/gvpr
wolffd@0 188 make install
wolffd@0 189 </PRE>
wolffd@0 190 </CODE>
wolffd@0 191 </MENU>
wolffd@0 192 here is the command line I used to build "simple.c" (dot.demo/simple.c),
wolffd@0 193 after adding a few lines based on
wolffd@0 194 https://mailman.research.att.com/pipermail/graphviz-interest/2006q2/003586.html
wolffd@0 195
wolffd@0 196
wolffd@0 197 <CODE>
wolffd@0 198 <PRE>
wolffd@0 199 X=simple;gcc -v -I'/usr/local/include/graphviz' -I'/usr/local/include'
wolffd@0 200 -o $X -O $X.c -L/usr/local/lib -L/usr/local/lib/graphviz -lgvc -lgraph
wolffd@0 201 -lpathplan -lcdt -lgvplugin_core -lgvplugin_dot_layout
wolffd@0 202 -lgvplugin_neao_layout -lgvplugin_gd -lgvplugin_pango -lgvc -lpathplan
wolffd@0 203 </PRE>
wolffd@0 204 </CODE>
wolffd@0 205 <P>
wolffd@0 206 If you
wolffd@0 207 desire to build directly using Visual Studio or other non-Unix-based
wolffd@0 208 environment, you will need to derive the necessary information from the
wolffd@0 209 supplied Makefiles.
wolffd@0 210 <HR>
wolffd@0 211 <P>
wolffd@0 212 <b>(2.14 &gt;= Graphviz versions &gt;= 2.3)</b>
wolffd@0 213 <P>
wolffd@0 214 We build Graphviz on Windows using the MS Visual C++ 6.0 compiler
wolffd@0 215 only. The simplest way to build the software from source on Windows is as
wolffd@0 216 follows:
wolffd@0 217 <OL>
wolffd@0 218 <LI>
wolffd@0 219 Download the Windows source package from:
wolffd@0 220 <A HREF=http://www.graphviz.org/Download_windows.php>http://www.graphviz.org/Download_windows.php</A>.
wolffd@0 221 </LI>
wolffd@0 222 <SPACER TYPE=VERTICAL SIZE=10>
wolffd@0 223 <LI>
wolffd@0 224 Unwrap the package:<BR>
wolffd@0 225 If you have Unix tools available, you can use
wolffd@0 226 <SPACER TYPE=VERTICAL SIZE=10>
wolffd@0 227 <TT>gunzip < graphviz-win.tgz | tar xf -</TT><BR>
wolffd@0 228 <SPACER TYPE=VERTICAL SIZE=10>
wolffd@0 229 If not, double click on the file and WinZip should start up and let you
wolffd@0 230 store all of the files into a directory.<BR>
wolffd@0 231 Let <TT>$ROOT</TT> be the directory in which you stored the Graphviz source.
wolffd@0 232 </LI>
wolffd@0 233 <SPACER TYPE=VERTICAL SIZE=10>
wolffd@0 234 <LI>
wolffd@0 235 Add the third-party libraries:
wolffd@0 236 <SPACER TYPE=VERTICAL SIZE=10>
wolffd@0 237 <UL TYPE=DISC>
wolffd@0 238 <LI>
wolffd@0 239 zlib 1.1.3 <A HREF=http://www.gzip.org/zlib/>http://www.gzip.org/zlib/</A>
wolffd@0 240 <LI>
wolffd@0 241 libpng 1.0.6 <A HREF=http://www.libpng.org/pub/png>http://www.libpng.org/pub/png</A>
wolffd@0 242 <LI>
wolffd@0 243 jpeg-6b 62 <A HREF=http://www.ijg.org/>http://www.ijg.org/</A>
wolffd@0 244 <LI>
wolffd@0 245 freetype 2.1.7 <A HREF=http://freetype.sourceforge.net/>http://freetype.sourceforge.net/</A>
wolffd@0 246 <LI>
wolffd@0 247 expat <A HREF=http://expat.sourceforge.net/>http://expat.sourceforge.net/</A>
wolffd@0 248 </UL>
wolffd@0 249 <SPACER TYPE=VERTICAL SIZE=10>
wolffd@0 250 The versions should be at least the ones indicated.
wolffd@0 251 You can download the files from
wolffd@0 252 <a href=http://www.graphviz.org/Misc/third-party.zip>http://www.graphviz.org/Misc/third-party.zip</a>.
wolffd@0 253 Unzip the package in the <TT>$ROOT</TT> directory; this will create a subdirectory called
wolffd@0 254 <TT>third-party</TT>.
wolffd@0 255 Or you can obtain the libraries yourself, and install
wolffd@0 256 them in <TT>$ROOT\third-party</TT>
wolffd@0 257 Also note that these libraries come with the binary release.
wolffd@0 258 </LI>
wolffd@0 259 <SPACER TYPE=VERTICAL SIZE=10>
wolffd@0 260 <LI>
wolffd@0 261 Build the software in one of the following ways:<BR>
wolffd@0 262 <UL TYPE=DISC>
wolffd@0 263 <LI> Run the script <TT>$ROOT\build.bat</TT> while in the <TT>$ROOT</TT>
wolffd@0 264 directory. You'll first want to check
wolffd@0 265 that the <TT>vc</TT> variable points to your local installation of visual C.
wolffd@0 266 Obviously, this should be run in a DOS command window.
wolffd@0 267 <LI> The file <TT>$ROOT\ws\graphviz.dsw</TT>
wolffd@0 268 is the main workspace for the Graphviz libraries and graph drawing programs.
wolffd@0 269 The file
wolffd@0 270 <TT>$ROOT\ws\tools.dsw</TT> provides the workspace for the
wolffd@0 271 additional Graphviz tools. Double-clicking on these files will open the
wolffd@0 272 workspaces using the MS Visual Studio, from which you can use the Build
wolffd@0 273 menu item to create the various libraries and programs.
wolffd@0 274 <PP>
wolffd@0 275 Note that we have avoided all dependencies (i.e., there are no .dep files)
wolffd@0 276 because we found they tended to include absolute pathnames.
wolffd@0 277 If necessary, follow the order used in <TT>build.bat</TT> to be safe.
wolffd@0 278 <LI> If you have a Unix environment, with a real ksh, run the script
wolffd@0 279 <TT>$ROOT\wmake.sh</TT>
wolffd@0 280 after setting the PATH, LIB and INCLUDE shell variables to the paths where
wolffd@0 281 the Visual C programs are installed on your machine, and the associated
wolffd@0 282 library and include file directories.
wolffd@0 283 </UL>
wolffd@0 284 </OL>
wolffd@0 285 <P> Once built, all of the libraries and programs will be found in
wolffd@0 286 either the Release or Debug subdirectory of the corresponding source
wolffd@0 287 directory. If you wish to install
wolffd@0 288 the software somewhere, edit the file <TT>$ROOT\install.bat</TT> to
wolffd@0 289 set the variable <TT>root</TT> to be the absolute pathname of the
wolffd@0 290 directory where you want
wolffd@0 291 the software installed, and then run the script <TT>$ROOT\install.bat</TT>
wolffd@0 292 from the <TT>$ROOT</TT> directory.
wolffd@0 293 <P>
wolffd@0 294 If you want to change source files, you can just do it and rebuild.
wolffd@0 295 If, however, you want to add new files or projects, you will
wolffd@0 296 have to redo the makefiles or scripts.
wolffd@0 297 <P>
wolffd@0 298 If you have problems or questions, please contact us at
wolffd@0 299 <A href=mailto:erg@research.att.com>erg@research.att.com</A>.
wolffd@0 300 </body>
wolffd@0 301 </html>