Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: PAR::Packer shebang + PAR::Heavy missing

by Marshall (Canon)
on Oct 06, 2021 at 19:14 UTC ( [id://11137280]=note: print w/replies, xml ) Need Help??


in reply to PAR::Packer shebang + PAR::Heavy missing

For part (2): You should be using the pp utility that comes with PAR. pp will generate an executable binary file which contains your program + the parts of Perl needed to run it. You do not run PAR from within your program.

Update: You will need to get your program + Perl working on a Windows machine. You run pp on that Windows machine. To my knowledge, you cannot make a cross platform executable with this technology (ie, make Windows exe on a Linux machine), but I could be wrong about that. You will wind up with a normal Windows .exe file. You can do things like stuff an icon in that .exe just like any other Windows program. The .exe version will start a bit slower than the normal version, but other than that, it should be the same.

I suggest that you make a simple "hello world!" program to start with just to familiarize yourself with the mechanics of how to do this. There can be issues like how to include support files or add extra dll into that target .exe. But get started and "on first base" as the first step.

Replies are listed 'Best First'.
Re^2: PAR::Packer shebang + PAR::Heavy missing
by kaldor (Beadle) on Oct 08, 2021 at 21:22 UTC

    Actually, this question (2) doesn't concern Windows : I'm trying to package with 'pp -P' on macOS and run it on a Linux server. After reading carefully the doc, and adding the '-B' switch (bundle core switches), there's some improvement :

    Attempt to reload DynaLoader.pm aborted. Compilation failed in require at <embedded>/XSLoader.pm line 118.
      When you said: an executable for windows without Perl available that got me onto Windows.

      Get the basics working first. Then optimize when needed. As I mentioned, I don't think cross platform (Mac to Linux) is going to work. But I have no direct experience attempting that. Create a standalone executable on your Mac. Run that on your Mac. Get that working. Don't mess with -P until after you get the standalone version working (if ever).

      I take it that you have your own installation of Perl that you are using instead of the system version. That's fine, but I'm not sure how you went about doing that (question (1) related). This may be contributing to issues related to making a "partial executable".

        After (much) more experiments, I've noticed that the result of 'pp -P' works fine between macOS and Windows (I can pack on a platform an run it on the other without problem, both ways).

        On the Linux box where it fails to run, PAR::Heavy is not installed, so the error message is actually clear!
        On my mac, PAR::Heavy is installed in both perlbrew (probably done by me) and system perl (not done by me, I think).
        On Windows (Strawberry Perl), PAR::Heavy is installed by default (in perl\vendor\lib)

        So, this module is not a core module, but apparently "most/many" Perl distributions install it, is it correct?
        Should it also be present on the Linux server? I suspect it's not available because its dependency Archive::Zip fails to install.

        Many thanks all of you for the advice so far.
        Yes, currently only printing a string.
        Thank you for the tutorial link, I had not seen it.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11137280]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (3)
As of 2024-03-28 18:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found