Re: [circos] Recompiling GD with Freetype support

1,892 views
Skip to first unread message

Martin Krzywinski

unread,
Aug 17, 2012, 10:01:17 PM8/17/12
to circos-data-...@googlegroups.com

gd is very frustrating. I'm very close to dumping using GD and switching to another graphics engine. The amount of trouble people go through to just get the thing installed!

It looks like gd is detecting freetype, but maybe during the linking phase this is failing. My gdlib-config produces

GD library  2.0.35
includedir: /usr/local/include
cflags:     -I/usr/local/include
ldflags:     -L/usr/X11/lib -Wl,-framework,CoreServices -Wl,-framework,ApplicationServices  -L/usr/X11/lib  -L/usr/X11/lib
libs:       -lXpm -lX11 -ljpeg -lfontconfig -lfreetype -lpng12 -lz  -liconv
libdir:     /usr/local/lib
features:   GD_XPM GD_JPEG GD_FONTCONFIG GD_FREETYPE GD_PNG GD_GIF GD_GIFANIM GD_OPENPOLYGON

Note the ldflags field - yours is empty.

I suggest trying another version of gdlib - e.g. 0.33. See whether that makes any difference. 

Martin Krzywinski
science + art




On Thu, Aug 16, 2012 at 6:12 AM, Andrew Garber <garb...@gmail.com> wrote:
Martin,

For someone who is a novice in Perl, what steps does one take to install Freetype and recompile gdlib?  I feel like in this process of installing Circos I've tried to install GD and libgd a dozen times; do I need to delete those copies and start again after installing Freetype?  I believe I installed Freetype (and libjpeg, lib png, etc.) after I installed libgd and GD. 

I've gotten here:


** Configuration summary for gd 2.0.33:

   Support for PNG library:          yes
   Support for JPEG library:         yes
   Support for Freetype 2.x library: yes
   Support for Fontconfig library:   yes
   Support for Xpm library:          yes
   Support for pthreads:             yes


(Though it looks like there were a couple of errors on the make install of gdlib) ...and this is what I have when I run gdlib-config --all:

new-host:GD-2.46 root$ gdlib-config --all
GD library  2.0.34
includedir: /usr/include
cflags:     -I/usr/include
ldflags:    
libs:       -lpng -lz  -liconv
libdir:     /usr/lib
features:   GD_PNG GD_GIF GD_GIFANIM GD_OPENPOLYGON



No Freetype support.  I've got all of the other Circos modules installed, just Freetype is holding me back.  Any insight would be appreciated; I'm running Mac OSX 10.6.8, and have googled extensively (especially Paulo Nuin's helpful post), but there doesn't seem to be much instruction available on how to recompile GD with Freetype support.


Thanks!
Andrew


P.S.  These are the file versions I've downloaded: 

GD 2.46
gdlib 2.0.34
libjpeg 8d
libpng 1.5.12
zlib 1.2.7
freetype 2.4.10

--
You received this message because you are subscribed to the Google Groups "Circos" group.
To view this discussion on the web visit https://groups.google.com/d/msg/circos-data-visualization/-/C-GgWrR2Gu8J.
To post to this group, send email to circos-data-...@googlegroups.com.
To unsubscribe from this group, send email to circos-data-visual...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/circos-data-visualization?hl=en.

Martin Krzywinski

unread,
Oct 13, 2012, 5:50:19 PM10/13/12
to circos-data-...@googlegroups.com
From the error it looks like your true type font support is broken in
GD, which reports

> Support for Fontconfig library: no

despite the fact that gd has access to the library, since GD_FREETYPE appears

> features: GD_JPEG GD_FREETYPE GD_PNG GD_GIF GD_GIFANIM GD_OPENPOLYGON

When you run 'perl Makefile.PL' for GD (2.46), I get

> perl Makefile.PL
Notice: Type perl Makefile.PL -h for command-line option summary.

Configuring for libgd version 2.0.33.
Checking for stray libgd header files...none found.

Included Features: GD_XPM GD_JPEG GD_FONTCONFIG GD_FREETYPE
GD_PNG GD_GIF GD_UNCLOSEDPOLY GD_ANIMGIF GD_FTCIRCLE VERSION_33
GD library used from: /usr
Writing Makefile for GD

Do you see "GD_FREETYPE" reported in your case?

When you run

> cd demos
> perl ./ttf.pl > test.png

you should get the attached image if things are working. If not, what
error are you seeing?

Martin Krzywinski
science + art
http://mkweb.bcgsc.ca



On Tue, Oct 9, 2012 at 8:18 AM, Melissa <melissa...@gmail.com> wrote:
> Hi, I finally have all the Perl modules installed ... manually. All looks ok
> after running "./test.modules". Here's my GD library:
>
> Support for PNG library: yes
> Support for JPEG library: yes
> Support for Freetype 2.x library: yes
> Support for Fontconfig library: no
> Support for Xpm library: no
> Support for pthreads: yes
>
> Here's how "gdlib-config --all" looks like:
>
> GD library 2.0.34
> includedir: /usr/local/include
> cflags: -I/usr/local/include
> ldflags: -L/usr/local/lib -L/usr/lib
> libs: -ljpeg -lfreetype -lpng12 -lz -lm
> libdir: /usr/local/lib
> features: GD_JPEG GD_FREETYPE GD_PNG GD_GIF GD_GIFANIM GD_OPENPOLYGON
>
> but when I run the example, I got errors like:
> at /home/.../circos-0.62-1/bin/../lib/Circos/Error.pm line 332
> Circos::Error::fatal_error('font', 'no_ttf',
> '/home/.../circos-0.62-1/e...') called at
> /home/.../circos-0.62-1/bin/../lib/Circos/Font.pm line 192
> Circos::Font::get_label_size('font_file',
> '/home/.../circos-0.62-1/e...', 'size', 10, 'text', 'abc123') called at
> /home/.../circos-0.62-1/bin/../lib/Circos/Font.pm line 243
> Circos::Font::sanity_check() called at
> /home/.../circos-0.62-1/bin/../lib/Circos.pm line 720
> Circos::run('Circos', 'configfile', 'etc/circos.conf', 'debug_group',
> 'summary,timer') called at ../bin/circos line 233
>
> I've tried your advice to recompile it or install other version, namely
> 2.0.33 (see below).
>
> GD library 2.0.33
> includedir: /usr/local/include
> cflags: -I/usr/local/include
> ldflags: -L/usr/local/lib -L/usr/lib
> libs: -ljpeg -lfreetype -lpng12 -lz -lm
> libdir: /usr/local/lib
> features: GD_JPEG GD_FREETYPE GD_PNG GD_GIF
>
> I still get the same errors. So ... Help!!!!!!!!!
>
> --
> You received this message because you are subscribed to the Google Groups
> "Circos" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/circos-data-visualization/-/sFTH-giPEMEJ.
test.png

Melissa

unread,
Oct 29, 2012, 10:03:23 AM10/29/12
to circos-data-...@googlegroups.com
Hey Martin, 

Thanks for your reply. What happen after that is I followed your advice in other post to re-compile everything and accidentally uninstalled zlib. The results were catastrophic... I wiped off my entire kernel! -_- After coming back from a holiday, I installed new Ubuntu, circos and GD library. Circos seems to be working ok after i run the example. 

So... lesson learnt. Never... neeeeeeeeeever uninstall zlib!

Cheers,Melissa.

Martin Krzywinski

unread,
Oct 30, 2012, 3:02:45 PM10/30/12
to circos-data-...@googlegroups.com
Oh, no!

But, at least a lesson accompanied the disaster :)

Martin Krzywinski
science + art
http://mkweb.bcgsc.ca



> --
> You received this message because you are subscribed to the Google Groups
> "Circos" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/circos-data-visualization/-/2JcJLPMWoe8J.

Jesse

unread,
Apr 13, 2014, 1:39:32 AM4/13/14
to circos-data-...@googlegroups.com
Hello,

I was having the same exact problem and solved it by installing a new version of Xcode, brew uninstalling gdlib and freetype, and installing GD by using the "Perl Makefile.PL" then "make" then install.
Took me an entire work day to find a fix for this. Good luck!
To unsubscribe from this group, send email to circos-data-visualization+unsub...@googlegroups.com.

Haiting

unread,
Apr 14, 2014, 7:22:31 PM4/14/14
to circos-data-...@googlegroups.com
Hi Martin,

I changed to GD-2.0.35 and have the following gdlib-config which looks right. 

GD library  2.0.35
includedir: /usr/local/include
cflags:     -I/usr/local/include
ldflags:     -L/Users/pm/anaconda/lib  -L/Users/pm/anaconda/lib  -L/usr/X11/lib
libs:       -lXpm -lX11 -ljpeg -lfontconfig -lfreetype -lpng -lz  -liconv
libdir:     /usr/local/lib
features:   GD_XPM GD_JPEG GD_FONTCONFIG GD_FREETYPE GD_PNG GD_GIF GD_GIFANIM GD_OPENPOLYGON

But I still have the same error as I have with GD-2.50. Any idea how to resolve this? I am using circos-0.66, by the way. Thanks! 

 *** CIRCOS ERROR ***

  There was a problem with True Type font support. Circos could not render text
  from the font file

      /Applications/circos-0.66/fonts/symbols/symbols.otf

  Please check that gd (system graphics library) and GD (Perl's interface to gd)
  are compiled with True Type support.


Best,
Haiting. 
To unsubscribe from this group, send email to circos-data-visualization+unsub...@googlegroups.com.

Haiting

unread,
Apr 15, 2014, 12:32:16 AM4/15/14
to circos-data-...@googlegroups.com
Hi Martin, thanks for you idea of using gdlib-2.0.35 or 0.33. 

I Installed gdlib-2.0.35 and the gdlib-config looked well. However, after installing GD-2.53 in perl, there were two errors with test.modules: 

fail GD is not usable (it or a sub-module is missing)
fail GD::Image is not usable (it or a sub-module is missing)

Anyone knows what version of GD should I install? 

I tried installed libgd-2.1.0 or libgd-2.1.0-rc2, then installed GD-2.53, the fail GD errors were gone, however, the gdlib-config does not include the right font for the program to run. 

Martin Krzywinski

unread,
Apr 15, 2014, 4:12:59 PM4/15/14
to circos-data-...@googlegroups.com
Did you install GD manually? Did the installation produce any aberrant messages?

I'm using GD 2.43 myself. Recent changes are mostly minor bug fixes. 

> however, the gdlib-config does not include the right font for the program to run. 

What do you mean by "include the right font"? Did libgd-2.1.0 not compile with free type support?


Martin Krzywinski
science + art



To unsubscribe from this group and stop receiving emails from it, send an email to circos-data-visual...@googlegroups.com.

To post to this group, send email to circos-data-...@googlegroups.com.

Haiting

unread,
Apr 16, 2014, 5:57:54 PM4/16/14
to circos-data-...@googlegroups.com
I tried GD-2.43, and it still does not work: 

when run ./test.modules, it shows:
fail GD is not usable (it or a sub-module is missing)
fail GD::Image is not usable (it or a sub-module is missing)

Other things are ok. 

The following are warnings when I run "make" after "perl Makefile.PL"

ld: warning: ignoring file /usr/local/lib/libjpeg.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: ignoring file /Users/peijunma/anaconda/lib/libfreetype.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: ignoring file /usr/local/lib/libpng.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: ignoring file /usr/local/lib/libz.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: ignoring file /usr/local/lib/libgd.dylib, file was built for unsupported file format which is not the architecture being linked (i386)

If I use libgd-2.1.0, it does not compile with free type support or PNG support. It only has "GD_JPEG GD_GIF GD_GIFANIM GD_OPENPOLYGON" in the feature line. 

But if I use libgd-2.1.0, everything is ok when I run ./test.modules.

Also I could not install GD with brew after compiling gdlib-2.0.35, 

These are the messages when I run "brew install GD": 
Warning: You seem to have osx-gcc-installer installed.
Homebrew doesn't support osx-gcc-installer. It causes many builds to fail and
is an unlicensed distribution of really old Xcode files.
Please install the CLT or Xcode 4.6.3.
Warning: It appears you have MacPorts or Fink installed.
Software installed with other package managers causes known problems for
Homebrew. If a formula fails to build, uninstall MacPorts/Fink and try again.
Warning: gd-2.1.0_2 already installed, it's just not linked

Hope this offers some clue to you expert. Thanks so much. Martin.
To unsubscribe from this group, send email to circos-data-visualization+unsubsc...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Circos" group.
To unsubscribe from this group and stop receiving emails from it, send an email to circos-data-visualization+unsub...@googlegroups.com.

Paulo Nuin

unread,
Apr 16, 2014, 11:00:45 PM4/16/14
to circos-data-...@googlegroups.com
Your libs were compiled to i386 and they should have been compiled to x64. I would uninstall all your libs and try again. And install a new copy ox Xcode and install the common line applications. And the idea of removing Fink/Macports is good, they are obsolete and I guess not maintained anymore, as Homebrew.


To unsubscribe from this group and stop receiving emails from it, send an email to circos-data-visual...@googlegroups.com.

Haiting

unread,
Apr 16, 2014, 11:17:59 PM4/16/14
to circos-data-...@googlegroups.com
I installed xcode version 4.6.3 (4H1503). Can you clarify uninstall all the libraries? You mean all the perl libraries or just the gdlib? I am not familiar with uninstallation. Also do you know how to remove Fink/Macports? I appreciate some reliable links since I don't want to remove libraries thus that the system would be down. Thanks so much, Nuin!

Paulo Nuin

unread,
Apr 16, 2014, 11:25:02 PM4/16/14
to circos-data-...@googlegroups.com
Remove or reinstall (fresh compilation) all the libs (dylib) mentioned on the warnings. And your freetype is under anaconda, ideally it should be somewhere the whole system can find.


To unsubscribe from this group and stop receiving emails from it, send an email to circos-data-visual...@googlegroups.com.

Haiting

unread,
Apr 19, 2014, 10:08:28 PM4/19/14
to circos-data-...@googlegroups.com
I installed gdlib with brew, and got GD 2.1.0 config as the following:

GD library  2.1.0
includedir: /usr/local/Cellar/gd/2.1.0_2/include
cflags:     -I/usr/local/Cellar/gd/2.1.0_2/include
ldflags:     -L/usr/X11/lib -L/usr/local/opt/jpeg/lib
libs:       -ljpeg -lz  -L/usr/local/Cellar/libpng/1.6.10/lib -lpng16 -L/usr/local/Cellar/freetype/2.5.3_1/lib -lfreetype -lz -lbz2 -L/usr/local/Cellar/libpng/1.6.10/lib -lpng16 -L/usr/local/opt/fontconfig/lib -lfontconfig -lfontconfig -L/usr/local/opt/libtiff/lib -ltiff -liconv
libdir:     /usr/local/Cellar/gd/2.1.0_2/lib
features:   GD_TIFF GD_JPEG GD_FONTCONFIG GD_FREETYPE GD_PNG GD_GIF GD_GIFANIM GD_OPENPOLYGON

But when I "perl Makefile.PL" in the GD-2.3 folder, I got this error:

found gd.h header file in /usr/local/include/gd.h, but it is expected at /usr/local/Cellar/gd/2.1.0_2/include/gd.h. This may cause compile errors!

and I got these when I run "./test.modules ": 
fail GD is not usable (it or a sub-module is missing)
fail GD::Image is not usable (it or a sub-module is missing)

Any idea what is the issue with GD-2.53? I am use perl 5.12, should I update to 5.16? Thanks!
To unsubscribe from this group, send email to circos-data-visualization+unsubs...@googlegroups.com.

-- 
You received this message because you are subscribed to the Google Groups "Circos" group.
To unsubscribe from this group and stop receiving emails from it, send an email to circos-data-visualization+unsubs...@googlegroups.com.

To post to this group, send email to circos-data-...@googlegroups.com.
Visit this group at http://groups.google.com/group/circos-data-visualization.
For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups "Circos" group.
To unsubscribe from this group and stop receiving emails from it, send an email to circos-data-visualization+unsub...@googlegroups.com.
To post to this group, send email to circos-data-...@googlegroups.com.
Visit this group at http://groups.google.com/group/circos-data-visualization.
For more options, visit https://groups.google.com/d/optout.

Haiting

unread,
Apr 21, 2014, 9:49:18 AM4/21/14
to circos-data-...@googlegroups.com
Never mind. Set it up on a different machine. Thanks so much for your helpful suggestions Martin and Nuin!

Sincerely,
Haiting. 

chenhu...@gmail.com

unread,
Dec 26, 2015, 5:22:30 AM12/26/15
to Circos
Hi Martin,
I am a very new one to use circos. I find I have a same problem, please help me, thank you so much.
when i run

> cd demos
> perl ./ttf.pl > test.png
I get these:
2.53 at ./ttf.pl line 10.
libgd was not built with FreeType font support
What should I do now? is there somthing wrong with my freetype?


在 2012年8月18日星期六 UTC+8上午10:01:17,Martin写道:
To unsubscribe from this group, send email to circos-data-visualization+unsub...@googlegroups.com.

Martin Krzywinski

unread,
Jan 5, 2016, 6:48:38 PM1/5/16
to circos-data-...@googlegroups.com
That error message suggests that when libgd was compiled, the FreeType was not included in the process, so libgd doesn't have access to the functions in the FreeType library.

If you have since installed FreeType, you'll need to recompile libgd.


Martin Krzywinski
science + art



To unsubscribe from this group, send email to circos-data-visual...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Circos" group.
To unsubscribe from this group and stop receiving emails from it, send an email to circos-data-visual...@googlegroups.com.
To post to this group, send email to circos-data-...@googlegroups.com.

leonardo alves

unread,
Mar 21, 2019, 5:30:56 PM3/21/19
to Circos
Hi Martin
I am stucked on it...
and got the same check results, but I keep getting the error message:

$ perl ttf.pl > test.png
2.53 at ttf.pl line 10.

libgd was not built with FreeType font support

I already reinstalled gdlib and everything is fine:
$ /usr/local/bin/gdlib-config --all
GD library  2.1.0
includedir: /usr/local/include
cflags:     -I/usr/local/include
ldflags:     -L/usr/local/lib
libs:       -ljpeg -lz -lm  -L/usr/local/lib -lpng16 -L/usr/local/lib -lfreetype -lz -lfontconfig -lfreetype   -lfontconfig
libdir:     /usr/local/lib
features:   GD_JPEG GD_FONTCONFIG GD_FREETYPE GD_PNG GD_GIF GD_GIFANIM GD_OPENPOLYGON

Do you have any idea what should be happening here? The libs seem to be located at the right place.
$ ls /usr/local/lib/*gd*
/usr/local/lib/libgd.a   /usr/local/lib/libgd.so    /usr/local/lib/libgd.so.3.0.0
/usr/local/lib/libgd.la  /usr/local/lib/libgd.so.3  /usr/local/lib/libgd.so.3.0.5
$ ls /usr/local/lib/*freetype*
/usr/local/lib/libfreetype.a   /usr/local/lib/libfreetype.so    /usr/local/lib/libfreetype.so.6.5.0
/usr/local/lib/libfreetype.la  /usr/local/lib/libfreetype.so.6
 
And also:
$ ls /usr/local/include/freetype2/freetype/
(lot of headers)

To unsubscribe from this group, send email to circos-data-visualization+unsub...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Circos" group.
To unsubscribe from this group and stop receiving emails from it, send an email to circos-data-visualization+unsub...@googlegroups.com.

leonardo alves

unread,
Mar 22, 2019, 10:16:12 AM3/22/19
to Circos
It looks like the PERL GD module is not installing well. I tried reinstalling it and then make test and that's the report.

...
PERL_DL_NONLAZY=1 "/usr/bin/perl" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/GD.t ........ Can't load './blib/arch/auto/GD/GD.so' for module GD: ./blib/arch/auto/GD/GD.so: undefined symbol: gdImageCreateFromJpegCtx at /usr/lib64/perl5/DynaLoader.pm line 190.
 at t/GD.t line 14.
Compilation failed in require at t/GD.t line 14.
BEGIN failed--compilation aborted at t/GD.t line 14.
t/GD.t ........ Dubious, test returned 2 (wstat 512, 0x200)
Failed 12/12 subtests
t/Polyline.t .. Can't load '/home/leonardo.alves/ferramentas/circos-0.69-6/GD-2.53/blib/arch/auto/GD/GD.so' for module GD: /home/leonardo.alves/ferramentas/circos-0.69-6/GD-2.53/blib/arch/auto/GD/GD.so: undefined symbol: gdImageCreateFromJpegCtx at /usr/lib64/perl5/DynaLoader.pm line 190.
 at /home/leonardo.alves/ferramentas/circos-0.69-6/GD-2.53/blib/lib/GD/Polyline.pm line 45.
Compilation failed in require at /home/leonardo.alves/ferramentas/circos-0.69-6/GD-2.53/blib/lib/GD/Polyline.pm line 45.
BEGIN failed--compilation aborted at /home/leonardo.alves/ferramentas/circos-0.69-6/GD-2.53/blib/lib/GD/Polyline.pm line 45.
Compilation failed in require at t/Polyline.t line 10.
BEGIN failed--compilation aborted at t/Polyline.t line 10.
t/Polyline.t .. Dubious, test returned 2 (wstat 512, 0x200)
Failed 1/1 subtests

Test Summary Report
-------------------
t/GD.t      (Wstat: 512 Tests: 1 Failed: 1)
  Failed test:  1
  Non-zero exit status: 2
  Parse errors: Bad plan.  You planned 12 tests but ran 1.
t/Polyline.t (Wstat: 512 Tests: 0 Failed: 0)
  Non-zero exit status: 2
  Parse errors: Bad plan.  You planned 1 tests but ran 0.
Files=2, Tests=1,  0 wallclock secs ( 0.01 usr  0.01 sys +  0.03 cusr  0.00 csys =  0.05 CPU)
Result: FAIL
Failed 2/2 test programs. 1/1 subtests failed.
make: *** [test_dynamic] Error 2
To unsubscribe from this group, send email to circos-data-visualization+unsub...@googlegroups.com.

leonardo alves

unread,
Mar 25, 2019, 9:30:58 AM3/25/19
to Circos
Well, for future users:
I updated libgd and perl::GD to the latest versions and the error was fixed.
Now: libgd 2.2.5 / perl::GD 2.71
Reply all
Reply to author
Forward
0 new messages