cpan XML::LibXSLT failed to install - perl

i tried installing the perl module XML::LibXSLT but it fails. googled for it for hours now but nothing help so i am posting this. Maybe someone can help!
Thanks in advance!
cpan XML::LibXSLT
CPAN: Storable loaded ok (v2.20)
Going to read '/root/.cpan/Metadata'
Database was generated on Mon, 28 Oct 2013 11:08:37 GMT
Running install for module 'XML::LibXSLT'
CPAN: YAML loaded ok (v0.84)
Running make for S/SH/SHLOMIF/XML-LibXSLT-1.81.tar.gz
CPAN: Digest::SHA loaded ok (v5.47)
CPAN: Compress::Zlib loaded ok (v2.062)
Checksum for /root/.cpan/sources/authors/id/S/SH/SHLOMIF/XML-LibXSLT-1.81.tar.gz ok
CPAN: Archive::Tar loaded ok (v1.58)
XML-LibXSLT-1.81/
XML-LibXSLT-1.81/perl-libxml-mm.h
XML-LibXSLT-1.81/benchmark/
XML-LibXSLT-1.81/benchmark/Driver/
XML-LibXSLT-1.81/benchmark/Driver/Sablotron.pm
XML-LibXSLT-1.81/benchmark/Driver/LibXSLT.pm
XML-LibXSLT-1.81/benchmark/Driver/BaseClass.pm
XML-LibXSLT-1.81/benchmark/benchmark.pl
XML-LibXSLT-1.81/Changes
XML-LibXSLT-1.81/LibXSLT.pm
XML-LibXSLT-1.81/MANIFEST
XML-LibXSLT-1.81/testcases/
XML-LibXSLT-1.81/testcases/default.conf
XML-LibXSLT-1.81/example/
XML-LibXSLT-1.81/example/fatal.xsl
XML-LibXSLT-1.81/example/2.xml
XML-LibXSLT-1.81/example/bad3.xsl
XML-LibXSLT-1.81/example/nonfatal.xsl
XML-LibXSLT-1.81/example/1.xml
XML-LibXSLT-1.81/example/bad2.xsl
XML-LibXSLT-1.81/example/1.xsl
XML-LibXSLT-1.81/example/2.xsl
XML-LibXSLT-1.81/example/bad1.xsl
XML-LibXSLT-1.81/Makefile.PL
XML-LibXSLT-1.81/META.yml
XML-LibXSLT-1.81/META.json
XML-LibXSLT-1.81/README
XML-LibXSLT-1.81/t/
XML-LibXSLT-1.81/t/04params.t
XML-LibXSLT-1.81/t/rt71345_a.t
XML-LibXSLT-1.81/t/09exslt.t
XML-LibXSLT-1.81/t/06output.t
XML-LibXSLT-1.81/t/03input.t
XML-LibXSLT-1.81/t/08literal.t
XML-LibXSLT-1.81/t/02dromeds.t
XML-LibXSLT-1.81/t/06entities.t
XML-LibXSLT-1.81/t/11utf8.t
XML-LibXSLT-1.81/t/10functions.t
XML-LibXSLT-1.81/t/05quick.t
XML-LibXSLT-1.81/t/07blankdoc.t
XML-LibXSLT-1.81/t/13error.t
XML-LibXSLT-1.81/t/01basic.t
XML-LibXSLT-1.81/t/14security.t
XML-LibXSLT-1.81/t/12import.t
XML-LibXSLT-1.81/t/15misc.t
XML-LibXSLT-1.81/t/rt71345_b.t
XML-LibXSLT-1.81/typemap
XML-LibXSLT-1.81/LibXSLT.xs
XML-LibXSLT-1.81/ppport.h
XML-LibXSLT-1.81/perl-libxml-mm.c
CPAN: File::Temp loaded ok (v0.22)
CPAN.pm: Going to build S/SH/SHLOMIF/XML-LibXSLT-1.81.tar.gz
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... yes
looking for -lexslt... yes
running pkg-config libexslt... ok
Checking if your kit is complete...
Looks good
Generating a GNU-style Makefile
Writing Makefile for XML::LibXSLT
Writing MYMETA.yml and MYMETA.json
cp LibXSLT.pm blib/lib/XML/LibXSLT.pm
/usr/bin/perl /usr/share/perl5/ExtUtils/xsubpp -typemap /usr/share/perl5/ExtUtils/typemap -typemap typemap LibXSLT.xs > LibXSLT.xsc && mv LibXSLT.xsc LibXSLT.c
gcc -c -I/usr/local/include -I/usr/include -I/usr/include/libxml2 -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -DVERSION=\"1.81\" -DXS_VERSION=\"1.81\" -fPIC "-I/usr/lib64/perl5/CORE" -DHAVE_BLANK -DHAVE_BLANK -DHAVE_EXSLT LibXSLT.c
LibXSLT.xs: In function ‘LibXSLT__function’:
LibXSLT.xs:252: warning: pointer targets in passing argument 1 of ‘xmlNewDoc’ differ in signedness
/usr/include/libxml2/libxml/tree.h:735: note: expected ‘const xmlChar *’ but argument is of type ‘char *’
LibXSLT.xs: In function ‘LibXSLT_context_element’:
LibXSLT.xs:518: warning: unused variable ‘ent’
LibXSLT.xs: In function ‘LibXSLT_init_functions’:
LibXSLT.xs:916: warning: suggest parentheses around assignment used as truth value
LibXSLT.xs: In function ‘LibXSLT_init_elements’:
LibXSLT.xs:948: warning: suggest parentheses around assignment used as truth value
gcc -c -I/usr/local/include -I/usr/include -I/usr/include/libxml2 -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -DVERSION=\"1.81\" -DXS_VERSION=\"1.81\" -fPIC "-I/usr/lib64/perl5/CORE" -DHAVE_BLANK -DHAVE_BLANK -DHAVE_EXSLT perl-libxml-mm.c
rm -f blib/arch/auto/XML/LibXSLT/LibXSLT.so
LD_RUN_PATH="/usr/lib64:/lib64" gcc -shared -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic LibXSLT.o perl-libxml-mm.o -o blib/arch/auto/XML/LibXSLT/LibXSLT.so \
-L/usr/local/lib -L/usr/lib -lxslt -lxml2 -lz -lm -lexslt -lgcrypt -ldl -lgpg-error -lresolv -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc \
/usr/bin/ld: cannot find -lgdbm
collect2: ld returned 1 exit status
make: *** [blib/arch/auto/XML/LibXSLT/LibXSLT.so] Error 1
SHLOMIF/XML-LibXSLT-1.81.tar.gz
/usr/bin/make -- NOT OK
Running make test
Can't test without successful make
Running make install
Make had returned bad status, install seems impossible
'
Any help is highly appreciated!

The error is /usr/bin/ld: cannot find -lgdbm. do you find gdbm library on your system?
run:
# updatedb
# locate gdbm
The output of locate command should list libgdbm.so. If it is not then try installing the same using your Distro's package manager:
Here is output on my ubuntu:
# locate gdbm
/usr/lib/libgdbm.so.3
/usr/lib/libgdbm.so.3.0.0
/usr/lib/libgdbm_compat.so.3
/usr/lib/libgdbm_compat.so.3.0.0
and here is the output from my RHEL 6.4:
# locate gdbm
/usr/lib64/libgdbm.so.2
/usr/lib64/libgdbm.so.2.0.0
To install gdbm, run these commands:
on ubuntu: apt-get install libgdbm3
On centos/RHEL: yum install gdbm
hope this helps.

/usr/bin/ld: cannot find -lgdbm
Looks like you don't have the gdbm library installed. I can't see which Linux (or, perhaps, Unix) distribution you're using, but gdbm is almost certainly per-packaged for it, so you just need to work out what the package is called and use apt or yum (or whatever is appropriate) to install it.

Related

ld unknown option -platform_version while installing perl package

I am trying to install perl package DBD::Pg in my macOS Mojave Version 10.14.6. But I get error for unknown option -platform_version and does not allow make command to continue. How would I be able to solve this? Thank you!
The following is the error I observe
ld: unknown option: -platform_version
clang-10: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [blib/arch/auto/DBD/Pg/Pg.bundle] Error 1
ld version
ld -v
#(#)PROGRAM:ld PROJECT:ld64-450.3
BUILD 18:16:53 Apr 5 2019
configured to support archs: armv6 armv7 armv7s arm64 arm64e arm64_32 i386 x86_64 x86_64h armv6m armv7k armv7m armv7em
LTO support using: LLVM version 10.0.1, (clang-1001.0.46.4) (static support for 22, runtime is 22)
TAPI support using: Apple TAPI version 10.0.1 (tapi-1001.0.4.1)
clang version
clang -v
clang version 10.0.0
Target: x86_64-apple-darwin18.7.0
Thread model: posix
InstalledDir: /Users/macuser/miniconda3/bin
I updated my Xcode and got clang version 11.0.3 Then I had problems in 'make install' command. I could solve that using the suggestions from the thread https://github.com/bucardo/dbdpg/issues/69 #briandfoy posted. Thank you very much!
I tried this on macOS 10.15.5, perlbrew perl 5.30.1.
First I installed PostgreSQL version 12.3 from
https://www.enterprisedb.com/downloads/postgres-postgresql-downloads
Downloaded the perl module DBD::Pg tarball https://cpan.metacpan.org/authors/id/T/TU/TURNSTEP/DBD-Pg-3.13.0.tar.gz
Installed the package:
$ POSTGRES_HOME=/Library/PostgreSQL/12 perl Makefile.PL
Configuring DBD::Pg 3.13.0
PostgreSQL version: 120003 (default port: 5432)
POSTGRES_HOME: /Library/PostgreSQL/12
POSTGRES_INCLUDE: /Library/PostgreSQL/12/include
POSTGRES_LIB: /Library/PostgreSQL/12/lib
OS: darwin
Checking if your kit is complete...
Looks good
Using DBI 1.643 (for perl 5.030001 on darwin-2level) installed in /Users/hakonhaegland/perl5/perlbrew/perls/perl-5.30.1/lib/site_perl/5.30.1/darwin-2level/auto/DBI/
Generating a Unix-style Makefile
Writing Makefile for DBD::Pg
Writing MYMETA.yml and MYMETA.json
$ make
cp Pg.pm blib/lib/DBD/Pg.pm
cp lib/Bundle/DBD/Pg.pm blib/lib/Bundle/DBD/Pg.pm
Running Mkbootstrap for Pg ()
chmod 644 "Pg.bs"
"/Users/hakonhaegland/perl5/perlbrew/perls/perl-5.30.1/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- Pg.bs blib/arch/auto/DBD/Pg/Pg.bs 644
"/Users/hakonhaegland/perl5/perlbrew/perls/perl-5.30.1/bin/perl" -p -e "s/~DRIVER~/Pg/g; s/^do\(/dontdo\(/" /Users/hakonhaegland/perl5/perlbrew/perls/perl-5.30.1/lib/site_perl/5.30.1/darwin-2level/auto/DBI/Driver.xst > Pg.xsi
"/Users/hakonhaegland/perl5/perlbrew/perls/perl-5.30.1/bin/perl" "/Users/hakonhaegland/perl5/perlbrew/perls/perl-5.30.1/lib/5.30.1/ExtUtils/xsubpp" -typemap '/Users/hakonhaegland/perl5/perlbrew/perls/perl-5.30.1/lib/5.30.1/ExtUtils/typemap' Pg.xs > Pg.xsc
mv Pg.xsc Pg.c
cc -c -I/Library/PostgreSQL/12/include -I/Users/hakonhaegland/perl5/perlbrew/perls/perl-5.30.1/lib/site_perl/5.30.1/darwin-2level/auto/DBI -fno-common -DPERL_DARWIN -mmacosx-version-min=10.15 -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -DPERL_USE_SAFE_PUTENV -DPGLIBVERSION=120003 -DPGDEFPORT=5432 -O3 -DPERL_EXTMALLOC_DEF -Dmalloc=Perl_malloc -Dfree=Perl_mfree -Drealloc=Perl_realloc -Dcalloc=Perl_calloc -DVERSION=\"3.13.0\" -DXS_VERSION=\"3.13.0\" "-I/Users/hakonhaegland/perl5/perlbrew/perls/perl-5.30.1/lib/5.30.1/darwin-2level/CORE" Pg.c
cc -c -I/Library/PostgreSQL/12/include -I/Users/hakonhaegland/perl5/perlbrew/perls/perl-5.30.1/lib/site_perl/5.30.1/darwin-2level/auto/DBI -fno-common -DPERL_DARWIN -mmacosx-version-min=10.15 -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -DPERL_USE_SAFE_PUTENV -DPGLIBVERSION=120003 -DPGDEFPORT=5432 -O3 -DPERL_EXTMALLOC_DEF -Dmalloc=Perl_malloc -Dfree=Perl_mfree -Drealloc=Perl_realloc -Dcalloc=Perl_calloc -DVERSION=\"3.13.0\" -DXS_VERSION=\"3.13.0\" "-I/Users/hakonhaegland/perl5/perlbrew/perls/perl-5.30.1/lib/5.30.1/darwin-2level/CORE" dbdimp.c
cc -c -I/Library/PostgreSQL/12/include -I/Users/hakonhaegland/perl5/perlbrew/perls/perl-5.30.1/lib/site_perl/5.30.1/darwin-2level/auto/DBI -fno-common -DPERL_DARWIN -mmacosx-version-min=10.15 -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -DPERL_USE_SAFE_PUTENV -DPGLIBVERSION=120003 -DPGDEFPORT=5432 -O3 -DPERL_EXTMALLOC_DEF -Dmalloc=Perl_malloc -Dfree=Perl_mfree -Drealloc=Perl_realloc -Dcalloc=Perl_calloc -DVERSION=\"3.13.0\" -DXS_VERSION=\"3.13.0\" "-I/Users/hakonhaegland/perl5/perlbrew/perls/perl-5.30.1/lib/5.30.1/darwin-2level/CORE" quote.c
cc -c -I/Library/PostgreSQL/12/include -I/Users/hakonhaegland/perl5/perlbrew/perls/perl-5.30.1/lib/site_perl/5.30.1/darwin-2level/auto/DBI -fno-common -DPERL_DARWIN -mmacosx-version-min=10.15 -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -DPERL_USE_SAFE_PUTENV -DPGLIBVERSION=120003 -DPGDEFPORT=5432 -O3 -DPERL_EXTMALLOC_DEF -Dmalloc=Perl_malloc -Dfree=Perl_mfree -Drealloc=Perl_realloc -Dcalloc=Perl_calloc -DVERSION=\"3.13.0\" -DXS_VERSION=\"3.13.0\" "-I/Users/hakonhaegland/perl5/perlbrew/perls/perl-5.30.1/lib/5.30.1/darwin-2level/CORE" types.c
rm -f blib/arch/auto/DBD/Pg/Pg.bundle
LD_RUN_PATH="/Library/PostgreSQL/12/lib" cc -mmacosx-version-min=10.15 -bundle -undefined dynamic_lookup -L/usr/local/lib -fstack-protector-strong Pg.o dbdimp.o quote.o types.o -o blib/arch/auto/DBD/Pg/Pg.bundle \
-L/Library/PostgreSQL/12/lib -lpq -lm \
chmod 755 blib/arch/auto/DBD/Pg/Pg.bundle
Manifying 2 pod documents
$ make test
"/Users/hakonhaegland/perl5/perlbrew/perls/perl-5.30.1/bin/perl" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/00_signature.t ....... skipped: Set the environment variable TEST_SIGNATURE to enable this test
t/00basic.t ............ ok
t/01connect.t .......... Please wait, creating new database (version 12.3) for testing
t/01connect.t .......... 1/15 #
# DBI Version 1.643
# DBD::Pg Version 3.13.0
# Perl Version 5.30.1
# OS darwin
# PostgreSQL (compiled) 120003
# PostgreSQL (target) 120300
# PostgreSQL (reported) PostgreSQL 12.3 on x86_64-apple-darwin, compiled by Apple LLVM version 6.0 (clang-600.0.54) (based on LLVM 3.5svn), 64-bit
# Default port 5432
# DBI_DSN dbi:Pg:db="postgres";port=5440;host=<pwd>/dbdpg_test_database/data/socket
# DBI_USER hakonhaegland
# Test schema dbd_pg_testschema
# LANG C
# Adjusted: initdb
t/01connect.t .......... ok
t/01constants.t ........ ok
t/02attribs.t .......... ok
t/03dbmethod.t ......... ok
t/03smethod.t .......... ok
t/04misc.t ............. ok
t/06bytea.t ............ ok
t/07copy.t ............. ok
t/08async.t ............ ok
t/09arrays.t ........... ok
t/10_pg_error_field.t .. ok
t/12placeholders.t ..... ok
t/20savepoints.t ....... ok
t/30unicode.t .......... ok
t/99cleanup.t .......... ok
All tests successful.
Files=17, Tests=2908, 31 wallclock secs ( 0.55 usr 0.11 sys + 5.99 cusr 2.38 csys = 9.03 CPU)
Result: PASS
$ make install
"/Users/hakonhaegland/perl5/perlbrew/perls/perl-5.30.1/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- Pg.bs blib/arch/auto/DBD/Pg/Pg.bs 644
Manifying 2 pod documents
Files found in blib/arch: installing files in blib/lib into architecture dependent library tree
Installing /Users/hakonhaegland/perl5/perlbrew/perls/perl-5.30.1/lib/site_perl/5.30.1/darwin-2level/auto/DBD/Pg/Pg.bundle
Installing /Users/hakonhaegland/perl5/perlbrew/perls/perl-5.30.1/lib/site_perl/5.30.1/darwin-2level/Bundle/DBD/Pg.pm
Installing /Users/hakonhaegland/perl5/perlbrew/perls/perl-5.30.1/lib/site_perl/5.30.1/darwin-2level/DBD/Pg.pm
Installing /Users/hakonhaegland/perl5/perlbrew/perls/perl-5.30.1/man/man3/Bundle::DBD::Pg.3
Installing /Users/hakonhaegland/perl5/perlbrew/perls/perl-5.30.1/man/man3/DBD::Pg.3
Appending installation info to /Users/hakonhaegland/perl5/perlbrew/perls/perl-5.30.1/lib/5.30.1/darwin-2level/perllocal.pod
My compiler version is:
$ cc --version
Apple clang version 11.0.0 (clang-1100.0.33.17)
Target: x86_64-apple-darwin19.5.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

Installing B::C with cpanm hangs?

When I install B::C with cpanm, it hangs
$ sudo cpanm B::C
--> Working on B::C
Fetching http://www.cpan.org/authors/id/R/RU/RURBAN/B-C-1.57.tar.gz ... OK
Configuring B-C-1.57 ... OK
Building and testing B-C-1.57 ... ^C
First you'll want to try to check the install by using the verbose flag cpanm -v B::C, after which you should see a lot of looping like
x86_64-linux-gnu-gcc -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fwrapv -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/lib/x86_64-linux-gnu/perl/5.28/CORE -o cccode1_o1 cccode1_o1.c -Wl,-E -fstack-protector-strong -L/usr/local/lib -L/usr/lib/x86_64-linux-gnu/perl/5.28/CORE -lperl -ldl -lm -lpthread -lc -lcrypt 2>/dev/null 2>&1
# /usr/bin/ld: cannot find -lperl
collect2: error: ld returned 1 exit status
This is because ld can't find libperl.so. If you're on Debian you'll need to run,
sudo apt install libperl-dev

How to recompile libperl.a object files with -fPIC flag?

This question arose when trying to fix some installation problems
with QtCore4. At some point make tried to run the following command:
/usr/bin/c++ -fPIC -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong \
-I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O3 -DNDEBUG \
-shared -Wl,-soname,QtCore4.so -o ../../blib/arch/auto/QtCore4/QtCore4.so \
CMakeFiles/perlqtcore4.dir/binding.cpp.o \
CMakeFiles/perlqtcore4.dir/handlers.cpp.o \
CMakeFiles/perlqtcore4.dir/marshall_types.cpp.o \
CMakeFiles/perlqtcore4.dir/util.cpp.o \
CMakeFiles/perlqtcore4.dir/QtCore4.c.o \
-lQtCore -lQtGui -lQtNetwork \
/home/hakon/perlbrew/perls/perl-5.24.1/lib/5.24.1/x86_64-linux/CORE/libperl.a \
../../smokeqt/qtgui/libsmokeqtgui.so.3.0.0 \
../../smokeqt/qtnetwork/libsmokeqtnetwork.so.3.0.0 \
-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc -lQtGui -lQtNetwork \
../../smokeqt/qtcore/libsmokeqtcore.so.3.0.0 -lQtCore \
../../smokegen/bin/libsmokebase.so.3.0.0 \
-Wl,-rpath,/home/hakon/Qt4-0.99.0/smokeqt/qtgui:/home/hakon/Qt4-0.99.0/smokeqt/qtnetwork:/home/hakon/Qt4-0.99.0/smokeqt/qtcore:/home/hakon/Qt4-0.99.0/smokegen/bin:
which failed with the following error message from the linker:
/usr/bin/ld: /home/hakon/perlbrew/perls/perl-5.24.1/lib/5.24.1/x86_64-linux/CORE/libperl.a(toke.o):
relocation R_X86_64_PC32 against symbol `PL_curcop' can not be used when making
a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
From the error message, it seems to me that the object files (here: toke.o) in
libperl.a was compiled without the -fPIC flag set.
The questions I have now are:
How can I recompile the object files in libperl.a with -fPIC ?
Could this recompilation cause other problems not related to
QtCore4 (since it is likely that libperl.a will be used (linked
with) by other applications/programs not related to QtCore4)?
I am using Ubuntu 16.10 and perl version 5.24.1.
How can I recompile the object files in libperl.a with -fPIC
By recompiling libperl.a with the -fPIC flag.
./Configure -des -Accflags=-fPIC ...
Could this recompilation cause other problems not related to QtCore4 (since it is likely that libperl.a will be used (linked with) by other applications/programs not related to QtCore4)?
Yes. Prefer a shared libperl. -Duseshrplib
Which is required when embedding perl into shared libs. You can do away with the -fPIC trick which is required on ELF, but a shared libperl makes it much easier.

ImageMagik on CentOS not working with PNG files

I am having trouble with ImageMagik on CentOS.
The error is:
Error: identify: no decode delegate for this image format `PNG' #
error/constitute.c/ReadImage/501.
convert -list configure
Path: /usr/lib64/ImageMagick-6.5.4/config/configure.xml
Name Value
-------------------------------------------------------------------------------
CC gcc -std=gnu99
CFLAGS -fopenmp -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -Wall -W -pthread
CONFIGURE ./configure '--build=x86_64-redhat-linux-gnu' '--host=x86_64-redhat-linux-gnu' '--target=x86_64-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib64' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/var/lib' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--enable-shared' '--disable-static' '--with-modules' '--with-perl' '--with-x' '--with-threads' '--with-magick_plus_plus' '--with-gslib' '--with-wmf' '--with-lcms' '--with-rsvg' '--with-xml' '--with-perl-options=INSTALLDIRS=vendor CC='\''gcc -L/builddir/build/BUILD/ImageMagick-6.5.4-7/magick/.libs'\'' LDDLFLAGS='\''-shared -L/builddir/build/BUILD/ImageMagick-6.5.4-7/magick/.libs'\''' '--without-dps' '--without-included-ltdl' '--with-ltdl-include=/usr/include' '--with-ltdl-lib=/usr/lib64' 'build_alias=x86_64-redhat-linux-gnu' 'host_alias=x86_64-redhat-linux-gnu' 'target_alias=x86_64-redhat-linux-gnu' 'CFLAGS=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic' 'CXXFLAGS=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic'
COPYRIGHT Copyright (C) 1999-2009 ImageMagick Studio LLC
CPPFLAGS -I/usr/include/ImageMagick
CXX g++
CXXFLAGS -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -Wall -W -pthread
DEFS -DHAVE_CONFIG_H
DELEGATES bzlib fontconfig freetype gs jpeg jng jp2 lcms openexr png rsvg tiff x11 xml wmf zlib
DISTCHECK_CONFIG_FLAGS 'CFLAGS=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic' --disable-deprecated --with-quantum-depth=16 --with-umem=no --with-autotrace=no --with-dps=no --with-fontpath=
EXEC-PREFIX /usr
HOST x86_64-redhat-linux-gnu
LDFLAGS -L/usr/lib64 -lfreetype
LIB_VERSION 0x654
LIB_VERSION_NUMBER 6,5,4,7
LIBS -lMagickCore -llcms -ltiff -lfreetype -ljpeg -lfontconfig -lXext -lSM -lICE -lX11 -lXt -lbz2 -lz -lm -lgomp -lpthread -lltdl
NAME ImageMagick
PCFLAGS -fopenmp
PREFIX /usr
QuantumDepth 16
RELEASE_DATE 2014-02-10
VERSION 6.5.4
WEBSITE http://www.imagemagick.org
I can see "PNG" in the list of DELEGATES but there doesn't seem to be anything in the LIBS section (see above).
I have tried installing libpng, which is already installed and I've have re-installed ImageMagik from source but it still isn't working.
Any ideas?
configure attempts to configure with every available image delegate, so when you're building from source, you'll need to have the libpng-devel package installed. If for some reason it didn't detect it, you may want to try forcing it with --with-png=yes in your options to configure to get some feedback.
See http://www.imagemagick.org/script/advanced-unix-installation.php

Installing Perl/Tk on fedora

I am having trouble trying to install perl Tk on my system(fedora,perl v5.8.8).I downloaded the tarred module from http://search.cpan.org/~srezic/Tk-804.029/pod/gencmd, untarred it.In the terminal,I gave "perl Makefile.PL" which worked fine and then "make" which could not complete.Here is what it gave:
"make[1]: Entering directory `/work/harikal/Tk-804.029/pTk'
gcc -c -I.. -I. -Ibitmaps -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -DVERSION=\"804.029\" -DXS_VERSION=\"804.029\" -fPIC "-I/usr/lib/perl5/5.8.8/i386-linux-thread-multi/CORE" -Wall -Wno-implicit-int -Wno-comment -Wno-unused -D__USE_FIXED_PROTOTYPES__ tkImgPhoto.c
tkImgPhoto.c: In function ‘AllocateColors’:
tkImgPhoto.c:3584: warning: implicit declaration of function ‘sazeof’
tkImgPhoto.c:3584: error: expected expression before ‘XColor’
make[1]: *** [tkImgPhoto.o] Error 1
make[1]: Leaving directory `/work/harikal/Tk-804.029/pTk'
make: *** [pTk/libpTk.a] Error 2"
and then it exits. What am I supposed to do??
Please Help
Thanks.
If you're using the system-installed Perl, then why not use the Fedora project's pre-built package for the module.
$ sudo yum install perl-Tk
I looked at http://cpansearch.perl.org/src/SREZIC/Tk-804.029/pTk/mTk/generic/tkImgPhoto.c - line 3584 and here says "sizeof" not "sazeof". Doublecheck your source/download.