Post New Topic  Post A Reply
my profile | register | search | faq | forum home
  next oldest topic   next newest topic
» MacOSX -   » Compile Problems   » Help installing gd-1.8.4?

UBBFriend: Email this page to someone!    
Author Topic: Help installing gd-1.8.4?
Junior Member
Member # 446

posted June 08, 2002 02:36 PM      Profile for SteveC   Email SteveC   Send New Private Message      Edit/Delete Post  Reply With Quote 
I'm trying to install, which requires gd, which requires libpng and libjpeg. I can install libpng and libjpeg either from source or from packages at the Libraries section of ports. But the gd installation croaks, warning "can't open dynamic library: /usr/local/lib/libz.1.dylib".

I have tried precisely following the instructions at and at Ernie Rothman's excellent OS X site ( I have run into the same problem on two machines, both running OS X 10.1.5. One of the systems is a new build, and the other was installed cleanly in the last two weeks but is also running XDarwin. Help!

Posts: 3 | Registered: Jun 2002  |  IP: Logged
Junior Member
Member # 446

posted July 08, 2002 06:33 PM      Profile for SteveC   Email SteveC   Send New Private Message      Edit/Delete Post  Reply With Quote 
I finally did get gd installed. My goal was to install the Perl module, so that's what the last half of the instructions describe. For gd and the dependencies, I cheated, using Fink.

The default Fink gd installation is configured to use X11 graphics libraries, and I don't know how to tell Fink not to do this "deluxe" gd installation, so this whole process takes longer than would a manual installation of libgd, libpng, and libjpeg. But using Fink was the only way I was able to get around some conflicts with the OS X dynamic library system.

If you don't have Fink, go to the Fink web site, and get the binary Fink installer. Double click the Fink installer, to install the Fink base system. In your home directory, add "source /sw/bin/init.csh" to the top of .cshrc (to place whatever Fink installs on your directory path). Then, make this change "live" by typing
source .cshrc
at the command prompt. To actually download gd and its dependencies, go
fink install gd
When the Fink installer dialog starts and asks which X11 option to use, say
3 for Xfree86-base. This means Fink will install tons of stuff.

If you have X11 and related libraries and know that they work and know how to tell Fink where to find them, then use options 1 or 2. But otherwise, 3 is probably safest.
Then Fink asks if you want to install a set of dependencies. Say "Y" to accept all.
Then let it chug for a few hours or over night.

Then get from
Edit Makefile.PL , replacing the @INC and @LIBPATH lines with
my @INC = qw(-I/sw/include);
my @LIBPATH = qw(-L/sw/lib );
Then run "perl Makefile.PL" .
During the installer dialog, answer "y n n" to install GD only with jpeg support (not freetype or XPM).
Then "make test" and "sudo make install".
To test, go into the demos folder in GD-1.33, choose and copy one of the demo files, and make these edits:
- change the #! line if necessary (probably to #!/usr/bin/perl )
- comment out the "binmode STDOUT" line
- open a file to write the .png file:
open (OUT, "> file_path/test_file.png")
or die "couldn't open file_path/test_file.png: $!";
- change the print line to:
print OUT $im->png;
Then see if test_file.png looks like a .png. That's it!

Posts: 3 | Registered: Jun 2002  |  IP: Logged

All times are Pacific Time  

Post New Topic  Post A Reply Close Topic    Move Topic    Delete Topic next oldest topic   next newest topic
Hop To:

Contact Us |

Powered by Infopop Corporation
Ultimate Bulletin BoardTM