Сегодня потребовалась установка CPAN-модуля GD.pm на один из серверов.
При установке возникла ошибка:
perl -MCPAN -e 'install "GD"'
we get the following fatal error message:
**UNRECOVERABLE ERROR**
Could not find gdlib-config in the search path. Please install libgd
2.0.28 or higher.
If you want to try to compile anyway, please rerun this script with
the option --ignore_missing_gd.
...
Ок, пытаюсь ставить libgd из репозитория (Debian 5 Lenny):
$ apt-get install libgd2-xpm
$ apt-get install libgd2-xpm-dev
Пробую ставить опять perl-модуль - та же ошибка.
Раскопки и гуглеж позволили выяснить, что дело в том, что в штатный пакет не входит скрипт gdlib-config.
Решить проблему можно , поставив libgd самостоятельно, взяв исходники, например,
отсюда
$ wget http://www.boutell.com/gd/http/gd-2.0.28.tar.gz
$ tar xvf gd-2.0.28.tar.gz
$ cd gd-2.0.28
$ ./configure --prefix=/usr
$ make
$ sudo make install
После этого повторяем попытку поставить GD.pm.
Может возникнуть еще одна проблема:
Manifying blib/man3/GD::Polygon.3pm
LDS/GD-2.46.tar.gz
/usr/bin/make -- OK
Warning (usually harmless): 'YAML' not installed, will not store persistent state
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..........Testing using png support.
t/GD..........FAILED test 10
Failed 1/12 tests, 91.67% okay
t/Polyline....ok
Failed Test Stat Wstat Total Fail List of Failed
-------------------------------------------------------------------------------
t/GD.t 12 1 10
Failed 1/2 test scripts. 1/13 subtests failed.
Files=2, Tests=13, 1 wallclock secs ( 0.12 cusr + 0.02 csys = 0.14 CPU)
Failed 1/2 test programs. 1/13 subtests failed.
make: *** [test_dynamic] Ошибка 255
LDS/GD-2.46.tar.gz
/usr/bin/make test -- NOT OK
//hint// to see the cpan-testers results for installing this module, try:
reports LDS/GD-2.46.tar.gz
Warning (usually harmless): 'YAML' not installed, will not store persistent state
Running make install
make test had returned bad status, won't install without force
Подозрение на отсутствие библиотеки libpng. Ставим ее:
# apt-get install libpng3 libpng3-dev
Опять пробуем ставить perl-модуль - опять то же самое.
Удаляем libgd, конфигурим , собираем и ставим ее заново.Делаем так, потому что изначально у нас не было libpng и , соответственно, libgd была собрана без ее поддержки. Надо пересобрать:
# в директории с исходниками GD
$ make clean
$ ./configure --prefix=/usr
$ make
$ sudo make install
После этого GD.pm должен установиться успешно.