Adding ithreads Support to an Existing Perl Installation


In Gentoo, Perl is not compiled with threading support unless you specifically specify that you want it. Threading support is enabled by adding the ithreads USE flag to the package dev-lang/perl package. However, if you add that flag to an existing installation and recompile dev-lang/perl, you will get alot of error messages when you try to run your existing code:
For example:

Can't locate in @INC (@INC contains: /etc/perl /usr/lib64/perl5/site_perl/5.12.4/x86_64-linux-thread-multi /usr/lib64/perl5/site_perl/5.12.4 /usr/lib64/perl5/vendor_perl/5.12.4/x86_64-linux-thread-multi /usr/lib64/perl5/vendor_perl/5.12.4 /usr/lib64/perl5/site_perl /usr/lib64/perl5/vendor_perl /usr/lib64/perl5/5.12.4/x86_64-linux-thread-multi /usr/lib64/perl5/5.12.4 /usr/local/lib/site_perl .) at /usr/lib64/perl5/vendor_perl/5.12.4/Net/ line 5.
BEGIN failed--compilation aborted at /usr/lib64/perl5/vendor_perl/5.12.4/Net/ line 5.
Compilation failed in require at line 13.
BEGIN failed--compilation aborted at line 13.


You need to rebuild all the modules that come with perl when you change the ithreads flag. Luckily, perl comes with a tool that does just that: perl-cleaner. Execute it with

  $ perl-cleaner --all-modules
and a good while later, you'll have a rebuilt installation of all your modules that now support ithreads

You could leave a comment if you were logged in.
setup/gentoo/misc/perl/ithreads.txt · Last modified: 2013/11/24 11:52 by fronck
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki