Issue while installing DBI Perl module in Solaris 11 - perl

I am trying to install Perl DBI module on Solaris 11 manually using Make install:
You can verify the steps mentioned below.
/usr/perl5/5.12/ModulesTars/DBI-1.643# make test
"/usr/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty'
-- DBI.bs blib/arch/auto/DBI/DBI.bs 644
PERL_DL_NONLAZY=1 "/usr/bin/perl" "-Iblib/lib" "-Iblib/arch" test.pl
test.pl
DBI test application $Revision$
Can't load '/usr/perl5/5.12/ModulesTars/DBI-1.643/blib/arch/auto/DBI/DBI.so'
for module DBI: ld.so.1: perl:
fatal: /usr/perl5/5.12/ModulesTars/DBI-1.643/blib/arch/auto/DBI/DBI.so:
wrong ELF class: ELFCLASS64 at
/usr/perl5/5.12/lib/sun4-solaris-64int/DynaLoader.pm line 200.
at /usr/perl5/5.12/ModulesTars/DBI-1.643/blib/lib/DBI.pm line 284
BEGIN failed--compilation aborted at
/usr/perl5/5.12/ModulesTars/DBI-1.643/blib/lib/DBI.pm line 284.
Compilation failed in require at test.pl line 23.
BEGIN failed--compilation aborted at test.pl line 23.
*** Error code 2
make: Fatal error: Command failed for target `test_dynamic'
/usr/perl5/5.12/ModulesTars/DBI-1.643#
Getting above error while running make test command. Please help to find the resolution.

Per Oracle's Solaris 11 Perl 5 documentation:
Perl 5 includes a dynamically loadable module framework, which allows the addition of new capabilities for specific tasks. Many modules are freely available from the Comprehensive Perl Archive Network (CPAN) at http://www.cpan.org. If you wish to build and install add-on modules from CPAN using gcc, you can do so using the /usr/perl5/5.8.4/bin/perlgcc or the /usr/perl5/5.12/bin/perlgcc script. See the perlgcc(1) man page with the 5.8.4 distribution for details.
Offtopic:
Given your comment
This is perl 5, version 12, subversion 5 (v5.12.5) built for sun4-solaris-64int (with 7 registered patches, see perl -V for more detail)
Are you really installing user-compiled modules as root into the system's Perl installation? Since you have "7 registered patches", it seems that this is a system under an Oracle support contract. Installing user-compiled modules as root into the system Perl installation risks your system's stability and likely violates your support contract.

Related

Can't locate Text/Soundex.pm in #INC

I was installing repeatsmasker and it apparently seems to work because it shows "Congratulations! RepeatMasker is now ready to use."
But when I run it it reports "Can't locate Text/Soundex.pm...". so I installed the module by "sudo cpan Text::Soundex", and by the end it tells me "Text::Soundex is up to date (3.05)." It seems the module is already installed, but RepeatMasker still has the same problem, as I'll show you in this code:
fragua#picci:~/RM/RepeatMasker$ sudo cpan Text::Soundex
Loading internal null logger. Install Log::Log4perl for logging messages
Reading '/home/fragua/.cpan/Metadata'
Database was generated on Fri, 19 Apr 2019 22:17:03 GMT
Text::Soundex is up to date (3.05).
fragua#picci:~/RM/RepeatMasker$ ./RepeatMasker -s -lib /home/fragua/RepeatScout-1.0.5/ObiINK5k_repeats_filtered1.fasta /home/fragua/Documenti/Workdirectory/ObiINC5k.fa
Can't locate Text/Soundex.pm in #INC (you may need to install the Text::Soundex module) (#INC contains: /home/fragua/RM/RepeatMasker /home/fragua/perl5/lib/perl5 /home/fragua/anaconda/lib/site_perl/5.26.2/x86_64-linux-thread-multi /home/fragua/anaconda/lib/site_perl/5.26.2 /home/fragua/anaconda/lib/5.26.2/x86_64-linux-thread-multi /home/fragua/anaconda/lib/5.26.2 .) at /home/fragua/RM/RepeatMasker/Taxonomy.pm line 80.
BEGIN failed--compilation aborted at /home/fragua/RM/RepeatMasker/Taxonomy.pm line 80.
Compilation failed in require at ./RepeatMasker line 310.
BEGIN failed--compilation aborted at ./RepeatMasker line 310.
I installed RepeatMasker in another computer without problems, but I don't know why now I encontered this problem
You have two builds of Perl installed:
/usr/bin/perl
/home/fragua/anaconda/bin/perl.
/home/fragua/anaconda/bin/perl is first in your PATH. This means that programs with the following shebang (#!) line will use /home/fragua/anaconda/bin/perl:
#!/usr/bin/env perl
RepeatMasker appears to be such a program.
All of this is fine.
The Problem
/home/fragua/anaconda/bin contains the scripts installed by /home/fragua/anaconda/bin/perl. As part of the installation process of these scripts, the shebang line of these scripts should have been rewritten to specify /home/fragua/anaconda/bin/perl.
However, the shebang line of /home/fragua/anaconda/bin/cpan references /usr/bin/perl. This means that using /home/fragua/anaconda/bin/cpan would install modules for /usr/bin/perl, not /home/fragua/anaconda/bin/perl.
The Workaround
You could avoid relying on the shebang line and explicitly specify the correct perl.
/home/fragua/anaconda/bin/perl /home/fragua/anaconda/bin/cpan Text::Soundex
Or, given your $PATH,
perl /home/fragua/anaconda/bin/cpan Text::Soundex
The Fix
To fix this problem in an ongoing manner requires changing the shebang lines of the scripts to be what they should be. In every file in /home/fragua/anaconda/bin (and in particular for cpan), replace
#!/usr/bin/perl
with
#!/home/fragua/anaconda/bin/perl
You could do this use the following (which does a backup of the files it changes):
perl -0777ne'print "$ARGV\n" if m{^#!\s*/usr/bin/perl\b}' /home/fragua/anaconda/bin/* \
| xargs perl -i~ -0777pe's{^#!\s*/usr/bin/perl\b}{#!/home/fragua/anaconda/bin/perl}'

Unable to load (and reinstall) Socket.pm after upgrade

I've just upgraded Slackware64 to 14.1 and I found Perl 5.18 in it. Socket.pm now complains that it was compiled for another Perl version, which was 5.16. Here is the error:
Perl API version v5.16.0 of Socket does not match v5.18.0 at /usr/share/perl5/XSLoader.pm line 92.
Unfortunately, I'm even unable to reinstall Socket.pm even with cpan.
$ cpan Socket
Reading '/home/francesco-salix/.cpan/Metadata'
Database was generated on Tue, 26 Nov 2013 09:08:12 GMT
Running install for module 'Socket'
Running make for P/PE/PEVANS/Socket-2.013.tar.gz
Checksum for /home/francesco-salix/.cpan/sources/authors/id/P/PE/PEVANS/Socket-2.013.tar.gz ok
CPAN.pm: Building P/PE/PEVANS/Socket-2.013.tar.gz
Attempt to reload Socket.pm aborted.
Compilation failed in require at /usr/share/perl5/IPC/Cmd.pm line 46.
BEGIN failed--compilation aborted at /usr/share/perl5/IPC/Cmd.pm line 46.
Compilation failed in require at /usr/share/perl5/ExtUtils/CBuilder/Base.pm line 11.
BEGIN failed--compilation aborted at /usr/share/perl5/ExtUtils/CBuilder/Base.pm line 11.
Compilation failed in require at /usr/share/perl5/ExtUtils/CBuilder/Platform/Unix.pm line 4.
BEGIN failed--compilation aborted at /usr/share/perl5/ExtUtils/CBuilder/Platform/Unix.pm line 4.
Compilation failed in require at (eval 6) line 2.
BEGIN failed--compilation aborted at (eval 6) line 2.
Compilation failed in require at Makefile.PL line 19.
Warning: No success on command[/usr/bin/perl5.18.1 Makefile.PL]
'YAML' not installed, will not store persistent state
PEVANS/Socket-2.013.tar.gz
/usr/bin/perl5.18.1 Makefile.PL -- NOT OK
Running make test
Make had some problems, won't test
Running make install
Make had some problems, won't install
Could not read metadata file. Falling back to other methods to determine prerequisites
As far as I've understood, Socket.pm is a Perl core module. So, I thought it would have been upgraded together with Perl.
Here are directories currently in #INC:
$ perl -E'say for #INC'
/home/francesco-salix/perl5/lib/perl5/x86_64-linux-thread-multi
/home/francesco-salix/perl5/lib/perl5
/usr/local/lib64/perl5
/usr/local/share/perl5
/usr/lib64/perl5/vendor_perl
/usr/share/perl5/vendor_perl
/usr/lib64/perl5
/usr/share/perl5
.
I see some folders seems duplicate, but I don't actually know if they are supposed to be like that. However, there's no Socket.pm in the first two path (which I assume where added by cpan while running under my user, while I've a Socket.pm file for both /usr/local/lib64/perl5/ and /usr/lib64/perl5.
Socket.pm is indeed a core module. And the CPAN.pm moduleExtUtils::MakeMaker uses it (via IPC::Cmd), so if Socket.pm is broken, CPAN.pmMakefile.PL will be broken too.
Given that it is a core module, and would have been installed with Perl, this suggests to me that Perl is trying to load Socket.pm from some other, older path. The following will tell you where Perl is trying to load modules from:
perl -E'say for #INC'
Is there anything suspicious in there. Any place it might find older modules compiled for Perl 5.16?
The solution is to clear the old modules, following 3rensho’s comment:
sudo rm -rf /usr/local/lib64/perl5/*
sudo rm -rf /usr/local/share/perl5/*
It works!

twiki "Failed to load the perl module FindBin."

I am trying to get TWIKI to work (virtual Server Hosteurope .. PLESK 11 CentOS 6).
When I run the configure script the following error appears:
[root#lvpsx.x.x.x bin]# ./configure
Failed to load the perl module FindBin. The module was found at /usr/share/perl5/FindBin.pm
Please ensure that:
1 FindBin is installed,
2 that the module is available on the #INC path,
3 that the webserver user (root) has permission to read the FindBin.pm file.
The detailed error seen was:
Subroutine export_fail redefined at /usr/share/perl5/Carp.pm line 25.
Compilation failed in require at /usr/share/perl5/FindBin.pm line 95.
BEGIN failed--compilation aborted at /usr/share/perl5/FindBin.pm line 95.
Compilation failed in require at (eval 3) line 2.
BEGIN failed--compilation aborted at (eval 3) line 2.
I have only marginal knowledge about the usage of shells and much less experience with Perl.
I run the configure script as root. As Far as I know Apache runs as root too(PLESK 11).
FindBin.pm is located in the named dir and I already tried to set it to 777.
Try installing VMS::Filespec, which seems to be the module FindBin is trying to require.
On the shell:
cpanm VMS::Filespec
If that doesn't work (the command fails), then try first:
cpan App::cpanminus
...and then try the first command again.
HTH
Francisco

Compiling perl source using pp

I have a perfectly functioning perl script (written in bash terminal on debian linux) that fails to execute (on either linux or windows) when compiled using pp. This may relate to unmet dependencies in the build, but I do believe the following command packages all dependencies into the executable:
pp -o out.exe in.pl
When I say it is perfectly functioning, I mean that the intended output is generated with no errors if I invoke ./in.pl from a bash terminal.
I would like to create an executable that will run on either linux or windows (if a separate file is required for each OS, so be it).
These are the packages that are included in the source:
use strict;
use warnings;
use charnames ":short";
binmode(STDOUT,":utf8");
use Term::ANSIColor;
use Number::Format;
use Finance::Quote;
use Finance::QuoteHist;
use Date::Manip; # this may be included by Finance::QuoteHist
If it helps, here is the error message I get (warning, it's long):
ERROR: [config_var] invalid zone in SetDate
ERROR: [config_var] invalid zone in SetDate
Could not load either Text::CSV_XS or Text::CSV_PP : Can't locate Text/CSV_PP.pm in #INC (#INC contains: CODE(0x1422320) /tmp/par-username/cache-addd1cc2ee9285c150584c1853c2b67c0c482e7e/inc/lib /tmp/par-username/cache-addd1cc2ee9285c150584c1853c2b67c0c482e7e/inc CODE(0x11675b0) CODE(0x116ebc8)) at (eval 30) line 2.
BEGIN failed--compilation aborted at (eval 30) line 2.
at Finance/QuoteHist.pm line 13
Compilation failed in require at Finance/QuoteHist.pm line 13.
BEGIN failed--compilation aborted at Finance/QuoteHist.pm line 13.
Compilation failed in require at script/in.pl line 10.
BEGIN failed--compilation aborted at script/in.pl line 10.
Judging from the run-time errors, the problem may relate to unmet recursive dependencies (for instance, dependencies within Finance::QuoteHist). Perhaps these recursive dependencies should be included explicitly? This is my first time attempting to compile perl into an executable, so thanks for any guidance you can provide.
You might try to use the -x flag to pp as seen in the docs. It runs the script and checks for dependencies as it goes, which is more accurate than simply scanning for dependencies. I have needed this when using Tk and it worked wonders.

Problem installing Perl's Crypt::SSLeay on Solaris 10

I'm trying to install the Crypt::SSLeay perl module and it keeps failing.
Perl is v5.8.8; Solaris is 5.10 and is on Intel hardware.
I'm using the CPAN module to attempt the install and the problems start when it gets to the 'make test' stage:
Running make test
PERL_DL_NONLAZY=1 /usr/local/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/00-basic......1/12
# Failed test 'use Crypt::SSLeay;'
# in t/00-basic.t at line 6.
# Tried to use 'Crypt::SSLeay'.
# Error: Can't load '/.cpan/build/Crypt-SSLeay-0.58-tvJe1E/blib/arch/auto/Crypt/SSLeay/SSLeay.so' for module Crypt::SSLeay: ld.so.1: perl: fatal: libssl.so.0.9.8: open failed: No such file or directory at /usr/local/lib/perl5/5.8.8/i86pc-solaris/DynaLoader.pm line 230.
# at (eval 3) line 2
# Compilation failed in require at (eval 3) line 2.
# BEGIN failed--compilation aborted at t/00-basic.t line 6.
I've verified that ld.so.1 and libssl.so.0.9.8 both exist and as far I can tell, OpenSSL is installed (pkginfo shows 'OpenSSL Libraries (Usr)').
Anyone have any thoughts on what the problem may be?
Dave
Elsewhere we figured out that the directory containing the SSL library files was not in LD_LIBRARY_PATH.
The solution was:
setenv LD_LIBRARY_PATH /usr/local/ssl/lib
which is the library location reported by Makefile.PL.
I will add a note to the documentation and Makefile.PL output.
Thank you for your report and providing detailed information that enabled me to finally figure out what was going on with those test failures as well.
Now, I need to figure out how to ensure that the test scripts run with the correct LD_LIBRARY_PATH.