tudobem has asked for the wisdom of the Perl Monks concerning the following question:

Hello,

I'm relatively new to Perl and PP but am hoping someone can point me in the right direction. I'm trying to create a completely self-contained Perl executable using pp. I'm running pp on a CentOS box:

pp -o client.out client.pl
client.out then runs fine on the CentOS box. However if I move client.out over to a SUSE box, it complains of not being able to find DynaLoader:

# ./client.out Can't load '/tmp/par-root/cache-12f562c1eb5356c7f67e68c6c9c351689d3bc6 +15/b5c569c9.so' for module Crypt::SSLeay: libssl.so.6: cannot open sh +ared object file: No such file or directory at /usr/lib64/perl5/5.8.8 +/x86_64-linux-thread-multi/DynaLoader.pm line 230. at /usr/lib/perl5/site_perl/5.8.8/PAR/Heavy.pm line 75 Compilation failed in require at ABRA/Host/API.pm line 10. BEGIN failed--compilation aborted at ABRA/Host/API.pm line 10. Compilation failed in require at ABRA/Host.pm line 10. BEGIN failed--compilation aborted at ABRA/Host.pm line 10. Compilation failed in require at script/abra-client.pl line 80. BEGIN failed--compilation aborted at script/abra-client.pl line 80. #

If I run the pp command on SUSE, the executable works fine on the SUSE box. I'm thinking based on that error that it's a problem with finding the shared library DynaLoader.pm which resides in a different directory on SUSE than on CentOS (although I tried sym linking and that didn't seem to fix the issue). However, I'd like it to not use shared libraries at all and be completely self-contained even if Perl wasn't installed on the box.

When unzipping the client.out (since it appears pp just zips it up) it looks like everything is there:

... inflating: lib/Crypt/SSLeay.pm inflating: lib/Crypt/SSLeay/CTX.pm inflating: lib/Crypt/SSLeay/Conn.pm inflating: lib/Crypt/SSLeay/Err.pm inflating: lib/Crypt/SSLeay/MainContext.pm inflating: lib/Crypt/SSLeay/X509.pm ... inflating: lib/DynaLoader.pm ...

However it doesn't seem to be using that and still goes after a shared library.

Any help would be appreciated!

Replies are listed 'Best First'.
Re: pp and shared libraries
by kcott (Archbishop) on Mar 06, 2012 at 16:57 UTC

    The executable created by pp will run on the OS it was created on. It typically won't run on other OSes. It may run between different versions of the same OS; for instance, I've created executables for Tk GUIs on a WinXP SP2 and run them on WinXP SP3.

    -- Ken

Re: pp and shared libraries
by Anonymous Monk on Mar 06, 2012 at 18:13 UTC

    run

    ldd /tmp/par-root/cache-12f562c1eb5356c7f67e68c6c9c351689d3bc615/b5c569c9.so

    ldd libssl.so.6

    pack missing .so' files with pp -l option  pp -l ssleay32 -l libeay32 -x   foo.pl ...

    when you get bored switch to http://www.cava.co.uk/

      Thanks Anonymous Monk! That was exactly it. There were two libraries it was looking for (libssl.so.6 and libcrypto.so.6). I linked to them during the pp, copied it over to SUSE and it worked great.