Cannot force install GD with cpan/cpanm - perl

I have looked and seen similar issues posted but am unable to get GD working. the following error arises with libgd and libpng installed...
clang -c -I/usr/local/include -arch i386 -arch x86_64 -g -pipe -fno-common -DPERL_DARWIN -fno-strict-aliasing -fstack-protector -I/usr/local/include -Wformat=0 -Os -DVERSION=\"2.50\" -DXS_VERSION=\"2.50\" "-I/System/Library/Perl/5.12/darwin-thread-multi-2level/CORE" -DHAVE_FT -DHAVE_GIF -DHAVE_ANIMGIF -DVERSION_33 -DHAVE_UNCLOSEDPOLY -DHAVE_FTCIRCLE GD.c
GD.xs:997:18: warning: implicit declaration of function 'gdImageGifAnimBeginPtr' is invalid in C99 [-Wimplicit-function-declaration]
data = (void *) gdImageGifAnimBeginPtr(image,&size,globalcm,loops);
^
GD.xs:1022:18: warning: implicit declaration of function 'gdImageGifAnimAddPtr' is invalid in C99 [-Wimplicit-function-declaration]
data = (void *) gdImageGifAnimAddPtr(image,&size,localcm,leftofs,topofs,delay,disposal,previm);
^
GD.xs:1041:18: warning: implicit declaration of function 'gdImageGifAnimEndPtr' is invalid in C99 [-Wimplicit-function-declaration]
data = (void *) gdImageGifAnimEndPtr(&size);
^
GD.xs:1598:3: warning: implicit declaration of function 'gdImageOpenPolygon' is invalid in C99 [-Wimplicit-function-declaration]
gdImageOpenPolygon(image,polyptr,length,color);
^
GD.xs:2192:16: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
if (value = hv_fetch(hash,"linespacing",strlen("linespacing"),0)) {
~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
GD.xs:2192:16: note: place parentheses around the assignment to silence this warning
if (value = hv_fetch(hash,"linespacing",strlen("linespacing"),0)) {
^
( )
...
2 warnings generated.
rm -f blib/arch/auto/GD/GD.bundle
LD_RUN_PATH="/usr/lib:/usr/local/lib" clang -mmacosx-version-min=10.8 -arch i386 -arch x86_64 -bundle -undefined dynamic_lookup -L/usr/local/lib -fstack-protector GD.o -o blib/arch/auto/GD/GD.bundle \
-L/usr/local/lib -lz -liconv -lgd \
ld: warning: ignoring file /usr/local/lib/libgd.dylib, file was built for x86_64 which is not the architecture being linked (i386): /usr/local/lib/libgd.dylib
chmod 755 blib/arch/auto/GD/GD.bundle
/usr/bin/perl -MExtUtils::Command::MM -e 'cp_nonempty' -- GD.bs blib/arch/auto/GD/GD.bs 644
/usr/bin/perl "-Iblib/arch" "-Iblib/lib" bdf_scripts/bdf2gdfont.PLS bdf_scripts/bdf2gdfont.pl
Extracting bdf2gdfont.pl (with variable substitutions)
cp bdf_scripts/bdf2gdfont.pl blib/script/bdf2gdfont.pl
/usr/bin/perl -MExtUtils::MY -e 'MY->fixin(shift)' -- blib/script/bdf2gdfont.pl
Manifying blib/man1/bdf2gdfont.pl.1
Manifying blib/man3/GD.3pm
Manifying blib/man3/GD::Image.3pm
Manifying blib/man3/GD::Polygon.3pm
Manifying blib/man3/GD::Polyline.3pm
Manifying blib/man3/GD::Simple.3pm
Running Mkbootstrap for GD ()
chmod 644 GD.bs
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
Testing using gif support.
t/GD.t ........
Failed 6/12 subtests
(less 3 skipped subtests: 3 okay)
t/Polyline.t .. ok
Test Summary Report
-------------------
t/GD.t (Wstat: 0 Tests: 12 Failed: 6)
Failed tests: 2-7
Files=2, Tests=13, 0 wallclock secs ( 0.02 usr 0.01 sys + 0.10 cusr 0.01 csys = 0.14 CPU)
Result: FAIL
Failed 1/2 test programs. 6/13 subtests failed.
make: *** [test_dynamic] Error 255
-> FAIL Installing GD failed. See /Users/lraven/.cpanm/work/1391048234.74068/build.log for details. Retry with --force to force install it.
Expiring 19 work directories.
All other modules I need are installing, just not GD.
I am using OS X 10.8.5, bash version 3.2.48, perl version 5.012 and cpanm version 1.7

Before you can install GD the Perl module you must have installed a number of other libraries first, including the gd graphics library itself (libgd), the PNG library (libpng) and optionally the JPEG and FreeType libraries.
You will probably find it easier to use MacPorts to install these libraries, and you can then install GD from there too - the package is called p5.14-gd (or whatever matches your perl version)

Following up on this - To get circos to work I did the following....
1/ I installed all modules using cpanm
wget -O- http://cpanmin.us | perl - -l ~/perl5 App::cpanminus local::lib
eval `perl -I ~/perl5/lib/perl5 -Mlocal::lib`
cpanm Config::General
cpanm Font::TTF
cpanm List::MoreUtils
cpanm Math::Bezier
cpanm Math::Round
cpanm Math::VecStat
cpanm Params::Validate
cpanm Readonly
cpanm Regexp::Common
cpanm Set::IntSpan
cpanm Text::Format
cpanm Clone
cpanm GD
echo 'eval `perl -I ~/perl5/lib/perl5 -Mlocal::lib`' >> ~/.profile
GD would not install. To fix this:
I Downloaded and installed macports from http://www.macports.org/install.php
sudo /opt/local/bin/port install gd2
sudo /opt/local/bin/port install jpeg
sudo /opt/local/bin/port install libpng
sudo /opt/local/bin/port install libgda5
I got an error associated with gnome desktop and ran
sudo /opt/local/bin/port clean gnome-desktop then reinstalled libgd
Finally, to get GD to a spot where perl will find it…
export PATH=/opt/local/bin:/opt/local/sbin:$PATH

Related

Errors trying to install perl Image::Magick module on macOS, ventura, 13.2 (Intel machine)

I have imagemagick installed with brew as well as opencl-headers. Trying to install perl's Image::Magick module running on Perl 5.36, I get the following errors running cpanm Image::Magick:
Writing MYMETA.yml and MYMETA.json
OK
Checking dependencies from MYMETA.json ...
Checking if you have ExtUtils::MakeMaker 0 ... Yes (7.64)
Checking if you have parent 0 ... Yes (0.238)
Building and testing Image-Magick-v7.0.11 ... cp Magick.pm blib/lib/Image/Magick.pm
AutoSplitting blib/lib/Image/Magick.pm (blib/lib/auto/Image/Magick)
Running Mkbootstrap for Magick ()
chmod 644 "Magick.bs"
"/Users/steve/perl5/perlbrew/perls/perl-5.36.0/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- Magick.bs blib/arch/auto/Image/Magick/Magick.bs 644
"/Users/steve/perl5/perlbrew/perls/perl-5.36.0/bin/perl" "/Users/steve/perl5/perlbrew/perls/perl-5.36.0/lib/5.36.0/ExtUtils/xsubpp" -typemap '/Users/steve/perl5/perlbrew/perls/perl-5.36.0/lib/5.36.0/ExtUtils/typemap' -typemap '/Users/steve/.cpanm/work/1675177488.60361/Image-Magick-7.0.11/typemap' Magick.xs > Magick.xsc
mv Magick.xsc Magick.c
cc -c -I/usr/local/include/ImageMagick-7 -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16 -I/usr/include/libxml2 -I"/usr/include/ImageMagick-7" -fno-common -DPERL_DARWIN -mmacosx-version-min=12.5 -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -DPERL_USE_SAFE_PUTENV -I/usr/include/freetype2 -g -O2 -Wall -pthread -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16 -Wno-error=implicit-function-declaration -O3 -DVERSION=\"7.0.11\" -DXS_VERSION=\"7.0.11\" "-I/Users/steve/perl5/perlbrew/perls/perl-5.36.0/lib/5.36.0/darwin-2level/CORE" -D_LARGE_FILES=1 -DHAVE_CONFIG_H Magick.c
rm -f blib/arch/auto/Image/Magick/Magick.bundle
LD_RUN_PATH="/usr/local/lib:/usr/lib" cc -Wl,-rpath,"/usr/local/lib:/usr/lib" -L/usr/local/lib -lMagickCore-7.Q16HDRI -mmacosx-version-min=12.5 -bundle -undefined dynamic_lookup -L/usr/local/lib -fstack-protector-strong Magick.o -o blib/arch/auto/Image/Magick/Magick.bundle \
-L/usr/local/lib -lMagickCore-7.Q16HDRI -lm -L/Users/steve/perl5/perlbrew/perls/perl-5.36.0/lib/5.36.0/darwin-2level/CORE \
ld: warning: -undefined dynamic_lookup may not work with chained fixups
ld: warning: dylib (/usr/local/lib/libMagickCore-7.Q16HDRI.dylib) was built for newer macOS version (13.0) than being linked (12.5)
chmod 755 blib/arch/auto/Image/Magick/Magick.bundle
Manifying 1 pod document
"/Users/steve/perl5/perlbrew/perls/perl-5.36.0/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- Magick.bs blib/arch/auto/Image/Magick/Magick.bs 644
PERL_DL_NONLAZY=1 "/Users/steve/perl5/perlbrew/perls/perl-5.36.0/bin/perl" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/blob.t .......... ok
t/composite.t ..... ok
t/filter.t ........ ok
t/getattribute.t .. ok
t/montage.t ....... ok
t/ping.t .......... ok
t/read.t .......... ok
t/setattribute.t .. ok
t/write.t ......... Failed 1/32 subtests
Test Summary Report
-------------------
t/write.t (Wstat: 0 Tests: 32 Failed: 1)
Failed test: 24
Files=9, Tests=273, 2 wallclock secs ( 0.06 usr 0.02 sys + 4.10 cusr 0.56 csys = 4.74 CPU)
Result: FAIL
Failed 1/9 test programs. 1/273 subtests failed.
make: *** [test_dynamic] Error 255
FAIL
Also seem to be having issues
Based on the name of the test that was failing:
t/write.t ......... Failed 1/32 subtests
It seems like the problem was likely some kind of permission issue. So I did "cpanm --force Image::Magick". After installing, my Perl script which uses ImageMagick works fine.
Without wishing in the slightest to disparage the work of any of the good folk who port and maintain packages for us, I note the following:
there are just 37 questions tagged perlmagick on StackOverflow, versus 9,000+ on ImageMagick - so your chances of support/assistance are distinctly lower with Perl
Apple has stated its intention to discontinue Perl, PHP and other interpreters in the next macOS version and it is getting more difficult with each macOS release to use ImageMagick with PHP and Perl.
Given the above, I would personally think twice about investing a large amount of effort into PerlMagick on macOS - especially when you consider that it is very simple to use docker and if you go that way, you can run your docker image on any macOS or Linux machine without worrying about the vagaries of the distribution. So, here is a very simple way to run PerlMagick in docker:
docker run -it alpine # 2 seconds later
apk update && apk add perl imagemagick-perlmagick # 8 seconds later
# All ready to run PerlMagick - let's test a simple example
perl -MImage::Magick -le 'print Image::Magick->QuantumDepth'
16
Of course, you can put the two apk package management commands into a Dockerfile so they are built-in and don't need running each time.
You can also dynamically bind-mount any macOS directory full of images to process into the docker image so that it can read/write them.

Cannot install Net::SSLeay using CPAN: /bin/sh: x86_64-apple-darwin13.4.0-clang: command not found

I am trying to install Net::SSLeay using CPAN. I am working on a mac and openssl is installed, it is giving me the error: /bin/sh: x86_64-apple-darwin13.4.0-clang: command not found. This was during a force install -- here is the entire output:
cpan[1]> force install Net::SSLeay
Reading '/Users/me/.cpan/Metadata'
Database was generated on Sat, 14 Nov 2020 21:29:03 GMT
Running install for module 'Net::SSLeay'
Checksum for /Users/me/.cpan/sources/authors/id/C/CH/CHRISN/Net-SSLeay-1.88.tar.gz ok
Scanning cache /Users/me/.cpan/build for sizes
............................................................................DONE
'YAML' not installed, will not store persistent state
Configuring C/CH/CHRISN/Net-SSLeay-1.88.tar.gz with Makefile.PL
Do you want to run external tests?
These tests *will* *fail* if you do not have network connectivity. [n] y
*** Found OpenSSL-1.1.1h installed in /usr/local/opt/openssl
*** Be sure to use the same compiler and options to compile your OpenSSL, perl,
and Net::SSLeay. Mixing and matching compilers is not supported.
Checking if your kit is complete...
Looks good
Warning (mostly harmless): No library found for -lz
Generating a Unix-style Makefile
Writing Makefile for Net::SSLeay
Writing MYMETA.yml and MYMETA.json
CHRISN/Net-SSLeay-1.88.tar.gz
/Users/me/miniconda3/bin/perl Makefile.PL -- OK
Running make for C/CH/CHRISN/Net-SSLeay-1.88.tar.gz
cp lib/Net/SSLeay.pod blib/lib/Net/SSLeay.pod
cp lib/Net/SSLeay/Handle.pm blib/lib/Net/SSLeay/Handle.pm
cp lib/Net/SSLeay.pm blib/lib/Net/SSLeay.pm
AutoSplitting blib/lib/Net/SSLeay.pm (blib/lib/auto/Net/SSLeay)
blib/lib/Net/SSLeay.pm: some names are not unique when truncated to 8 characters:
directory blib/lib/auto/Net/SSLeay:
do_https3.al, do_https2.al, do_https4.al, do_https.al truncate to do_https
do_httpx3.al, do_httpx2.al, do_httpx4.al truncate to do_httpx
get_https.al, get_https3.al, get_https4.al, get_http.al, get_http3.al, get_http4.al, get_httpx.al, get_httpx3.al, get_httpx4.al truncate to get_http
head_https.al, head_https3.al, head_https4.al, head_http.al, head_http3.al, head_http4.al, head_httpx.al, head_httpx3.al, head_httpx4.al truncate to head_htt
post_https.al, post_https3.al, post_https4.al, post_http.al, post_http3.al, post_http4.al, post_httpx.al, post_httpx3.al, post_httpx4.al truncate to post_htt
put_https.al, put_https3.al, put_https4.al, put_http.al, put_http3.al, put_http4.al, put_httpx.al, put_httpx3.al, put_httpx4.al truncate to put_http
ssl_read_all.al, ssl_read_until.al, ssl_read_CRLF.al truncate to ssl_read
ssl_write_all.al, ssl_write_CRLF.al truncate to ssl_writ
tcp_read_all.al, tcp_read_until.al, tcp_read_CRLF.al truncate to tcp_read
tcp_write_all.al, tcp_write_CRLF.al truncate to tcp_writ
Running Mkbootstrap for SSLeay ()
chmod 644 "SSLeay.bs"
"/Users/me/miniconda3/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- SSLeay.bs blib/arch/auto/Net/SSLeay/SSLeay.bs 644
"/Users/me/miniconda3/bin/perl" "/Users/me/miniconda3/lib/5.26.2/ExtUtils/xsubpp" -typemap '/Users/me/miniconda3/lib/5.26.2/ExtUtils/typemap' -typemap '/Users/me/.cpan/build/Net-SSLeay-1.88-2/typemap' SSLeay.xs > SSLeay.xsc
mv SSLeay.xsc SSLeay.c
x86_64-apple-darwin13.4.0-clang -c -I"/usr/local/opt/openssl/include" -fno-common -DPERL_DARWIN -no-cpp-precomp -mmacosx-version-min=10.9 -fno-strict-aliasing -pipe -fstack-protector-strong -DPERL_USE_SAFE_PUTENV -O3 -DVERSION=\"1.88\" -DXS_VERSION=\"1.88\" -fPIC --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk "-I/Users/me/miniconda3/lib/5.26.2/darwin-thread-multi-2level/CORE" SSLeay.c
/bin/sh: x86_64-apple-darwin13.4.0-clang: command not found
make: *** [Makefile:350: SSLeay.o] Error 127
CHRISN/Net-SSLeay-1.88.tar.gz
/Users/me/miniconda3/bin/make -- NOT OK
Failed during this command:
CHRISN/Net-SSLeay-1.88.tar.gz : make NO
If I could get some help installing this module it would be much appreciated. Other people have run into similar problems here, but they are always solved by installing openssl... I have already done this. Thanks.
You've got a wrong perl.
Your perl -V:cc configuration defines an invalid compiler, so you cannot compile extensions. You need a new perl, or fixup your two Config modules defining this wrong compiler.
Like as with:
sed -i 's,x86_64-apple-darwin13.4.0-clang,gcc,' `perl -V::archlib:`/Config_heavy.pl `perl -V::archlib:`/Config.pm

Perl Libraries configuration, conflicts

I'm having troubles with Perl in my server machine I'm not an admin, but I assume I have created my environment, it was working just fine until I installed Conda.
I install Perl using brew so it can help me to configure his libraries.
brew info perl
perl: stable 5.32.0, HEAD
Highly capable, feature-rich programming language
https://www.perl.org/
/lustre/mnad/.linuxbrew/Cellar/perl/5.32.0
If I called cpan Don't work return error below:
ListUtil.c: loadable library and perl binaries are mismatched (got handshake key 0xcd00080, needed 0xed00080)
unless I unset PERL5LIB env or export it to Perl in the brew
env | grep PERL
PERL5LIB=/lustre/mnad/.linuxbrew/Cellar/perl/5.32.0/lib/perl5/5.32.0:
PERL_MB_OPT=--install_base "/lustre/mnad/perl5"
PERL_LOCAL_LIB_ROOT=:/lustre/mnad/perl5
PERL_MM_OPT=INSTALL_BASE=/lustre/mnad/perl5
when I make I run for any Perl script an error occurs:
Can't locate local/lib.pm in #INC (you may need to install the local::lib module) (#INC contains: /lustre....
Can't locate Text/Soundex.pm in #INC (you may need to install the Text::Soundex module) ....
then I tried to
cpan[1]> install local::lib
Reading '/lustre/mnad/.cpan/Metadata'
Database was generated on Tue, 14 Jul 2020 02:17:04 GMT
Running install for module 'local::lib'
Checksum for /lustre/mnad/.cpan/sources/authors/id/H/HA/HAARG/local-lib-2.000024.tar.gz ok
Scanning cache /lustre/mnad/.cpan/build for sizes
............................................................................DONE
'YAML' not installed, will not store persistent state
Configuring H/HA/HAARG/local-lib-2.000024.tar.gz with Makefile.PL
Checking if your kit is complete...
Looks good
Generating a Unix-style Makefile
Writing Makefile for local::lib
Writing MYMETA.yml and MYMETA.json
HAARG/local-lib-2.000024.tar.gz
/lustre/mnad/.linuxbrew/Cellar/perl/5.32.0/bin/perl Makefile.PL -- OK
Running make for H/HA/HAARG/local-lib-2.000024.tar.gz
cp lib/local/lib.pm blib/lib/local/lib.pm
cp lib/POD2/PT_BR/local/lib.pod blib/lib/POD2/PT_BR/local/lib.pod
cp lib/lib/core/only.pm blib/lib/lib/core/only.pm
cp lib/POD2/DE/local/lib.pod blib/lib/POD2/DE/local/lib.pod
Manifying 4 pod documents
HAARG/local-lib-2.000024.tar.gz
/usr/bin/make -- OK
The current configuration of allow_installing_outdated_dists is 'ask/yes', but for this option we would need 'CPAN::DistnameInfo' installed. Please install 'CPAN::DistnameInfo' as soon as possible. As long as we are not equipped with 'CPAN::DistnameInfo' this option does not take effect
Running make test for HAARG/local-lib-2.000024.tar.gz
PERL_DL_NONLAZY=1 "/lustre/mnad/.linuxbrew/Cellar/perl/5.32.0/bin/perl" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/bad_variables.t ...... ok
t/carp-mismatch.t ...... ok
t/classmethod.t ........ ok
t/de-dup.t ............. ok
t/lib-core-only.t ...... ok
t/pipeline.t ........... ok
t/shell.t .............. ok
t/stackable.t .......... ok
t/subroutine-in-inc.t .. ok
t/taint-mode.t ......... ok
All tests successful.
Files=10, Tests=220, 7 wallclock secs ( 0.08 usr 0.03 sys + 2.68 cusr 2.53 csys = 5.32 CPU)
Result: PASS
Terminal does not support GetHistory.
Lockfile removed.
HAARG/local-lib-2.000024.tar.gz
/usr/bin/make test -- OK
Running make install for HAARG/local-lib-2.000024.tar.gz
Manifying 4 pod documents
Appending installation info to /lustre/mnad/perl5/lib/perl5/x86_64-linux-thread-multi/perllocal.pod
HAARG/local-lib-2.000024.tar.gz
/usr/bin/make install -- OK
and
cpan[2]> install Text::Soundex
Running install for module 'Text::Soundex'
Checksum for /lustre/mnad/.cpan/sources/authors/id/R/RJ/RJBS/Text-Soundex-3.05.tar.gz ok
Configuring R/RJ/RJBS/Text-Soundex-3.05.tar.gz with Makefile.PL
The XS code will be compiled.
Checking if your kit is complete...
Looks good
Generating a Unix-style Makefile
Writing Makefile for Text::Soundex
Writing MYMETA.yml and MYMETA.json
RJBS/Text-Soundex-3.05.tar.gz
/lustre/mnad/.linuxbrew/Cellar/perl/5.32.0/bin/perl Makefile.PL -- OK
Running make for R/RJ/RJBS/Text-Soundex-3.05.tar.gz
cp Soundex.pm blib/lib/Text/Soundex.pm
Running Mkbootstrap for Soundex ()
chmod 644 "Soundex.bs"
"/lustre/mnad/.linuxbrew/Cellar/perl/5.32.0/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- Soundex.bs blib/arch/auto/Text/Soundex/Soundex.bs 644
"/lustre/mnad/.linuxbrew/Cellar/perl/5.32.0/bin/perl" "/lustre/mnad/.linuxbrew/Cellar/perl/5.32.0/lib/perl5/5.32.0/ExtUtils/xsubpp" -typemap '/lustre/mnad/.linuxbrew/Cellar/perl/5.32.0/lib/perl5/5.32.0/ExtUtils/typemap' Soundex.xs > Soundex.xsc
mv Soundex.xsc Soundex.c
cc -c -D_REENTRANT -D_GNU_SOURCE -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/lustre/mnad/.linuxbrew/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -O2 -DVERSION=\"3.05\" -DXS_VERSION=\"3.05\" -fPIC "-I/lustre/mnad/.linuxbrew/Cellar/perl/5.32.0/lib/perl5/5.32.0/x86_64-linux-thread-multi/CORE" Soundex.c
rm -f blib/arch/auto/Text/Soundex/Soundex.so
cc -shared -O2 -L/usr/local/lib -fstack-protector-strong Soundex.o -o blib/arch/auto/Text/Soundex/Soundex.so \
\
chmod 755 blib/arch/auto/Text/Soundex/Soundex.so
Manifying 1 pod document
RJBS/Text-Soundex-3.05.tar.gz
/usr/bin/make -- OK
The current configuration of allow_installing_outdated_dists is 'ask/yes', but for this option we would need 'CPAN::DistnameInfo' installed. Please install 'CPAN::DistnameInfo' as soon as possible. As long as we are not equipped with 'CPAN::DistnameInfo' this option does not take effect
Running make test for RJBS/Text-Soundex-3.05.tar.gz
"/lustre/mnad/.linuxbrew/Cellar/perl/5.32.0/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- Soundex.bs blib/arch/auto/Text/Soundex/Soundex.bs 644
PERL_DL_NONLAZY=1 "/lustre/mnad/.linuxbrew/Cellar/perl/5.32.0/bin/perl" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/basic.t .. ok
All tests successful.
Files=1, Tests=18, 0 wallclock secs ( 0.03 usr 0.01 sys + 0.01 cusr 0.02 csys = 0.07 CPU)
Result: PASS
RJBS/Text-Soundex-3.05.tar.gz
/usr/bin/make test -- OK
Running make install for RJBS/Text-Soundex-3.05.tar.gz
"/lustre/mnad/.linuxbrew/Cellar/perl/5.32.0/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- Soundex.bs blib/arch/auto/Text/Soundex/Soundex.bs 644
Manifying 1 pod document
Files found in blib/arch: installing files in blib/lib into architecture dependent library tree
Appending installation info to /lustre/mnad/perl5/lib/perl5/x86_64-`linux-thread`-multi/perllocal.pod
RJBS/Text-Soundex-3.05.tar.gz
/usr/bin/make install -- OK
Both are installed but when I rerun the Perl tool similar error occurs:
Can't locate local/lib.pm in #INC (you may need to install the local::lib module) (#INC contains: /lustre/mnad/.linuxbrew/Cellar/perl/5.32.0/lib/perl5/5.32.0/x86_64-linux-thread-multi /lustre/mnad/.linuxbrew/Cellar/perl/5.32.0/lib/perl5/5.32.0 /lustre/mnad/.linuxbrew/Cellar/perl/5.32.0/lib/perl5/site_perl/5.32.0/x86_64-linux-thread-multi /lustre/mnad/.linuxbrew/Cellar/perl/5.32.0/lib/perl5/site_perl/5.32.0 /lustre/mnad/.linuxbrew/Cellar/perl/5.32.0/lib/perl5/5.32.0/x86_64-linux-thread-multi /lustre/mnad/.linuxbrew/Cellar/perl/5.32.0/lib/perl5/5.32.0 /lustre/mnad/.linuxbrew/lib/perl5/site_perl/5.32.0/x86_64-linux-thread-multi /lustre/mnad/.linuxbrew/lib/perl5/site_perl/5.32.0).
BEGIN failed--compilation aborted.
Can't locate Text/Soundex.pm in #INC (you may need to install the Text::Soundex module) (#INC contains: /lustre/mnad/Tools/RM /lustre/mnad/.linuxbrew/Cellar/perl/5.32.0/lib/perl5/5.32.0/x86_64-linux-thread-multi /lustre/mnad/.linuxbrew/Cellar/perl/5.32.0/lib/perl5/5.32.0 /lustre/mnad/.linuxbrew/Cellar/perl/5.32.0/lib/perl5/site_perl/5.32.0/x86_64-linux-thread-multi /lustre/mnad/.linuxbrew/Cellar/perl/5.32.0/lib/perl5/site_perl/5.32.0 /lustre/mnad/.linuxbrew/lib/perl5/site_perl/5.32.0/x86_64-linux-thread-multi /lustre/mnad/.linuxbrew/lib/perl5/site_perl/5.32.0) at /lustre/mnad/Tools/RM/Taxonomy.pm line 80.
BEGIN failed--compilation aborted at /lustre/mnad/Tools/RM/Taxonomy.pm line 80.
Compilation failed in require at ./RepeatMasker line 332.
BEGIN failed--compilation aborted at ./RepeatMasker line 332.
/usr/bin/perl: symbol lookup error: /lustre/mnad/.linuxbrew/Cellar/perl/5.32.0/lib/perl5/5.32.0/x86_64-linux-thread-multi/auto/Socket/Socket.so: undefined symbol: Perl_xs_handshake
Someone help my struggle, please.
which Perl
perl is /lustre/mnad/.linuxbrew/bin/perl
perl is /lustre/mnad/.linuxbrew/bin/perl
perl is /usr/bin/perl
perl --version
This is perl 5, version 32, subversion 0 (v5.32.0) built for x86_64-linux-thread-multi
cpan -v
ListUtil.c: loadable library and perl binaries are mismatched (got handshake key 0xcd00080, needed 0xed00080)
which cpan
cpan is /lustre/mnad/.linuxbrew/bin/cpan
cpan is /lustre/mnad/.linuxbrew/bin/cpan
cpan is /lustre/mnad/perl5/bin/cpan
cpan is /usr/bin/cpan
This line able to solve it and Cpan start to work, But I still I don't have clear picture.
cd /lustre/mnad && mv perl5 perl5.old

Perl can't install Net::SSL

In order to install RT4.2, I tried to install Net::SSL, but without success. This is the output: (Ubuntu Server12.04, perl 5.14.2)
When I choice N selection that don't test connection, also can't success.
sudo cpan install Net::SSL
[sudo] password for hengaini:
Going to read '/home/hengaini/.cpan/Metadata'
Database was generated on Thu, 20 Feb 2014 09:41:02 GMT
Running install for module 'Net::SSL'
Running make for N/NA/NANIS/Crypt-SSLeay-0.64.tar.gz
Checksum for /home/hengaini/.cpan/sources/authors/id/N/NA/NANIS/Crypt-SSLeay-0.64.tar.gz ok
CPAN.pm: Going to build N/NA/NANIS/Crypt-SSLeay-0.64.tar.gz
The test suite can attempt to connect to public servers to ensure that the
code is working properly. If you are behind a strict firewall or have no
network connectivity, these tests may fail (through no fault of the code).
Do you want to run the live tests (y/N)? [N] y
Checking if your kit is complete...
Looks good
Warning (mostly harmless): No library found for -lssl32
Warning (mostly harmless): No library found for -lssleay32
Warning (mostly harmless): No library found for -leay32
Generating a Unix-style Makefile
Writing Makefile for Crypt::SSLeay
Writing MYMETA.yml and MYMETA.json
cp lib/Crypt/SSLeay/X509.pm blib/lib/Crypt/SSLeay/X509.pm
cp lib/Net/SSL.pm blib/lib/Net/SSL.pm
cp lib/Crypt/SSLeay/MainContext.pm blib/lib/Crypt/SSLeay/MainContext.pm
cp lib/Crypt/SSLeay/Conn.pm blib/lib/Crypt/SSLeay/Conn.pm
cp lib/Crypt/SSLeay/CTX.pm blib/lib/Crypt/SSLeay/CTX.pm
cp SSLeay.pm blib/lib/Crypt/SSLeay.pm
cp lib/Crypt/SSLeay/Err.pm blib/lib/Crypt/SSLeay/Err.pm
/usr/bin/perl /usr/share/perl/5.14/ExtUtils/xsubpp -typemap /usr/share/perl/5.14/ExtUtils/typemap -typemap typemap SSLeay.xs > SSLeay.xsc && mv SSLeay.xsc SSLeay.c
cc -c -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g -DVERSION=\"0.64\" -DXS_VERSION=\"0.64\" -fPIC "-I/usr/lib/perl/5.14/CORE" SSLeay.c
rm -f blib/arch/auto/Crypt/SSLeay/SSLeay.so
LD_RUN_PATH="/lib/x86_64-linux-gnu" cc -shared -O2 -g -L/usr/local/lib -fstack-protector SSLeay.o -o blib/arch/auto/Crypt/SSLeay/SSLeay.so \
-lz -lssl -lcrypto \
chmod 755 blib/arch/auto/Crypt/SSLeay/SSLeay.so
/usr/bin/perl -MExtUtils::Command::MM -e 'cp_nonempty' -- SSLeay.bs blib/arch/auto/Crypt/SSLeay/SSLeay.bs 644
Manifying blib/man3/Crypt::SSLeay.3pm
Manifying blib/man3/Net::SSL.3pm
NANIS/Crypt-SSLeay-0.64.tar.gz
/usr/bin/make -- OK
Running make test
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/00-basic.t .... ok
t/01-connect.t .. 1/8
# Failed test 'Net::SSL->new'
# at t/01-connect.t line 28.
# Connect failed: connect: 拒绝连接; 拒绝连接 at t/01-connect.t line 11.
# Looks like you failed 1 test of 8.
t/01-connect.t .. Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/8 subtests
(less 7 skipped subtests: 0 okay)
t/02-live.t ..... # Reading configuration from 'test.config' on linux
# network_tests : 1
t/02-live.t ..... 1/? # [RT #73755] Cheat by disabling LWP::UserAgent host verification
t/02-live.t ..... ok
Test Summary Report
-------------------
t/01-connect.t (Wstat: 256 Tests: 8 Failed: 1)
Failed test: 1
Non-zero exit status: 1
Files=3, Tests=28, 2 wallclock secs ( 0.03 usr 0.00 sys + 0.53 cusr 0.30 csys = 0.86 CPU)
Result: FAIL
Failed 1/3 test programs. 1/28 subtests failed.
make: *** [test_dynamic] 错误 255
NANIS/Crypt-SSLeay-0.64.tar.gz
/usr/bin/make test -- NOT OK
//hint// to see the cpan-testers results for installing this module, try:
reports NANIS/Crypt-SSLeay-0.64.tar.gz
Running make install
make test had returned bad status, won't install without force
A very old question, but I was stuck searching for this as well
Instead of attempting to install Perl's SSL modules with CPAN, you should, as #TLP stated in their comment on the original question, use the Ubuntu package manager
apt-cache search net-ssl
Will give a list of packages. For example:
apt install libnet-ssleay-perl
apt install libcrypt-ssleay-perl
These worked for me on Perl v5.20 and v5.30. You will have to search to see which libraries work for yours using apt-cache search
Better yet, I hope you are using a perlbrew or plenv based environment, and since you have at least bothered to install cpan rather than rely on the default packages.
So you seem to missing the libraries and headers for SSL on your system, fix this by:
sudo apt-get install libssl-dev
And if you haven'y already, look into setting up your environment with one of the methods as linked above and look into cpanminus as well for a very useful tool that compliments either of these.
Your problem is that testing after build was not successful and error is occurred in this file t/01-connect.t line 11.
eval {
$sock = Net::SSL->new(
PeerAddr => '127.0.0.1',
PeerPort => 443,
Timeout => 3,
);
};
I can assume that some process is already listening on 127.0.0.1 443 port. Try to stop it and reinstall it again in the way you would like. Tests should always be passed.

Keys for Net::SSH2

I have a simple perl test script which uses Net::SSH2, and I'm having trouble getting it to work with public key authentication.
Note: After reading a couple of replies, I realise that I should mention that I created the script to help narrow down a problem I was having with another application that uses Net::SSH2. It's therefore not possible for me to switch to an alternative package such as Net::OpenSSH or Net::OpenSSH::Compat::SSH2.
Note Update: As salva pointed out, Net::OpenSSH::Compat::SSH2 can be used without having to patch the original application.
Here's the code:
use strict;
use warnings;
use 5.10.0;
use Net::SSH2;
my $ssh2 = Net::SSH2->new();
my $auth;
if ( $ssh2->connect('hostname') ) {
$auth = $ssh2->auth_publickey(
'username',
'/home/mike/.ssh/id_rsa.pub',
'/home/mike/.ssh/id_rsa',
'password'
);
}
if ($auth && $ssh2->auth_ok) {
say 'Success';
} else {
say join ', ', $ssh2->error;
}
I have been generating key pairs using ssh-keygen on Ubuntu:
ssh-keygen -t rsa
ssh-copy-id user#server
ssh user#server
The above works correctly - I can SSH to the server.
When I run the Perl code, I get the following error when using a password protected key:
-16, LIBSSH2_ERROR_FILE, Unable to initialize private key from file
If I try with a non-password protected key, it works correctly.
I have the following libraries installed:
Net::SSH2 0.35
libssh2-1 1.2.2-1
libssh2-1-dev 1.2.2-1
ssh 1:5.3p1-3ubuntu6
openssh-server 1:5.3p1-3ubuntu6
openssh-client 1:5.3p1-3ubuntu6
openssl 0.9.8k-7ubuntu8.6
libssl-dev 0.9.8k-7ubuntu8.6
The plot thickens
If I remove libssh2-1 and libssh2-1-dev, I get an error, as expected:
Can't load '/usr/local/lib/perl/5.10.1/auto/Net/SSH2/SSH2.so'
If I then build libssh2 from source, I am unable to reinstall Net::SSH2, as it can't find the development headers. However, if I reinstall libssh2-1 and libssh2-1-dev and then build and install libssh2 from source, it works.
Does that mean that the build of libssh2-1-dev on Ubuntu 10.04 is at fault? If so, how do I install libssh2 from source and correctly install Net::SSH2, without requiring libssh2-1-dev. I presume that the build from source is overwriting or overriding the Ubuntu package.
UPDATE
As noted in Daniel Stenberg's reply, the Ubuntu 10.04 package is now a little out of date (version 1.2.2, compared with the latest stable build at 1.2.8). Installing libssh2 from source 'over the top' of the Ubuntu package solves the problem. However, this feels messy to me. How can I remove the Ubuntu package, install libssh2 from source, and still build Net::SSH2 — how do I tell Net::SSH2 where to find the libssh2 development headers?
UPDATE 2
salva came to the rescue again, and showed how the Net::SSH2 installer can be configured with lib and include directories, so that it may be used with the source install of libssh2. Thanks salva! Note that instead of patching Makefile.PL, it's possible to just override the $lib and $inc variables at the top of Makefile.PL. I wasn't aware of this until I looked at salva's patch.
I have been able to successfully log into a server using a pass-phrase protected key with Net::SSH2 from the the Ubuntu 11.04 libnet-ssh2-perl package.
Anyway, consider using Net::OpenSSH or Net::OpenSSH::Compat::SSH2 instead of Net::SSH2.
Update: Net::OpenSSH::Compat::SSH2 tries to be a replacement for Net::SSH2. There is no need to patch the application in order to try it:
perl -MNet::OpenSSH::Compat=Net::SSH2 yor_app.pl
When you install libssh2 from the source package it will by default install itself in /usr/local, while the default package installs in /usr which probably is why it only finds the "stock" installed version.
Unfortunately it seems your Ubuntu has a fairly old libssh2 version as it has been bugfixed a lot since then.
I recommend using the libssh2-devel mailing list for in-depth libssh2 questions. It's a small but friendly community.
I have created a patch for Net::SSH2 Makefile.PL that allows to set the location of libssh2 libs and headers from the command line.
Here is a capture of the full build process for libssh2 + Net::SSH2 using it:
salva#leon:/tmp/salva$ wget http://www.libssh2.org/download/libssh2-1.2.8.tar.gz
--2011-05-27 11:21:10-- http://www.libssh2.org/download/libssh2-1.2.8.tar.gz
Resolving www.libssh2.org... 80.67.6.50
Connecting to www.libssh2.org|80.67.6.50|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 637707 (623K) [application/x-gzip]
Saving to: `libssh2-1.2.8.tar.gz'
100%[================================================================================================================================================================================================>] 637,707 525K/s in 1.2s
2011-05-27 11:21:14 (525 KB/s) - `libssh2-1.2.8.tar.gz' saved [637707/637707]
salva#leon:/tmp/salva$ tar xzf libssh2-1.2.8.tar.gz
salva#leon:/tmp/salva$ cd libssh2-1.2.8
salva#leon:/tmp/salva/libssh2-1.2.8$ ./configure --prefix=/usr/local/libssh2
checking whether to enable maintainer-specific portions of Makefiles... no
checking for sed... /bin/sed
checking for a BSD-compatible install... /usr/bin/install -c
...
salva#leon:/tmp/salva/libssh2-1.2.8$ make
Making all in src
make[1]: Entering directory `/tmp/salva/libssh2-1.2.8/src'
make all-am
make[2]: Entering directory `/tmp/salva/libssh2-1.2.8/src'
if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I../include -I../src -g -O2 -MT channel.lo -MD -MP -MF ".deps/channel.Tpo" -c -o channel.lo channel.c; \
then mv -f ".deps/channel.Tpo" ".deps/channel.Plo"; else rm -f ".deps/channel.Tpo"; exit 1; fi
libtool: compile: gcc -DHAVE_CONFIG_H -I../include -I../src -g -O2 -MT channel.lo -MD -MP -MF .deps/channel.Tpo -c channel.c -fPIC -DPIC -o .libs/channel.o
...
salva#leon:/tmp/salva/libssh2-1.2.8$ sudo make install
Making install in src
make[1]: Entering directory `/tmp/salva/libssh2-1.2.8/src'
make[2]: Entering directory `/tmp/salva/libssh2-1.2.8/src'
test -z "/usr/local/libssh2/lib" || mkdir -p -- "/usr/local/libssh2/lib"
/bin/bash ../libtool --mode=install /usr/bin/install -c 'libssh2.la' '/usr/local/libssh2/lib/libssh2.la'
libtool: install: /usr/bin/install -c .libs/libssh2.so.1.0.1 /usr/local/libssh2/lib/libssh2.so.1.0.1
...
salva#leon:/tmp/salva/libssh2-1.2.8$ cd ..
salva#leon:/tmp/salva$ wget http://search.cpan.org/CPAN/authors/id/R/RK/RKITOVER/Net-SSH2-0.35.tar.gz
--2011-05-27 11:22:56-- http://search.cpan.org/CPAN/authors/id/R/RK/RKITOVER/Net-SSH2-0.35.tar.gz
Resolving search.cpan.org... 207.115.101.144
Connecting to search.cpan.org|207.115.101.144|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://osl.ugr.es/CPAN/authors/id/R/RK/RKITOVER/Net-SSH2-0.35.tar.gz [following]
--2011-05-27 11:22:59-- http://osl.ugr.es/CPAN/authors/id/R/RK/RKITOVER/Net-SSH2-0.35.tar.gz
Resolving osl.ugr.es... 150.214.21.7
Connecting to osl.ugr.es|150.214.21.7|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 92434 (90K) [application/x-gzip]
Saving to: `Net-SSH2-0.35.tar.gz'
100%[================================================================================================================================================================================================>] 92,434 328K/s in 0.3s
2011-05-27 11:22:59 (328 KB/s) - `Net-SSH2-0.35.tar.gz' saved [92434/92434]
salva#leon:/tmp/salva$ tar xzf Net-SSH2-0.35.tar.gz
salva#leon:/tmp/salva$ cd Net-SSH2-0.35
salva#leon:/tmp/salva/Net-SSH2-0.35$ wget -q --no-check-certificate -O - https://github.com/salva/net-ssh2/commit/3c7261f4584137f4240d204731e20f709f1addb1.patch|patch -p1
patching file Makefile.PL
salva#leon:/tmp/salva/Net-SSH2-0.35$ perl Makefile.PL lib=/usr/local/libssh2/lib/ inc=/usr/local/libssh2/include/
The libssh2 library is required by this module. If you don't have it, you can
download it from http://www.libssh2.org; you may also need OpenSSL, which can be
obtained from http://www.openssl.org.
Debian: sudo aptitude install libssh2-1-dev
OpenSUSE: sudo zypper in libssh2-1 libssh2-devel
Checking if your kit is complete...
Looks good
Writing Makefile for Net::SSH2
salva#leon:/tmp/salva/Net-SSH2-0.35$ make
cp lib/Net/SSH2/File.pm blib/lib/Net/SSH2/File.pm
cp lib/Net/SSH2/PublicKey.pm blib/lib/Net/SSH2/PublicKey.pm
cp lib/Net/SSH2/Dir.pm blib/lib/Net/SSH2/Dir.pm
cp lib/Net/SSH2/SFTP.pm blib/lib/Net/SSH2/SFTP.pm
cp lib/Net/SSH2/Listener.pm blib/lib/Net/SSH2/Listener.pm
cp lib/Net/SSH2/Channel.pm blib/lib/Net/SSH2/Channel.pm
cp lib/Net/SSH2.pm blib/lib/Net/SSH2.pm
AutoSplitting blib/lib/Net/SSH2.pm (blib/lib/auto/Net/SSH2)
/usr/bin/perl "-Iinc" /usr/local/share/perl/5.10.1/ExtUtils/xsubpp -typemap /usr/share/perl/5.10/ExtUtils/typemap -typemap typemap SSH2.xs > SSH2.xsc && mv SSH2.xsc SSH2.c
cc -c /usr/local/libssh2/include/ -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g -DVERSION=\"0.35\" -DXS_VERSION=\"0.35\" -fPIC "-I/usr/lib/perl/5.10/CORE" SSH2.c
In file included from SSH2.xs:11:0:
ppport.h:3042:0: warning: "PERL_UNUSED_DECL" redefined
/usr/lib/perl/5.10/CORE/perl.h:330:0: note: this is the location of the previous definition
cc: /usr/local/libssh2/include/: linker input file unused because linking not done
Running Mkbootstrap for Net::SSH2 ()
chmod 644 SSH2.bs
rm -f blib/arch/auto/Net/SSH2/SSH2.so
LD_RUN_PATH="/usr/local/libssh2/lib:/lib/x86_64-linux-gnu" cc -shared -O2 -g -L/usr/local/lib -fstack-protector SSH2.o -o blib/arch/auto/Net/SSH2/SSH2.so \
-L/usr/local/libssh2/lib/ -lssh2 -lz -lssl -lcrypto \
chmod 755 blib/arch/auto/Net/SSH2/SSH2.so
cp SSH2.bs blib/arch/auto/Net/SSH2/SSH2.bs
chmod 644 blib/arch/auto/Net/SSH2/SSH2.bs
Manifying blib/man3/Net::SSH2::File.3pm
Manifying blib/man3/Net::SSH2::Dir.3pm
Manifying blib/man3/Net::SSH2::PublicKey.3pm
Manifying blib/man3/Net::SSH2::SFTP.3pm
Manifying blib/man3/Net::SSH2::Listener.3pm
Manifying blib/man3/Net::SSH2::Channel.3pm
Manifying blib/man3/Net::SSH2.3pm
salva#leon:/tmp/salva/Net-SSH2-0.35$ ldd ./blib/arch/auto/Net/SSH2/SSH2.so
linux-vdso.so.1 => (0x00007fff20abc000)
libssh2.so.1 => /usr/local/libssh2/lib/libssh2.so.1 (0x00007f464d52f000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f464d317000)
libssl.so.0.9.8 => /lib/libssl.so.0.9.8 (0x00007f464d09a000)
libcrypto.so.0.9.8 => /lib/libcrypto.so.0.9.8 (0x00007f464cd0b000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f464c977000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f464c772000)
/lib64/ld-linux-x86-64.so.2 (0x00007f464d97e000)
salva#leon:/tmp/salva/Net-SSH2-0.35$ sudo make install
...