Jason Forkey wrote:
Hi,
My build machine is a linux amd64 box. I would like to package a perl script
with par to run on a target machine that is running 32 bit linux. I'm not
trying to create a binary, just a perl script with the necessary CPAN modules
built into it. Both machines are running the same linux distribution (ubuntu
feisty), essentially the only difference is that my build machine is 64 bit and
has PAR installed and my target machine is 32 bit and does not. I haven't had
any success and while debugging the problem have found that even a one liner
perl script won't work. I execute the following on my build machine:
# uname -a
Linux build_host 2.6.20-9-generic #2 SMP Sun Feb 25 22:59:06 UTC 2007 x86_64
GNU/Linux
# pp -P -e 'print "hello\n"' -o hello.pl
Then copy the file hello.pl to my target machine and try to execute it:
# uname -a
Linux target_host 2.6.20-9-generic #2 SMP Mon Feb 26 03:01:44 UTC 2007 i686
GNU/Linux
# perl hello.pl
Can't load
'/tmp/par-jason/cache-95b09bf6309003e83dd9fe81b2a281b8af3a0115/3fa0c988.so' for
module IO:
/tmp/par-jason/cache-95b09bf6309003e83dd9fe81b2a281b8af3a0115/3fa0c988.so:
wrong ELF class: ELFCLASS64 at /usr/lib/perl/5.8/DynaLoader.pm line 225.
at /usr/share/perl5/PAR/Heavy.pm line 81
Compilation failed in require at /usr/lib/perl/5.8/IO/Handle.pm line 9.
BEGIN failed--compilation aborted at /usr/lib/perl/5.8/IO/Handle.pm line 9.
Compilation failed in require at /usr/lib/perl/5.8/IO/Seekable.pm line 9.
BEGIN failed--compilation aborted at /usr/lib/perl/5.8/IO/Seekable.pm line 9.
Compilation failed in require at /usr/lib/perl/5.8/IO/File.pm line 11.
BEGIN failed--compilation aborted at /usr/lib/perl/5.8/IO/File.pm line 11.
Compilation failed in require at /usr/bin/par.pl line 316.
Am I trying to do something that won't work? I would have expected to have a
problem if I tried to build an executable, but I would think that a standalone
perl script would work. Both machines are running perl 5.8.8 and the build
machine is using PAR version 0.952.
Thanks
This seems to beg the question: Would a perl module built on a 64 bit
machine run on a 32 bit machine, and vice-versa? I do not know, but
there is a hint from the Windows world.
ActiveState Perl has different versions for 32 versus 64 bit Linux
machines. I am going to guess that you cannot take Perl modules from a
64 bit machine expect it to run on the 32 bit machine, or vice versa.
The fact is, the par packer wraps up the perl modules of the build
machine for distribution on the target machine, placing them under the
.../cache-... directory on the target machine as you noted above, so you
are indeed trying to run modules from a 64 bit machine on a 32 bit machine.
I would contact ActiveState for a definitive answer.
Good luck.