Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

how to Install/compile module as single threaded

by barsh (Novice)
on Aug 30, 2012 at 20:36 UTC ( #990848=perlquestion: print w/ replies, xml ) Need Help??
barsh has asked for the wisdom of the Perl Monks concerning the following question:

Hi,

I would like to install a single threaded copy of some modules (DateTime and DateTime::Format::MySQL) using cpan.

I have multi threaded perl on freebsd ("This is perl, v5.10.1 (*) built for x86_64-linux-thread-multi") and cpan installs the module into /usr/local/lib/perl5/site_perl/5.10.1/x86_64-linux-thread-multi

Unfortunately that path isn't in the default @INC for my modperl environment, and apparently for a good reason because when I try to include it, apache crashes with the following error or a memory dump appearing the error_log: /usr/local/etc/apache/bin/httpd: symbol lookup error: /usr/local/lib/perl5/site_perl/5.10.1/x86_64-linux-thread-multi//auto/Params/Validate/Validate.so: undefined symbol: Perl_Gthr_key_ptr

/usr/local/lib/perl5/site_perl/5.10.1/x86_64-linux is in the default @INC, so it is the same perl version 5.10.1, it is just a issue with the multi threaded.

Is there a way to force single threaded compiling of the package when installing?

Alternatively, how can I find out what perl binary Apache Modperl 2 is actually running? I can't find any perl binary on my system other than default one, so I assume it must be running the same multi threaded perl, but if it were running a single threaded perl binary I could potentially run cpan for the other perl binary and install the single threaded module that way.

Thanks

Comment on how to Install/compile module as single threaded
Re: how to Install/compile module as single threaded
by Fletch (Chancellor) on Aug 30, 2012 at 21:00 UTC

    I believe $^X still points to the current perl interp even under mod_perl so you may can write a small handler to dump that.

    The cake is a lie.
    The cake is a lie.
    The cake is a lie.

      Good thought, unfortunately that shows apache itself in modperl (/usr/local/etc/apache/bin/httpd)
Re: how to Install/compile module as single threaded
by syphilis (Canon) on Aug 31, 2012 at 01:49 UTC
    undefined symbol: Perl_Gthr_key_ptr

    That symbol is defined in 5.10.1 for the "x86_64-linux-thread-multi" architecture, but not for the "x86_64-linux" architecture.
    You cannot use extensions (modules containing compiled-in C code) built by a perl with "x86_64-linux-thread-multi" architecture on a perl that has been built with "x86_64-linux" architecture (and vice-versa) - even if both perls have the same version number.
    If you do that, you'll likely end up with errors of the sort you're seeing.

    It all adds up to there being 2 separate perl executables, built with different architecures - one which needs to access /usr/local/lib/perl5/site_perl/5.10.1/x86_64-linux-thread-multi, and another that needs to access /usr/local/lib/perl5/site_perl/5.10.1/x86_64-linux.
    If you want to update extensions for the latter, then you'll need to build those extensions using the latter.

    Cheers,
    Rob
      Hi, Thanks for the reply Rob. I kinda figured that it must be the case of having different perl executables but it is nice to have that confirmed.

      I guess the solution will have to be to recompile modperl with the default system perl version (multi-thread).

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://990848]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (8)
As of 2014-12-26 00:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (163 votes), past polls