How do I fix "as_number is not a Pari function name" when using Perl Net::SSH::Perl module - perl

I ran into this problem when trying to run a command via Net::SSH:Perl on another Linux host. Here is the exact error:
`as_number' is not a Pari function name Line 1148.
5.8.8/x86_64-linux-thread-multi/Math/Pari.pm
I found only one relevant posting and it indicates that it could be some sort of version mismatch between some of the Perl libraries?

See this question: How do I fix “`as_number’ is not a Pari function name” in Math::Pari called by Math::BigInt?.

Related

Perl undefined yp_get_default_domain detected by DynaLoader.pm when using ARSperl, yet library exists

I have a Ubuntu server that recently pushed a Perl update to 5.14.2 when I installed cpanminus. This broke compatibility with the BMC Remedy API module. It looks like I can't roll back to the old version of Perl, so I've tried recompiling ARSperl for Perl 5.14.2.
The problem is, when I run an old Perl script that used the old module, I get the following:
Can't load '/usr/local/lib/perl5/5.14.2/auto/ARS/ARS.so' for module ARS:
/usr/local/lib/perl5/5.14.2/auto/ARS/ARS.so: undefined symbol:
yp_get_default_domain at /usr/local/lib/perl5/5.14.2/i686-linux/DynaLoader.pm line 190.
So, a bit of Googling tells me that yp_get_default_domain lives in libnsl. I've gone so far as to try recompiling both the ARSperl module and Perl itself with "-lnsl" explicitly called out in the Makefile. Unfortunately, this has gotten me nowhere. The library is indeed installed on the system under /usr/lib/i386-linux-gnu/.
In ARSperl Makefile:
LDFLAGS = -fstack-protector -L/usr/local/lib -L/usr/lib -L/usr/lib/i386-linux-gnu -lnsl
My question is therefore two-fold for the Perl gurus out there.
-How can I determine which of Perl, DynaLoader, or the ARS.so itself can't find "yp_get_default_domain"?
-What is the best next step to troubleshoot the above DynaLoader message for a missing library that is actually present on the system and linked in the module?
Thank you in advance for sharing your knowledge and advice.
Add the directory where library is installed to the $ARS_LDPATH in Makefile.PL
Something like
$ARSAPI = "C:\\ARS_Library\\api764win";
if( $WINDOWS ){
$ARS_LDPATH = qq{-L"$ARSAPI/lib"};
$INCLUDES = qq{-I"$ARSAPI/include"};
}else{
$ARS_LDPATH = "-L$ARSAPI/lib";
$INCLUDES = "-I$ARSAPI/include";
}
We updated to ARSperl 1.93, started using AR API version 6.3 rather than 5.1.2 and added "-lsnl" to the ARSperl Makefile.PL $ARS_LIBS in the section for 6.3.
That resulted in Perl segfaulting every time the ARS.so module was run. After lots of testing and trying to diagnose why segfaults were occurring, we recompiled a separate instance of Perl-5.14.2 from source under /opt/ and removed the 64int option. Updating the shebang lines on all our Perl scripts that need the ARS module to redirect to the Perl version under /opt seems to have gotten things working again.
Thank you Chankey Pathak for pointing me toward the Makefile.PL, I wouldn't have immediately started looking at changing things there without this advice.

What can’t perl locate an object method via an installed module?

I am running a Perl program that uses Math::Vector,
but I am getting the following error.
Can't locate object method "UnitVecPoints" via package "Math::Vector"
at /usr/local/share/perl5/Math/Vector.pm line 135.
How do I proceed? The module is correctly installed.
The module is no longer on CPAN. I found it on backpan, though: http://backpan.perl.org/authors/id/W/WS/WSYVINSKI/Vector.pm
It seems to call UnitVecPoints, but it only defines UnitVectorPoints. Try to edit the file /usr/local/share/perl5/Math/Vector.pm, providing the correct subroutine name.

Cant Locate Image/Info.pm Module Error

I'm trying to get the resolution,width,height of the images in the specific file.
I have the following code.
#use strict;
use Image::Info qw(image_info dim);
use File::List;
#perl2exe_include Image::Info::JPEG;
#perl2exe_include PerlIO;
my $file = <ImageFilePath>;
my $info = image_info($file);
my $res = $info->{resolution};
print "$$res[0]\n";
I have the Perl Version 5.16.3
I get the following error:
Can't locate Image/Info.pm in #INC (#INC contains: c:\program files\Perl\lib c:/program files/Perl/site/lib c:/program files/Perl/lib .) at Img_Res.pl line 3.
BEGIN failed--compilation aborted at Img_Res.pl line 3.
Can anyone give me the solution to this?
From the code part of question I am concluding that you are trying to create an executable using Perl2EXE, because you are using the line
#perl2exe_include Image::Info::JPEG;
and also assuming that you are running command
perl2exe c:\somepath\somescript.pl -o somescript.exe
The answer from #James Green is correct to an extent, however its incomplete (as in fails to explain his second bullet point).
You need to install "Image::Info" and any other modules that you are using (Use the answer from #James Green).
After installation, Open to windows explorer and locate the module that you just installed,
It will normally be in the following folders
"PERL_PATH\perl\lib"
"PERL_PATH\perl\site\lib"
"PERL_PATH\perl\vendor\lib"
Once you locate the module is installed in the one of the 3 locations above. Navigate to the location where Perl2EXE is installed.
PERL2EXE_PATH\perl2exe-XX.xx-Win\
Locate the folder with the current version of perl you are using. In your case the folder name should be
Win32-5.16.3 or Win64-5.16.3
Open the folder and locate the .conf file.
Edit the line with header libdir.
libdir=perl-Win32/site/lib;perl-Win32/lib;perl-Win32/vendor/lib;.
Ensure all the perl/lib directories are included in the search path.
Save it and rerun your command. This should work.
Sometimes even after all this the perl2exe command fails, this is due to the limitation of the program being able to decipher the qw command.
So to avoid this directly call the module (ex: use Module::Name;) in your code instead of using the qw.
You need to ensure you've done two things:
install the Image::Info module
make sure #INC includes the path to wherever you installed the module
I see you're on Windows, which means you're likely using either Strawberry Perl, or ActiveState's Perl. If you're using Strawberry Perl you should have some success following the directions on http://www.cpan.org/modules/INSTALL.html -- I believe ActiveState has its own built-in package manager, ppm, and to get started with that you'll want to look here: http://www.activestate.com/activeperl/ppm-perl-modules

Error installing Perl Module. Error code 129

Thank you for taking the time reading this and hopefully help me come out with a successful solution to my problem.
I deleted this previous post as it went dead(hours without an answer), so Im hoping to revive it.
I was trying to install a perl module named Rose::DB, and after multiple approaches I finally installed it, but whenever I run my code it tells me it can't find a module named Bit::Vector, so I tried to install it.
I first did the Makefile.PL without errors.
Then, I tried doing the dmake... and It gave me A LOT of lines, most of them warnings like this:
Vector.o:Vector.c:(.text+0x11591): undefined reference to `_imp__Perl_newXS'
Vector.o:Vector.c:(.text+0x115a0): undefined reference to `_imp__Perl_get_context'
After that the last couple of lines showed this:
collect2: ld returned 1 exit status
dmake.exe: Error code 129, while making 'blib\arch\auto\Bit\Vector\Vector.dll'
Can anybody help me install the module correctly? I would really appreciate it.
PS: Here's the link to see all the lines:
http://www.sendspace.com/file/97pk32
PS: I'm using Strawberry, was using ActivePerl but gave me errors and was recommended to use Strawberry.
I had the same issue on Windows with the module Win32::UTCFileTime.
It can be due to the fact that you have both Strawberry and ActivePerl installed. And so, your perl configuration may be wrong.
If you have something like :
$ perl -V
...
cc='C:\STRAWB~1\c\bin\gcc.exe',...
...
ld='C:\STRAWB~1\c\bin\g++.exe', ldflags='... -L"C:\Perl\lib\CORE"...'
...
It means that you are trying to build perl modules with Strawberry's compiler/linker and with ActivePerl libs. It could be the reason why.
Also, an easy "hack" is to rename C:\Perl to C:\whatever temporarily.
Then, you should have :
$ perl -V
...
cc='gcc',...
...
ld='g++', ldflags='... -L"C:\strawberry\lib\CORE"...'
...
Thus, your linker will be able to find Strawberry perl CORE API functions ( _imp__Perl_*, perlguts ). It worked for me.
If there are two perl installation like Strawbery and other like Dwimperl or activeperl, renaming one which is not used, solved my problem of dmake.exe: Error code 129

How to build levmar using MATLAB?

I am using Windows XP and matlab version is 7.10.0.
I have the levmar(Levenberg Marquardt) package from http://www.ics.forth.gr/~lourakis/levmar/levmar-2.5.tgz
In the README file, we are told to compile in matlab using mex using the following command:
mex -DHAVE_LAPACK -I.. -O -L -L levmar.c -llevmar -lclapack -lblas -lf2c.
I downloaded lapack.lib , blas.lib and f2c.lib for windows
UPDATE:
The original error got resolved after I built a vc project file given in the package.
But now there are some error messages like :
levmar.lib(misc.obj) : error LNK2019: unresolved external symbol _dgemm_ referenced in function _dlevmar_trans_mat_mat_mult
Did you create a file with a mex-function gateway? You can't just compile a c-function for Matlab; you need to do a little bit of work to take care of the I/O between Matlab and the c-code.
If you follow the steps outlined in this document, you should do fine.
You may have a look at immoptibox, which comprises Levenberg-Marquardt algorithm as well.
I just figured it out after searching a while and noticed that the levmar package included a vc project file which i needed to build and it created a file called levmar.lib .
But now I am getting some errors which involves messages like 'unable to resolve external symbols'