Home > database >  perl DBI module installation erroring out
perl DBI module installation erroring out

Time:03-03

perl DBI module installation is erroring out.

Installed perl 5.32.1 in non standard location, using -Dinstallprefix option

./Configure -Dinstallprefix=/test/user/home/perl -des
make
make test
make install

/test/user/home/perl/bin/perl -version
This is perl 5, version 32, subversion 1 (v5.32.1) built for x86_64-linux

Set PERL5LIB env variable

export PERL5LIB="/test/user/home/perl/lib/5.32.1:/test/user/home/perl/lib/site_perl/5.32.1:/test/user/home/perl/lib/5.32.1/x86_64-linux"

which perl
/test/user/home/perl/bin/perl

Downloaded DBI-1.643 archive, after extraction execution of Makefile.PL is failing

perl Makefile.PL

Warning: PERL_LIB (/perl/lib/5.32.1) seems not to be a perl library directory
        (strict.pm not found) at /test/user/home/perl/lib/5.32.1/ExtUtils/MM_Unix.pm line 1934.
Have /test/user/home/perl/lib/5.32.1/x86_64-linux
Want /perl/lib/5.32.1/x86_64-linux
Your perl and your Config.pm seem to have different ideas about the
architecture they are running on.
Perl thinks: [x86_64-linux]
Config says: [x86_64-linux]
This may or may not cause problems. Please check your installation of perl
if you have problems building this extension.
Can't stat /perl/lib/5.32.1: No such file or directory
 at Makefile.PL line 280.
Can't stat /perl/lib/5.32.1/x86_64-linux: No such file or directory
 at Makefile.PL line 280.
Failed to opendir '/perl/lib/5.32.1/x86_64-linux/CORE' to find header files: No such file or directory at /test/user/home/perl/lib/5.32.1/ExtUtils/MM_Any.pm line 3048.

Found non existing paths are referred from @INC

perl -e "print \"@INC\""

/test/user/home/perl/lib/5.32.1 /test/user/home/perl/lib/site_perl/5.32.1 /test/user/home/perl/lib/5.32.1/x86_64-linux
/perl/lib/site_perl/5.32.1/x86_64-linux /perl/lib/site_perl/5.32.1 /perl/lib/5.32.1/x86_64-linux /perl/lib/5.32.1

Can someone guide me where from @INC getting these non existing paths

/perl/lib/site_perl/5.32.1/x86_64-linux /perl/lib/site_perl/5.32.1 /perl/lib/5.32.1/x86_64-linux /perl/lib/5.32.1

are there any way to restrict @INC to append non existing paths?

CodePudding user response:

I think you want just -Dprefix=/.... There are other things that need to end up in the right place too. You shouldn't need to set PERL5LIB though because perl should be using your prefix as its default @INC. What does your perl -V show?

There is an installprefix, but it's aimed at compiling on one machine and installing on another. However, the INSTALL docs also recommend against using that. Is that what you are trying to do?

As for the other directories, the INSTALL docs describe the various directories that show up in @INC.

CodePudding user response:

Thank you @brian for pointing me in right direction.

Following was the root cause behind @INC contains non existing directories.

Last time during perl installation at least one time I ran following command

./Configure -des -Dprefix=/perl

Use relocatable @INC? [n]
Pathname where the private library files will reside? (~name ok)
[/perl/lib/5.32.1]
Where do you want to put the public architecture-dependent libraries? (~name ok)
[/perl/lib/5.32.1/x86_64-linux]
Pathname for the site-specific library files? (~name ok)
[/perl/lib/site_perl/5.32.1]
Pathname for the site-specific architecture-dependent library files? (~name ok)
[/perl/lib/site_perl/5.32.1/x86_64-linux]

then executed make command. Later on make test failed for other error.

Then without running make distclean command, I re ran Configure with
-Dinstallprefix option

./Configure -Dinstallprefix=/test/user/home/perl -des

This populate @INC as follows

/test/user/home/perl/lib/5.32.1 /test/user/home/perl/lib/site_perl/5.32.1 /test/user/home/perl/lib/5.32.1/x86_64-linux
/perl/lib/site_perl/5.32.1/x86_64-linux /perl/lib/site_perl/5.32.1 /perl/lib/5.32.1/x86_64-linux /perl/lib/5.32.1

To fix this issue executed following steps,

make distclean  

./Configure -des -Dprefix=/test/user/home/perl -Dusethreads

now @INC is populated correct

@INC:
    /test/user/home/perl/lib/site_perl/5.32.1/x86_64-linux-thread-multi
    /test/user/home/perl/lib/site_perl/5.32.1
    /test/user/home/perl/lib/5.32.1/x86_64-linux-thread-multi
    /test/user/home/perl/lib/5.32.1

Now DBI installation ran successfully.

  • Related