Cross-post from Perl Monks: http://www.perlmonks.org/?node_id=1115125
My department needs to compile its Perl modules manually, which it then uploads to a network shared file system for the developers to share and use. Our current set of modules were built using my system Perl, which /usr/bin/perl -V
lists as revision 5 version 10 subversion 1
.
However, we're interested in building a separate copy of Perl that we can also upload to the networked file system. This way we are not tied to using each of our machines' system Perl, which can change from machine to machine. A sort of "central" Perl that can be standard across each machine.
Therefore, I needed to build a local copy of Perl in my home directory. I made sure to install the same version as my system Perl, perl-5.10.1
. I did this using the following Configure
followed by a simple make
,make test
, make install
:
./Configure -des -Dprefix=/home/myuser/localperl -Duserelocatableinc
-Dprefix
installed it to the folder localperl
in my home directory, while the -Duserelocatableinc
flag made it so the @INC would change if the folder was moved (ie., uploaded to the networked file system).
The issue comes when I try to test it out with one of my scripts that requires a module from our library of manually built Perl modules. I keep getting the following error:
/home/myuser/localperl/bin/perl: symbol lookup error: .../auto/DBI/DBI.so: undefined symbol: Perl_Istack_sp_ptr
Obviously my script uses the shared DBI module but is running into errors. From doing research on the Internet, people have said that I would need to recompile the modules using the new build of Perl.
However, the two Perls are the same version and were built on the same machine. Can someone help me get a better understanding of what is preventing these modules from working with my locally built Perl? I have tried to rebuild the local Perl using Configure
settings as close to the machine Perl as possible to try to see if that would work:
-Dversion=5.10.1
-Dmyhostname=localhost
-Dcc=gcc
-Dinc_version_list=5.10.0
-Darchname=x86_64-linux-thread-multi
-Dusethreads
-Duseithreads
-Duselargefiles
So far this has not stopped the error. Is there a way to get my locally built Perl to work with the modules compiled with the machine Perl, or will I have to recompile them all and redistribute a fresh set of modules?
perlbrew
andcpanm
they're the usual solution for your kind of setup and normally prevent those problems. – Patrick J. S.perlbrew
is used for managing different Perl builds on the same machine. Does it somehow make Perl modules compatible across different builds? Also,cpanm
is not much use to us. We have no access to the Internet or any CPAN repository from our machines (hence why we manually compile our modules). So recompiling modules for each new Perl build would require building everything from scratch. – YonkeyDonk64perlbrew
is the usual way to use custom perl builds in the homedir. And it sets upcpanm
to install the modules for each perl version. As you're not allowed to install from the internet: You can set up your own local cpan mirror withpinto
,darkpan
orOrePan
and use that as the only the-M
option. The use it would provide is that you'll only have to type one command (cpanm --installdeps
with the appropriateMETA
file) and you'll have all the modules set up in the right place of your@INC
. – Patrick J. S.