Graphviz Issue Tracker
Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000865graphvizBuild/Installpublic2005-04-06 03:002011-04-28 04:03
ReporterAndrew Schetinin 
Assigned Toellson 
PlatformOSx86-Linux-RedHat ES 3.0 WS updaOS Version
Summary0000865: Compiling graphviz on Linux - dot cannot find Helvetica (fontconfig problem?)

For some time I used the graphviz-2.2-1.fc1.i386.rpm
and it worked just fine for me. Then I found a minor problem
with generated CMAP files, which I need to work around.
The problem is that in the input code like

DOT transforms single quotes to &-encoded XML entities,
thus making JavaScript nonworking. The solution would be
to do not mask single quotes - it is unnecessary inside
double quotes.

I've downloaded the sources of graphviz graphviz-2.2.tar.gz,
and fixed that problem (the fix is not generic, it will work
for my specific input, but I'm not sure about other inputs).

Now, when I run the compiled ./dot -Tpng -oa.png,
it says that it cannot find Helvetica font, and the generated png image
has wrong layout because of missing font.
I've already met a similar problem while working with RedHat73 version
of graphviz, because that version does not work with fontconfig.
It looks like my compiled binary also does not use fontconfig,
which is strange - ./configure reported that it locates fontconfig
headers and libraries, it only did not locate fontconfig-config.
I tried to find fontconfig-config with no success. It does not seem
to be part of fontconfig-devel, which was installed on my system
by default.

The question is: how to compile graphviz properly, so it will use
fontconfig and locate all necessary fonts?
I did not find hints in FAQs and documentation.

BTW, I do not understand why my compiled dot searches for Helvetica
while the version from RPM uses Times-Roman (if I'm not mistaken).

Thank you in advance.

Additional Information

Fontconfig has moved to the pkg-config mechanism. Future releases of Graphviz will use that, but
I think the warning about not finding fontconfig-config doesn't matter as long as it reported that it found the header and library.
Does "ldd `which dot`" show libfontconfig ? (Or in the build tree, use: "libtool --mode=execute ldd ./dot")

Are you saying that ./test/ is not explicitly setting "Helvetica" as its font?

Oops I just noticed that was attached to the report.

It does contain explicit selection of Helvetica, which explains why it is not searching for the default Times-Roman.

Did you ./configure --with-mylibgd ? Does the ldd output show "libgd" or "libgvgd" ?

[ellson] > Hi John,
> I've understood what was the problem, or at least fixed it
> First I have that RPM package installed, and it put all libraries under
> /usr/local/lib/graphviz/
It shouldn't. It should install all its libraries in /usr/lib/graphviz/
Are you sure that these aren't from a previous locally-built install? The default prefix for
local builds is /usr/local.

> Then, before compiling graphviz sources, I removed that RPM package by
> running 'rpm -e graphviz'
> It removed the package but not libraries.

You might also want to do a "make unistall" from your local build tree.

Also. Graphviz uses the builtin -rpath mechanism to find its libraries and
doesn't need anything in LD_LIBRARY_PATH. If you have
LD_LIBRARY_PATH set that might cause it to find the wrong libraries.

> I've understood it after
> looking on output of 'ldd `which ./dot`' - thank you for the hint
> When executing, dot worked with those libraries, and this somehow cased
> the problem with fonts.
> I renamed '/usr/local/lib/graphviz' to '/usr/local/lib/graphviz-save',
> so that ld could not find them.
> Then I put all the libraries compiled from sources instead of them, and
> dot started to work correctly.
> I still do not understand why the "old" libraries did not find fonts -
> they are from the same graphviz version, just from RPM.
RPMs built for vanilla RH73 or RH9 systems don't have fontconfig support.

> Anyway, I think you may assume this case closed.

OK Good.

> Most probably, I should do "make install" to have all the things on
> their places.
The -rpath mechanism assumes installation.

If you are building locally you can build for any location you like by use of ./configure --prefix=/my/install/location/
Graphviz will be installed in bin/, lib/, share/, ... under this prefix.

> BTW, could you please tell me if it is possible to link dot statically
> with libraries like 'libgraph', 'libcommon', 'libgvrender', etc?

You are supposed to be able to "./configure --disable-shared --enable-static" but I think there
was a bug report on this recently.

TagsNo tags attached.
VERSION     2.2.1
Attached Files

- Relationships

-  Notes
There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
2011-04-28 04:03 user1 New Issue
2011-04-28 04:03 user1 Assigned To => user695

MantisBT 1.2.5[^]
Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker