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