This morning I couldn’t sleep, so got up to sort a few things out – one of those needed Thomas Boutell’s GD library which I don’t have installed on the MBP. I’ve had a bit of hassle sorting it out so this is pretty much Google-bait for those who have had the same problem and are looking for a resolution.
There’s an installation in macports.org, under gd2-nox11. This installs the libraries, but perl has a problem getting its own GD.pm installed via CPAN:
Running make test
PERL_DL_NONLAZY=1 /usr/bin/perl “-MExtUtils::Command::MM” “-e” “test_harness(0, ‘blib/lib’, ‘blib/arch’)” t/*.t
t/GD……….Can’t load ‘./blib/arch/auto/GD/GD.bundle’ for module GD: dlopen(./blib/arch/auto/GD/GD.bundle, 2): Symbol not found: _libiconv_close
Referenced from: /opt/local/lib/libgd.2.dylib
Expected in: flat namespace
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.
Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 1-12
Failed 12/12 tests, 0.00% okay
A bit of digging turned up that Macports GD2 port has a broken gdlib-config, which confuses matters and makes sure iconv can’t be found. This was causing
- Install the macports.org port of GD2:
- sudo port install gd2-nox11
- Download the GD CPAN module.
- Build the makefile with
- Now edit the Makefile (not Makefile.PL) to add the following to EXTRALIBS and LDLOADLIBS:
- -L/opt/local/lib -liconv
- Now build with:
- Now test (optional):
- make test
At this point the following command shouldn’t give you any errors – if it does, the gdlib-config bug isn’t the problem!
- No bugs? Install it:
- sudo make install
- Job done – make a cup of tea