Compile in 32 bits mode in x86_64 architecture - perl

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!

Related

Not able to install GD module in Perl

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

Problem installing Tk module perl in MacOS catalina

I got the following errors while installind Tk module from perl in MacOS catalina 10.15.6
cpan install Tk
And the error I get
Cannot find '/System/Library/Perl/5.18/darwin-thread-multi-2level/CORE/perl.h' have you installed /usr/bin/perl?
Compilation failed in require at Makefile.PL line 37.
BEGIN failed--compilation aborted at Makefile.PL line 39.
Warning: No success on command[/usr/bin/perl Makefile.PL]
SREZIC/Tk-804.035.tar.gz
/usr/bin/perl 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
Could you please help me know what's happening here?

NET::SSH::Expect configurations to work over windows

Machine details : Windows7 , 64-bits.
I integrated perl in eclipse and used Net::SSH::Except module for scripting, but am getting an error as Can't locate Net/SSH/Expect.pm in #INC (you may need to install the Net::SSH::Expect
module) (#INC contains: C:/Perl64/site/lib/MSWin32-x64-multi-thread C:/Perl64/site/lib
C:/Perl64/lib .)
Therefore, Am trying to install IO::Tty for Expect dependency, using command cpan>notest install IO::Tty.
i am getting the following error message :
and the module is not being installed, even the NET::SSH::Expect not getting installed.
cpan> notest install IO::Tty
Reading 'C:\Perl64\cpan\Metadata'
Database was generated on Mon, 11 Dec 2017 04:41:02 GMT
Fetching with LWP:
http://ppm.activestate.com/CPAN/authors/01mailrc.txt.gz
Reading 'C:\Perl64\cpan\sources\authors\01mailrc.txt.gz'
.............................................................DONE
Fetching with LWP:
http://ppm.activestate.com/CPAN/modules/02packages.details.txt.gz
Reading 'C:\Perl64\cpan\sources\modules\02packages.details.txt.gz'
Database was generated on Tue, 12 Dec 2017 04:29:02 GMT
.............
**New CPAN.pm version (v2.16) available.
[Currently running version is v2.1101]
You might want to try
install CPAN
reload cpan
to both upgrade CPAN.pm and run the new version without leaving
the current session.**
..............................................................DONE
Fetching with LWP:
http://ppm.activestate.com/CPAN/modules/03modlist.data.gz
Reading 'C:\Perl64\cpan\sources\modules\03modlist.data.gz'
DONE
Writing C:\Perl64\cpan\Metadata
Running install for module 'IO::Tty'
Checksum for C:\Perl64\cpan\sources\authors\id\T\TO\TODDR\IO-Tty-1.12.tar.gz
ok
Scanning cache C:\Perl64/cpan/build for sizes
...............................................................DONE
IO-Tty-1.12/
IO-Tty-1.12/ChangeLog
IO-Tty-1.12/Makefile.PL
IO-Tty-1.12/MANIFEST
IO-Tty-1.12/META.json
IO-Tty-1.12/META.yml
IO-Tty-1.12/Pty.pm
IO-Tty-1.12/README
IO-Tty-1.12/t/
IO-Tty-1.12/try
IO-Tty-1.12/Tty.pm
IO-Tty-1.12/Tty.xs
IO-Tty-1.12/t/test.t
Configuring T/TO/TODDR/IO-Tty-1.12.tar.gz with Makefile.PL
This module requires a POSIX compliant system to work. Try cygwin if you
need this module on windows OS unsupported at Makefile.PL line 6.
Warning: No success on command[C:\Perl64\bin\perl.exe Makefile.PL
INSTALLDIRS=site]
TODDR/IO-Tty-1.12.tar.gz
C:\Perl64\bin\perl.exe Makefile.PL INSTALLDIRS=site -- NOT OK
Failed during this command:
TODDR/IO-Tty-1.12.tar.gz : writemakefile NO
'C:\Perl64\bin\
perl.exe Makefile.PL INSTALLDIRS=site' returned status 65280
i have tried installed IO::Tty with following command
cpanm --install IO::Tty
cpanm --verbose IO::Tty
cpanm --force IO::Tty
all failing , this may be due to the lower version of the perl.
what is the command to upgrade cpan from cmd and also perl through cmd?
Sadly the Perl Expect module requires a UNIX based OS to function. I have implemented this a few times on a windows platform and basically you need to install an older ActiveState distribution of TCL, then you can have the Perl script call an external EXPECT script, like this:
$expectOutput = `[path_to_expect_script.expect]`;
Your variable will then contain the output of the Expect script.
Hope this helps!
Edit: You may like to reword your title to attract more answers relating to using expect on windows.
Solved!
the new version of Expect is made compatible with the windows, but it need to be installed with cygwin ..
In eclipse , make interpreter as cygwin (windows -> preference -> EPIC Perl -> interpreter).
and execute the script:)

OS X CPAN Perl module installation issue

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

Can not install Apache2::Const module

I have installed Apache 2.2.25 with mod_perl 2.0.7 running on Debian 7.1.0. During its installation mod_perl had to install module named Apache2::Const, but it didn't. mod_perl have installed modules from the same group, e.g. Apache2::Access, Apache2::Connection, Apache2::RequestUtil.
So when I use this command (i /Apache2::Const/) in cpan shell it outputs following:
cpan[3]> i /Apache2::Const/
Module id = Apache2::ConstantsTable
CPAN_USERID PHRED (Fred Moyer <fred#redhotpenguin.com>)
CPAN_VERSION undef
CPAN_FILE P/PH/PHRED/mod_perl-2.0.8.tar.gz
UPLOAD_DATE 2013-04-18
INST_FILE (not installed)
And when I use this command (install Apache2::Const):
cpan[4]> install Apache2::Const
Warning: Cannot install Apache2::Const, don't know what it is.
Try the command
i /Apache2::Const/
to find objects with matching identifiers.
I've tried to run:
install Apache2::ConstantsTable
But it didn't help.
Also, when I run following script:
perl -e "use v5.14.2; use Apache2::Const"
it outputs:
Not a CODE reference at /usr/lib/perl/5.14/DynaLoader.pm line 207.
END failed--call queue aborted at /usr/local/lib/perl/5.14.2/ModPerl/Const.pm line 207.
Compilation failed in require at /usr/local/lib/perl/5.14.2/Apache2/Const.pm line 18.
BEGIN failed--compilation aborted at /usr/local/lib/perl/5.14.2/Apache2/Const.pm line 18.
Compilation failed in require at -e line 1.
BEGIN failed--compilation aborted at -e line 1.
I tried to install this module manually (via Makefile.PL) from mod_perl package. I also tried to reinstall mod_perl. Nothing helped.
All the other Apache2::* modules works correctly.
I really need to install Apache2::Const module. Thanks for your replies.
Solved long time ago by installing all this stuff from debian package. I was hard noob in linux when I posted the question.