4

I'm having a tough job trying to get GD installed. I'm running a Mas OSX 10.9.2 darwin 13.0.1 When I run this: cpan[1]> install GD perl -MCPAN -e shell

I get the follwing error:

cpan[1]> install GD
Reading '/Users/me/.cpan/Metadata'
  Database was generated on Sun, 21 Dec 2014 18:53:17 GMT
Running install for module 'GD'
Running make for L/LD/LDS/GD-2.56.tar.gz
Checksum for /Users/me/.cpan/sources/authors/id/L/LD/LDS/GD-2.56.tar.gz ok
Scanning cache /Users/me/.cpan/build for sizes
............................................................................DONE

  CPAN.pm: Building L/LD/LDS/GD-2.56.tar.gz

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

GD library used from:       /usr/local

Please choose the features that match how libgd was built:
Undefined subroutine &main::prompt called at Build.PL line 169.
Warning: No success on command[/usr/bin/perl Build.PL ]
'YAML' not installed, will not store persistent state
  LDS/GD-2.56.tar.gz
  /usr/bin/perl Build.PL  -- NOT OK
Running Build test
  Make had some problems, won't test
Running Build install
  Make had some problems, won't install
Could not read metadata file. Falling back to other methods to determine prerequisites
Failed during this command:
 LDS/GD-2.56.tar.gz                           : writemakefile NO '/usr/bin/perl Build.PL '     returned status 512
Sebastian Zeki
  • 6,690
  • 11
  • 60
  • 125

2 Answers2

4

Build.PL is trying to call a function called prompt but it doesn't exist. This is because they recently switched build systems from ExtUtils::MakeMaker (Makefile.PL) to Module::Build (Build.PL) but didn't fully convert the program. I've reported the bug.

Most people don't notice this because the prompting is only necessary if GD can't configure itself. It does this by looking for the gdlib-config program. If that can't be found, or it doesn't work, it will ask you for your gdlib configuration. It's best to let gdlib-config take care of that. Best way to solve this problem is to make sure gdlib-config is somewhere in your PATH and that gdlib-config --all works.

Otherwise replace all the instances of prompt in Build.PL with Module::Build->prompt and it should work.

Schwern
  • 153,029
  • 25
  • 195
  • 336
  • 1
    Where I have to replace all instances of `prompt`? – A.B. Sep 28 '15 at 11:23
  • I have the problem, that I can't install `GD` on a Ubuntu-server (without GUI) I asked my question here: http://askubuntu.com/questions/627304/cant-install-cpan-module-gd At the moment is looks as if the installation scripts wants to call `Build.PL` from `/usr/bin/perl`, but there is no `Build.PL`. I have 8 versions of `Build.PL` in 8 subdirectories of `/root/.cpan/build/`, but none of them is executable (no x-flag is set in the files permissions) – Hubert Schölnast Sep 28 '15 at 12:18
  • I can't find `Build.PL` on my system. I've tried `perl-doc Module::Build` but it doesn't have `Build.PL`. Any guesses? – Eli Korvigo Sep 29 '15 at 17:37
  • 1
    @EliKorvigo It's not installed, it's part of the source distribution of the module. – Schwern Sep 29 '15 at 17:52
0

I'm not sure about doing this on OSX, but I recently had similar problems with installing CPAN modules on CentOS.

Some prerequisite modules simply wouldn't install properly from CPAN. These modules had RPMs available. After installing some of the prerequisites via yum, I was able to get CPAN to install the modules I needed.

In particular, I had to install Module-Build and Archive-Tar (which brought in a number of other dependency rpm's) using yum.

Hope this helps.

MT1
  • 79
  • 4
  • 9
  • Did you report a bug on the respective distributions' issue queues? The authors can't fix the problem if they're not aware of it. – Ether Jan 18 '15 at 17:41