Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

switching from static Perl to Shared

by zentara (Archbishop)
on Apr 07, 2017 at 12:09 UTC ( #1187393=perlquestion: print w/replies, xml ) Need Help??
zentara has asked for the wisdom of the Perl Monks concerning the following question:

Hi, I have a simple question. I built my Perl 5.24.1 as a static program. Since then I have installed tons of modules, many with xs components. Now I need a shared version of Perl, so I can incorporate it into other programs, (like node.js :-) ). So, can I just rebuild Perl 5.24.1 with -fPIC and -Duseshrplib then install right over my current install, and will the modules still be usable? Thanks for any advice.

I'm not really a human, but I play one on earth. ..... an animated JAPH

Replies are listed 'Best First'.
Re: switching from static Perl to Shared
by syphilis (Chancellor) on Apr 07, 2017 at 14:02 UTC
    can I just rebuild Perl 5.24.1 with -fPIC and -Duseshrplib then install right over my current install

    Dunno ... I haven't built a static perl ... but I look forward to someone providing a conclusive answer to your question.

    When you install an XS module on your static perl (let's say it's Some::Module), does an auto/Some/Module/Module.so get installed somewhere ?
    If so, then I think there's a good chance that the answer to your question is "yes". But I'm guessing that no such Module.so gets installed with static perls.
    Therefore, I also guess that the correct answer to your question is "no" (because I believe that a shared perl will need to load a "Module.so").

    I could be wrong, but.

    Cheers,
    Rob
      Hi, the modules still get built and put into the Perl5lib, the only difference with static is that the Perl executable is standalone and does not require a libperl.so. I guess I will back up and just try it and report what happens. :-) What the question really is will the linking to modules change in some way if the libperl is in an external .so file rather than in one monolithic file. From the early days I always built the static Perl because the general consensus was that it loaded ever so slightly faster.

      I'm not really a human, but I play one on earth. ..... an animated JAPH
        Hi, I tried and it seems to have worked. I am running a shared perl now, and the modules installed with a static perl seem to be running fine. Perl just works! :-)

        I'm not really a human, but I play one on earth. ..... an animated JAPH

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1187393]
Front-paged by Corion
help
Chatterbox?
LanX Anonymous Monks meeting
holli brings cookies to the meeting
[stonecolddevin]: good morning all
[holli]: I'd bring wine but I am dry since two years, so cookies must do
[1nickt]: james28909 I enjoyed your metaphysical wonderings in tghe scientist thread. Also thought your comment about baby crispr students was comment of the year.
Eily brings the milk

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (11)
As of 2017-12-13 17:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What programming language do you hate the most?




















    Results (373 votes). Check out past polls.

    Notices?