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

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