conda-forge / perl-feedstock

A conda-smithy repository for perl.
BSD 3-Clause "New" or "Revised" License
3 stars 32 forks source link

Building libperl.so #19

Closed multimeric closed 3 years ago

multimeric commented 6 years ago

I'm currently trying to submit a package to bioconda and have encountered a problem. Namely, the package that I want to compile expects libperl.so to be present on the system. The documentation for this tool, PennCNV, says:

If you run "perl -V", you can try to find something like"/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE" in the dynamic linking section. Now make sure that the"/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE/libperl.so" file actually exist. Then in the Makefile, just add"-L/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE/" to the command it should fix the problem.

Currently, conda's perl does not build libperl.so, although this can be enabled by configuring perl using -Duseshrplib. However this apparently comes with a performance penalty (from perl's INSTALL document):

The disadvantages are that there may be a significant performance penalty associated with the shared libperl.so, and that the overall mechanism is still rather fragile with respect to different versions and upgrades.

In terms of performance, on my test system (Solaris 2.5_x86) the perl test suite took roughly 15% longer to run with the shared libperl.so. Your system and typical applications may well give quite different results.

So, to resolve this without performance penalty, I propose that perl-feedstock builds two separate packages: perl, and libperl-dev (note that there is a precedent for package managers doing this, as seen by Debian and Ubuntu's libperl-dev package). We do this by specifying multiple outputs in meta.yaml. Thus, we build perl once normally (statically linked), and use that to generate the perl package containing the perl binary. Then we make clean, and build perl again with -Duseshrplib, and use that to generate the libperl-dev, which contains libperl.so.

Thoughts?

mbargull commented 3 years ago

Since gh-49 -Duseshrplib is used and libperl.so can be now found at lib/perl5/*/core_perl/CORE/libperl.so. As for the performance penalty, I'd be surprised if there were any noticeably severe ones on modern systems since mayor Linux distributions also build Perl with its shared library.