I am not able to install GD module in PErl.
I have done CPAN GD but that gives me error:
Reading '/home/harsh/.cpan/Metadata'
Database was generated on Mon, 28 Sep 2020 02:17:03 GMT
Running install for module 'GD'
Checksum for /home/harsh/.cpan/sources/authors/id/R/RU/RURBAN/GD-2.73.tar.gz ok
'YAML' not installed, will not store persistent state
Configuring R/RU/RURBAN/GD-2.73.tar.gz with Makefile.PL
Notice: Type perl Makefile.PL -h for command-line option summary.
Package gdlib was not found in the pkg-config search path.
Perhaps you should add the directory containing `gdlib.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gdlib' found
at Makefile.PL line 451.
*** can not find package gdlib
*** check that it is properly installed and available in PKG_CONFIG_PATH
at Makefile.PL line 451.
Warning: No success on command[/home/harsh/perl5/perlbrew/perls/perl-5.28.0/bin/perl Makefile.PL]
RURBAN/GD-2.73.tar.gz
/home/harsh/perl5/perlbrew/perls/perl-5.28.0/bin/perl Makefile.PL -- NOT OK
and whenever I run my file it gives:
Can't locate GD.pm in #INC (you may need to install the GD module) (#INC contains: /home/harsh/perl5/perlbrew/perls/perl-5.28.0/lib/site_perl/5.28.0/x86_64-linux /home/harsh/perl5/perlbrew/perls/perl-5.28.0/lib/site_perl/5.28.0 /home/harsh/perl5/perlbrew/perls/perl-5.28.0/lib/5.28.0/x86_64-linux /home/harsh/perl5/perlbrew/perls/perl-5.28.0/lib/5.28.0) at generate_feedburner_graph.perl line 18.
BEGIN failed--compilation aborted at generate_feedburner_graph.perl line 18.
Also i have seen this solution of running sudo apt-get install libgd2-xpm-dev but this says
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package libgd2-xpm-dev
I am using Ubuntu 18.04
You need to install libgd-dev:
$ sudo apt-get install libgd-dev
Related
I'm trying to figure out why I can't get the GD perl module to install on my Debian 7 server. Here is how I installed the core stuff:
sudo apt-get install libgd-gd2-perl
Then running the -MCPAN to install, I get:
root#myserver:~# sudo perl -MCPAN -e 'install GD'
Going to read '/root/.cpan/Metadata'
Database was generated on Sun, 19 Jul 2015 21:41:02 GMT
Running install for module 'GD'
Running make for L/LD/LDS/GD-2.56.tar.gz
Checksum for /root/.cpan/sources/authors/id/L/LD/LDS/GD-2.56.tar.gz ok
CPAN.pm: Going to build L/LD/LDS/GD-2.56.tar.gz
Configuring for libgd version 2.0.36.
Checking for stray libgd header files...none found.
Unknown option: installdirs
Usage: perl Build.PL [options]
Configure GD module.
Options:
-options "JPEG,FT,PNG,GIF,XPM,ANIMGIF" feature options, separated by commas
-lib_gd_path path path to libgd
-lib_ft_path path path to Freetype library
-lib_png_path path path to libpng
-lib_jpeg_path path path to libjpeg
-lib_xpm_path path path to libxpm
-lib_zlib_path path path to libpng
-ignore_missing_gd Ignore missing or old libgd installations and try to compile anyway
If no options are passed on the command line. The program will
attempt to autoconfigure itself with the gdlib-config program (present
in GD versions 2.0.27 or later). Otherwise it will prompt for these
values interactively.
Warning: No success on command[/usr/bin/perl Build.PL --installdirs site]
LDS/GD-2.56.tar.gz
/usr/bin/perl Build.PL --installdirs site -- 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
I've done a load of googling, but nothing seems to fix it. Any suggestions?
The error you are getting is
Unknown option: installdirs
Usage: perl Build.PL [options]
cpan expects Build.PL to pass its arguments to Module::Build, but GD has a funky Build.PL. Let's "fix" it.
Execute the following from a temporary directory:
wget http://search.cpan.org/CPAN/authors/id/L/LD/LDS/GD-2.56.tar.gz
-or-
curl -L http://search.cpan.org/CPAN/authors/id/L/LD/LDS/GD-2.56.tar.gz >GD-2.56.tar.gz
tar xvzf GD-2.56.tar.gz
cd GD-2.56
perl -i~ -pE'say "Getopt::Long::Configure(qw( pass_through ));" if /GetOptions/;' Build.PL
/usr/bin/perl Build.PL --installdirs site
sudo ./Build.PL installdeps
./Build.PL make
./Build.PL test
sudo ./Build.PL install
In Ubuntu 15.04, a slight modification of the above intelligent answer seemed necessary in order to get it to install GD. This worked so that the 'cpan' program could then install GD then e.g. Image::Resize (which uses GD) afterwards. I did it after
sudo -i
in a Terminal, and after 'cd' into a temporary folder. Whether of value or not, I first did
apt-get install libgd-dev
Then this, which may contain one or more redundant lines, but it works:
wget http://search.cpan.org/CPAN/authors/id/L/LD/LDS/GD-2.56.tar.gz
tar xvzf GD-2.56.tar.gz
cd GD*
perl -i~ -pE'say "Getopt::Long::Configure(qw( pass_through ));" if /GetOptions/;' Build.PL
/usr/bin/perl Build.PL --installdirs site
chmod 755 Build.PL
./Build.PL installdeps
./Build installdeps
./Build test
./Build install
I'm trying to install Perl module MediaWiki::API using CPAN on OS X:
sudo cpan MediaWiki::API Password:
Reading '/Users/qazwsx/.cpan/Metadata'
Database was generated on Mon, 13 Jul 2015 20:53:32 GMT
Running install for module 'MediaWiki::API'
Running make for E/EX/EXOBUZZ/MediaWiki-API-0.40.tar.gz
Checksum for /Users/qazwsx/.cpan/sources/authors/id/E/EX/EXOBUZZ/MediaWiki-API-0.40.tar.gz ok
sh: /opt/local/bin/gzip: No such file or directory
Package seems to come without Makefile.PL.
(The test -f "/Users/qazwsx/.cpan/build/EXOBUZZ-iwzBiH/Makefile.PL" returned false.)
Writing one on our own (setting NAME to MediaWikiAPI)
CPAN.pm: Building E/EX/EXOBUZZ/MediaWiki-API-0.40.tar.gz
Writing Makefile for MediaWikiAPI
Writing MYMETA.yml and MYMETA.json
EXOBUZZ/MediaWiki-API-0.40.tar.gz
/usr/bin/make -- OK
'YAML' not installed, will not store persistent state
Running make test
No tests defined for MediaWikiAPI extension.
EXOBUZZ/MediaWiki-API-0.40.tar.gz
/usr/bin/make test -- OK
Running make install
Appending installation info to /Library/Perl/Updates/5.18.2/darwin-thread-multi-2level/perllocal.pod
EXOBUZZ/MediaWiki-API-0.40.tar.gz
/usr/bin/make install -- OK
This is a step of installing Git-Mediawiki (see https://github.com/moy/Git-Mediawiki/wiki/User-manual). However, after all the installation steps, the first git command reports that MediaWiki::API module isn't available:
git pull
Can't locate MediaWiki/API.pm in #INC (you may need to install the MediaWiki::API module) (#INC contains: /Users/qazwsx/WorkSpace-X4430/git/perl /Users/qazwsx/WorkSpace-X4430/git/contrib/mw-to-git /Library/Perl/5.18/darwin-thread-multi-2level /Library/Perl/5.18 /Network/Library/Perl/5.18/darwin-thread-multi-2level /Network/Library/Perl/5.18 /Library/Perl/Updates/5.18.2/darwin-thread-multi-2level /Library/Perl/Updates/5.18.2 /System/Library/Perl/5.18/darwin-thread-multi-2level /System/Library/Perl/5.18 /System/Library/Perl/Extras/5.18/darwin-thread-multi-2level /System/Library/Perl/Extras/5.18 .) at /usr/local/Cellar/git/2.4.1/libexec/git-core/git-remote-mediawiki line 15.
BEGIN failed--compilation aborted at /usr/local/Cellar/git/2.4.1/libexec/git-core/git-remote-mediawiki line 15.
I wonder if my installation method for the Perl module is correct. One thing strikes out as odd is the error
sh: /opt/local/bin/gzip: No such file or directory
I use Homebrew with standard paths, so the gzip binary is at /usr/local/bin/gzip. But I don't know if or where to fix it. It appears to be some search paths issue but I don't know how to fix it.
There might be something wrong with your ~/.cpan, the configuration for CPAN. You can try
# Re-install cpan
brew doctor
brew update
brew install cpan
# Remove or back up ~/.cpan
mv ~/.cpan ~/.cpan.bak
# Re-initialize ~/.cpan
cpan config
# Try installing the Perl module again
sudo cpan install MediaWiki::API
I'm tried to install XML::LibXSLT, and it failed:
$ sudo perl -MCPAN -e shell
...
cpan[9]> notest install XML::LibXSLT
Running install for module 'XML::LibXSLT'
...
Configuring S/SH/SHLOMIF/XML-LibXSLT-1.94.tar.gz with Makefile.PL
running xslt-config... failed
using fallback values for LIBS and INC
options:
LIBS='-L/usr/local/lib -L/usr/lib -lxslt -lxml2 -lz -lm'
INC='-I/usr/local/include -I/usr/include'
If this is wrong, Re-run as:
$ /usr/bin/perl Makefile.PL LIBS='-L/path/to/lib' INC='-I/path/to/include'
looking for -lxslt... no
libxslt not found
Try setting LIBS and INC values on the command line
Or get libxslt and libxml2 from
http://www.libxml.org/
If you install via RPMs, make sure you also install the -devel
RPMs, as this is where the headers (.h files) are.
No 'Makefile' created SHLOMIF/XML-LibXSLT-1.94.tar.gz
/usr/bin/perl Makefile.PL INSTALLDIRS=site -- NOT OK
Failed during this command:
SHLOMIF/XML-LibXSLT-1.94.tar.gz : writemakefile NO -- No 'Makefile' created
I didn't exit the MCPAN shell; I tried installing sudo apt-get install libxslt1-dev from another terminal, and I wanted to re-run the module installation process. Turns out I can't (I got the clean from perlmonks.org: how to re-run Makefile.PL under CPAN?):
cpan[10]> notest install XML::LibXSLT
Running install for module 'XML::LibXSLT'
SHLOMIF/XML-LibXSLT-1.94.tar.gz
Has already been unwrapped into directory /root/.cpan/build/XML-LibXSLT-1.94-2qijzZ
SHLOMIF/XML-LibXSLT-1.94.tar.gz
No 'Makefile' created
, not re-running
cpan[11]> clean XML::LibXSLT
Running clean for module 'XML::LibXSLT'
Running make clean
No Makefile, don't know how to 'make clean'
cpan[13]> notest install XML::LibXSLT
Running install for module 'XML::LibXSLT'
SHLOMIF/XML-LibXSLT-1.94.tar.gz
Has already been unwrapped into directory /root/.cpan/build/XML-LibXSLT-1.94-2qijzZ
SHLOMIF/XML-LibXSLT-1.94.tar.gz
No 'Makefile' created
, not re-running
Ok, so how do I repeat the installation of this module, now that it failed, and cannot be cleaned either?
Ok, the first thing is to note that there is no (default) way to remove modules from CPAN, failed or not:
How can I de-install a Perl module installed via `cpan`?
That being said, what worked for me was:
exit the MCPAN shell
enter again via sudo perl -MCPAN -e shell
Do not issue install XML::LibXSLT - instead just issue make XML::LibXSLT; note that at this point, I got:
cpan[1]> make XML::LibXSLT
CPAN: Storable loaded ok (v2.30)
Reading '/root/.cpan/Metadata'
Database was generated on Thu, 12 Feb 2015 08:41:02 GMT
Running make for module 'XML::LibXSLT'
...
Scanning cache /root/.cpan/build for sizes
................................................----------------------------DONE
DEL(1/122): /root/.cpan/build/JSON-DWIW-0.47-ppRqJq
CPAN: YAML loaded ok (v0.73)
DEL(2/122): /root/.cpan/build/JSON-DWIW-0.47-ppRqJq.yml
DEL(3/122): /root/.cpan/build/common-sense-3.4-bfJ9E8
...
Have no idea where these deletions came from.
At this point, the command concluded with:
...
/usr/bin/ld: cannot find -lgdbm
/usr/bin/ld: cannot find -lgdbm_compat
collect2: ld returned 1 exit status
...
Failed during this command:
SHLOMIF/XML-LibXSLT-1.94.tar.gz : make NO
cpan[2]> make XML::LibXSLT
Running make for module 'XML::LibXSLT'
SHLOMIF/XML-LibXSLT-1.94.tar.gz
Has already been unwrapped into directory /root/.cpan/build/XML-LibXSLT-1.94-4kLOVB
SHLOMIF/XML-LibXSLT-1.94.tar.gz
Has already been prepared
SHLOMIF/XML-LibXSLT-1.94.tar.gz
Could not make: Unknown error
... and after this, for reasons unknown to me, the clean command started responding:
cpan[4]> clean XML::LibXSLT
Running clean for module 'XML::LibXSLT'
Running make clean
rm -f \
*.a core \
core.[0-9] blib/arch/auto/XML/LibXSLT/extralibs.all \
...
mv Makefile Makefile.old > /dev/null 2>&1
SHLOMIF/XML-LibXSLT-1.94.tar.gz
/usr/bin/make clean -- OK
... and after doing in another terminal sudo apt-get install libgdbm-dev, and a couple more clean XML::LibXSLT and make XML::LibXSLT, finally got the module to install:
cpan[8]> notest install XML::LibXSLT
Running install for module 'XML::LibXSLT'
SHLOMIF/XML-LibXSLT-1.94.tar.gz
...
Installing /usr/local/man/man3/XML::LibXSLT.3pm
Appending installation info to /usr/lib/perl/5.10/perllocal.pod
SHLOMIF/XML-LibXSLT-1.94.tar.gz
/usr/bin/make install -- OK
Well, hope this helps someone; cheers!
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
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.
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.
Im running on a machine with x86_64 architecture, with 32-bits compiled Perl 5.8.4. When I trying to install XML::LibXML i get following debug message:
...
...
# Running under perl version 5.008004 for linux
# Current time local: Fri Oct 7 08:43:24 2011
# Current time GMT: Fri Oct 7 06:43:24 2011
# Using Test.pm version 1.25
Can't load 'blib/arch/auto/Conftest/Conftest.so' for module Conftest: blib/arch/auto/Conftest/Conftest.so: wrong ELF class: ELFCLASS64 at /app/perl/.sys/i386_linux24/5.8.4/lib/5.8.4/i686-lin
ux-thread-multi/DynaLoader.pm line 230.
at test.pl line 2
Compilation failed in require at test.pl line 2.
BEGIN failed--compilation aborted at test.pl line 2.
not ok 1
# Failed test 1 in test.pl at line 1
# test.pl line 1 is: use Test; BEGIN { plan tests => 1; } END { ok($loaded) }
make: *** [test_dynamic] Error 255
system call to 'make test 'OTHERLDFLAGS='' failed at Makefile.PL line 495.
no
libxml2, zlib, and/or the Math library (-lm) have not been found.
Try setting LIBS and INC values on the command line
Or get libxml2 from
http://xmlsoft.org/
If you install via RPMs, make sure you also install the -devel
RPMs, as this is where the headers (.h files) are.
Also, you may try to run perl Makefile.PL with the DEBUG=1 parameter
to see the exact reason why the detection of libxml2 installation
failed or why Makefile.PL was not able to compile a test program.
So the question is, how can I describe in the .cpan properties (or in the Makefile.PL) that I would like to compile XML::LibXML in 32-bits mode in an 64-bits architecture?
B.R CH
above all, check whether libxml2-devel and zlib-devel packages were installed on your system as follow:
$ rpm -ql libxml2-devel
$ rpm -ql zlib-devel
if any of them were not installed, install the missing packages as follow :
$ yum install libxml2-devel
$ yum install zlib-devel
re-install XML::LibXML pacak with CPAN as follow :
$ cpan
cpan> install XML::LibXML
I hope that this will be helpful.
Good luck!