Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[Q] Installing GD

5 views
Skip to first unread message

eric...@gmail.com

unread,
Sep 25, 2006, 6:38:40 PM9/25/06
to
I am having trouble installing the GD perl module. Using MCPAN, won't
work, so I am attempting to do it manually, but iconv is causing me
problems. Any help in getting this module installed would be
appreciated.

If it matters, I am running MacOSX 10.4.x and have used DarwinPorts
(now MacPorts) to install various things like iconv and gd2.

Thank you.


When I do:


======
> perl Makefile.PL
------

I get this output:

======
NOTICE: This module requires libgd 2.0.28 or higher.

If you are using Math::Trig 1.01 or lower, it has a bug that
causes a "prerequisite not found" warning to be issued. You
may
safely ignore this warning.

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_JPEG GD_FREETYPE GD_PNG GD_GIF
GD_UNCLOSEDPOLY GD_ANIMGIF GD_FTCIRCLE VERSION_33
GD library used from: /opt/local
Checking if your kit is complete...
Looks good
Unrecognized argument in LIBS ignored: '/opt/local/lib/libiconv.dylib'
Writing Makefile for GD
------

So, already, it is complaining about iconv.

I can do a 'make' and it will build without any problems.
However, a 'make test' fails with the following output:

======
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.
t/GD..........dubious

Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 1-12
Failed 12/12 tests, 0.00% okay
t/Polyline....Can't load
'/Users/Eric/.cpan/build/GD-2.35/blib/arch/auto/GD/GD.bundle' for
module GD:
dlopen(/Users/Eric/.cpan/build/GD-2.35/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 /Users/Eric/.cpan/build/GD-2.35/blib/lib/GD/Polyline.pm line 45
Compilation failed in require at
/Users/Eric/.cpan/build/GD-2.35/blib/lib/GD/Polyline.pm line 45.
BEGIN failed--compilation aborted at
/Users/Eric/.cpan/build/GD-2.35/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....dubious

Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED test 1
Failed 1/1 tests, 0.00% okay
Failed Test Stat Wstat Total Fail List of Failed
-------------------------------------------------------------------------------
t/GD.t 255 65280 12 23 1-12
t/Polyline.t 255 65280 1 2 1
Failed 2/2 test scripts. 13/13 subtests failed.
Files=2, Tests=13, 0 wallclock secs ( 0.06 cusr + 0.02 csys = 0.08
CPU)
Failed 2/2 test programs. 13/13 subtests failed.
make: *** [test_dynamic] Error 255
------

Sherm Pendley

unread,
Sep 25, 2006, 9:29:31 PM9/25/06
to
eric...@gmail.com writes:

> When I do:
>
>
> ======
>> perl Makefile.PL
> ------
>
> I get this output:

...snip...

> Unrecognized argument in LIBS ignored: '/opt/local/lib/libiconv.dylib'
> Writing Makefile for GD
> ------
>
> So, already, it is complaining about iconv.

Try this:

perl Makefile.PL LIBS='-L/opt/local/lib -liconv'

sherm--

--
Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net

Eric

unread,
Sep 26, 2006, 9:44:47 AM9/26/06
to
Sherm Pendley wrote:

> Try this:
>
> perl Makefile.PL LIBS='-L/opt/local/lib -liconv'

Thanks. This suggestion succeeded in getting perl Makefile.PL to work
without any reported problems. 'make'ing still succeeds, however, 'make
test' is still failing.

Any ideas?

Thank you.

Here is the output I am getting:

~/.cpan/build/GD-2.35 $perl Makefile.PL LIBS='-L/opt/local/lib -liconv'

Configuring for libgd version 2.0.33.
Checking for stray libgd header files...none found.
Included Features: GD_JPEG GD_FREETYPE GD_PNG GD_GIF
GD_UNCLOSEDPOLY GD_ANIMGIF GD_FTCIRCLE VERSION_33
GD library used from: /opt/local
Checking if your kit is complete...
Looks good

Writing Makefile for GD

~/.cpan/build/GD-2.35 $make

cp GD/Polyline.pm blib/lib/GD/Polyline.pm
cp qd.pl blib/lib/qd.pl
cp GD/Image.pm blib/lib/GD/Image.pm
cp GD.pm blib/lib/GD.pm
AutoSplitting blib/lib/GD.pm (blib/lib/auto/GD)
cp GD/Simple.pm blib/lib/GD/Simple.pm
cp GD/Polygon.pm blib/lib/GD/Polygon.pm
/usr/bin/perl /System/Library/Perl/5.8.6/ExtUtils/xsubpp -typemap
/System/Library/Perl/5.8.6/ExtUtils/typemap -typemap typemap GD.xs >
GD.xsc && mv GD.xsc GD.c
cc -c -I/opt/local/include -g -pipe -fno-common -DPERL_DARWIN
-no-cpp-precomp -fno-strict-aliasing -I/usr/local/include -O3
-DVERSION=\"2.35\" -DXS_VERSION=\"2.35\"
"-I/System/Library/Perl/5.8.6/darwin-thread-multi-2level/CORE"
-DHAVE_JPEG -DHAVE_FT -DHAVE_GIF -DHAVE_PNG -DHAVE_ANIMGIF -DVERSION_33
-DHAVE_UNCLOSEDPOLY -DHAVE_FTCIRCLE GD.c
Running Mkbootstrap for GD ()
chmod 644 GD.bs
rm -f blib/arch/auto/GD/GD.bundle
LD_RUN_PATH="/opt/local/lib" env MACOSX_DEPLOYMENT_TARGET=10.3 cc
-bundle -undefined dynamic_lookup -L/usr/local/lib GD.o -o
blib/arch/auto/GD/GD.bundle -L/opt/local/lib -liconv
/usr/bin/ld: warning -L: directory name (/usr/local/lib) does not exist
chmod 755 blib/arch/auto/GD/GD.bundle
cp GD.bs blib/arch/auto/GD/GD.bs
chmod 644 blib/arch/auto/GD/GD.bs
cp bdf_scripts/bdf2gdfont.pl blib/script/bdf2gdfont.pl
/usr/bin/perl "-MExtUtils::MY" -e "MY->fixin(shift)"
blib/script/bdf2gdfont.pl
Manifying blib/man1/bdf2gdfont.pl.1
Manifying blib/man3/GD::Polyline.3pm
Manifying blib/man3/GD::Image.3pm
Manifying blib/man3/GD::Simple.3pm
Manifying blib/man3/GD.3pm
Manifying blib/man3/GD::Polygon.3pm

~/.cpan/build/GD-2.35 $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:

_gdImageAlphaBlending
Referenced from: ./blib/arch/auto/GD/GD.bundle
Expected in: dynamic lookup


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..........dubious

Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 1-12
Failed 12/12 tests, 0.00% okay
t/Polyline....Can't load
'/Users/Eric/.cpan/build/GD-2.35/blib/arch/auto/GD/GD.bundle' for
module GD:
dlopen(/Users/Eric/.cpan/build/GD-2.35/blib/arch/auto/GD/GD.bundle, 2):

Symbol not found: _gdImageAlphaBlending
Referenced from:
/Users/Eric/.cpan/build/GD-2.35/blib/arch/auto/GD/GD.bundle
Expected in: dynamic lookup

Eric

unread,
Sep 26, 2006, 12:07:05 PM9/26/06
to
I thought the problem might be that I was telling perl to build the GD
module with support for things that the gd library was not built
with...however, this still failed.

With DarwinPorts (MacPorts), I built the gd2 port:

======
~ $port info gd2
gd2 2.0.33, Revision 2, graphics/gd2 (Variants: darwin_6, darwin)
http://www.boutell.com/gd/

gd is a graphics library. It allows your code to quickly draw images
complete with lines, arcs, text, multiple colors, cut and paste from
other images, and flood fills, and write out the result as a .PNG file.
This is particularly useful in World Wide Web applications, where .PNG
is the format used for inline images. gd is not a paint program. If you
are looking for a paint program, you are looking in the wrong place. If
you are not a programmer, you are looking in the wrong place.

Library Dependencies: libpng, jpeg, freetype, XFree86
------

and then tried:

perl Makefile.PL LIBS='-L/opt/local/lib -liconv' -options "JPEG,FT,PNG"

'make test' failed with the following output:

======


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:
_gdImageAlphaBlending
Referenced from: ./blib/arch/auto/GD/GD.bundle
Expected in: dynamic lookup
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..........dubious

Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 1-12
Failed 12/12 tests, 0.00% okay
t/Polyline....Can't load

'/Users/Eric/Desktop/Downloads/GD-2.35/blib/arch/auto/GD/GD.bundle' for
module GD:
dlopen(/Users/Eric/Desktop/Downloads/GD-2.35/blib/arch/auto/GD/GD.bundle,


2): Symbol not found: _gdImageAlphaBlending
Referenced from:

/Users/Eric/Desktop/Downloads/GD-2.35/blib/arch/auto/GD/GD.bundle
Expected in: dynamic lookup
at /Users/Eric/Desktop/Downloads/GD-2.35/blib/lib/GD/Polyline.pm line


45
Compilation failed in require at

/Users/Eric/Desktop/Downloads/GD-2.35/blib/lib/GD/Polyline.pm line 45.
BEGIN failed--compilation aborted at
/Users/Eric/Desktop/Downloads/GD-2.35/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....dubious

Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED test 1
Failed 1/1 tests, 0.00% okay
Failed Test Stat Wstat Total Fail List of Failed
-------------------------------------------------------------------------------
t/GD.t 255 65280 12 23 1-12
t/Polyline.t 255 65280 1 2 1
Failed 2/2 test scripts. 13/13 subtests failed.
Files=2, Tests=13, 0 wallclock secs ( 0.06 cusr + 0.02 csys = 0.08
CPU)
Failed 2/2 test programs. 13/13 subtests failed.
make: *** [test_dynamic] Error 255

------


Now, I did come across a comment in a google search on this problem
that the fact it is failing here is not likely a real problem and that
I can just go ahead and install the module. Is this true? However, I
would like to see it pass...

Sherm Pendley

unread,
Sep 26, 2006, 12:39:38 PM9/26/06
to
"Eric" <eric...@gmail.com> writes:

> Thanks. This suggestion succeeded in getting perl Makefile.PL to work
> without any reported problems. 'make'ing still succeeds, however, 'make
> test' is still failing.
>
> Any ideas?
>
> Thank you.
>
> Here is the output I am getting:

... snip ...

> ~/.cpan/build/GD-2.35 $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:
> _gdImageAlphaBlending
> Referenced from: ./blib/arch/auto/GD/GD.bundle

Try verifying that GD.bundle is linked against the *correct* libiconv,
with "otool -L ./blib/arch/auto/GD/GD.bundle".

I've a sneaking suspicion that it's picking up the Apple-supplied library
from /usr/lib instead, and that's an older version than what DarwinPorts
supplies.

Eric

unread,
Sep 26, 2006, 1:16:51 PM9/26/06
to

Sherm Pendley wrote:
> "Eric" <eric...@gmail.com> writes:
>
> > Thanks. This suggestion succeeded in getting perl Makefile.PL to work
> > without any reported problems. 'make'ing still succeeds, however, 'make
> > test' is still failing.
> >
> > Any ideas?
> >
> > Thank you.
> >
> > Here is the output I am getting:
>
> ... snip ...
>
> > ~/.cpan/build/GD-2.35 $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:
> > _gdImageAlphaBlending
> > Referenced from: ./blib/arch/auto/GD/GD.bundle
>
> Try verifying that GD.bundle is linked against the *correct* libiconv,
> with "otool -L ./blib/arch/auto/GD/GD.bundle".
>
> I've a sneaking suspicion that it's picking up the Apple-supplied library
> from /usr/lib instead, and that's an older version than what DarwinPorts
> supplies.

It looks like it is pulling it from darwinports:

./blib/arch/auto/GD/GD.bundle:
/opt/local/lib/libiconv.2.dylib (compatibility version 7.0.0,
current version 7.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0,
current version 88.3.3)

any other ideas?

Sherm Pendley

unread,
Sep 26, 2006, 1:49:55 PM9/26/06
to
"Eric" <eric...@gmail.com> writes:

If the above is complete, it looks like GD.bundle isn't linked against libgd.
Either that or libgd is static.

Have a look in Makefile.PL, to see what it assigns to LIBS. The fix for the
earlier "unrecognized arguments" error may have left out some arguments -
such as "-lgd" to link against libgd for instance.

Eric

unread,
Sep 26, 2006, 2:04:47 PM9/26/06
to

Sherm Pendley wrote:

> If the above is complete, it looks like GD.bundle isn't linked against libgd.
> Either that or libgd is static.
>
> Have a look in Makefile.PL, to see what it assigns to LIBS. The fix for the
> earlier "unrecognized arguments" error may have left out some arguments -
> such as "-lgd" to link against libgd for instance.

That was the solution. Thank you.

I'm curious, why doesn't Makefile.PL handle the iconv situation better?
Is this a bug that should be reported?

Sherm Pendley

unread,
Sep 26, 2006, 2:21:01 PM9/26/06
to
"Eric" <eric...@gmail.com> writes:

Good question. Nothing in Makefile.PL jumps out as being obviously wrong.

David Steinbrunner

unread,
Feb 23, 2007, 5:20:01 PM2/23/07
to
On 2006-09-26 14:21:01 -0400, Sherm Pendley
<sh...@Sherm-Pendleys-Computer.local> said:

> "Eric" <eric...@gmail.com> writes:
>>
>> That was the solution. Thank you.
>>
>> I'm curious, why doesn't Makefile.PL handle the iconv situation better?
>
> Good question. Nothing in Makefile.PL jumps out as being obviously wrong.

I just ran into this issue. This thread helped me to think about the
issue a bit more which lead to find this:

BUG: gd2 port has broken gdlib-config
http://trac.macports.org/projects/macports/ticket/3562

So the problem is not caused by the Makefile.PL but macports' gdlib-config.

Since this thread did not explicitly state how Eric got GD passing the
tests I'll document how I did it:

After creating the Makefile by running 'perl Makefile.pl' I added
'-L/opt/local/lib -liconv' to the EXTRALIBS and LDLOADLIBS lists in the
Makefile. From there the normal make, make test, make install routine
can be followed.

--
David Steinbrunner

0 new messages