MikeTaylor has asked for the wisdom of the Perl Monks concerning the following question:

I am the maintainer of the Perl module Net::Z3950::SimpleServer. When I run my Makefile.PL on my MacBook Pro Mid-2015, running MacOS Monterey 12.7.5, I get ten "mostly harmless" warnings about libraries that the build process can't find:
$ perl Makefile.PL Checking if your kit is complete... Looks good Warning (mostly harmless): No library found for -lexslt Warning (mostly harmless): No library found for -lxslt Warning (mostly harmless): No library found for -lxml2 Warning (mostly harmless): No library found for -lz Warning (mostly harmless): No library found for -lpthread Warning (mostly harmless): No library found for -licucore Warning (mostly harmless): No library found for -lm Warning (mostly harmless): No library found for -lxml2 Warning (mostly harmless): No library found for -liconv Warning (mostly harmless): No library found for -lpthread Generating a Unix-style Makefile Writing Makefile for Net::Z3950::SimpleServer Writing MYMETA.yml and MYMETA.json
Something more significant is going wrong with dynamic libraries later on when I run "make test", and I would like to narrow down the scope of my bewilderment by ruling out these early complains. Can anyone explain exactly what these "mostly harmless" warnings are telling me, and what if anything I can do to avoid them? Thank you!

Replies are listed 'Best First'.
Re: Warning (mostly harmless): No library found for -lxml2
by Corion (Patriarch) on Aug 01, 2024 at 09:25 UTC

    The output comes from ExtUtils::MakeMaker. In Makefile.PL you have the line

    'LIBS' => [$yazlibs], # e.g., '-lm'

    ... which lists all the libraries that some tool wants that your XS module wants to link to. It seems that these libraries are not found (and maybe not installed) when you run Makefile.PL. The "mostly harmless" message is rarely mostly harmless as usually, required libraries are required.

    I guess you can improve the compilation situation by installing the -devel packages for all the libraries listed.

      Thanks, but it's not that simple. The libraries are in place, and my code runs successfully. So I think the issue here may just be that ExtUtils::MakeMaker doesn't know how to find the libraries that ld does find late in the process. ... which I guess likely means this is mostly harmless.

        Maybe we can get closer to the problem if you show us the output where Something more significant is going wrong with dynamic libraries later on when I run "make test". If the libraries are not needed, I'm not sure why they are listed in the Makefile.PL. As you are the maintainer of the module, maybe you can tell us why you put the libraries into the Makefile.PL in the first place?

Re: Warning (mostly harmless): No library found for -lxml2
by syphilis (Archbishop) on Aug 01, 2024 at 13:52 UTC
    Something more significant is going wrong with dynamic libraries later on when I run "make test" ...

    This suggests to me that the warnings are almost certainly NOT harmless.
    The warnings are telling you that EU::MM can't find the import libraries libexslt.a, libxslt.a, libxml2.a, etc., and that no attempt will therefore be made to link to them.
    The failure to link to all of those import libraries will probably show up as runtime failures during "make test" because there's (probably) a whole lot of unresolved symbols.

    The headers are obviously being found - otherwise there would have been compilation failures during the "make" stage.
    I think you just need to tell EU::MM where those libraries are.

    Cheers,
    Rob
      MacOS doesn't have "import libraries". There, .a files would be static link libraries. Instead, it's dynamic libraries EUMM can't find.
      Thanks, Rob. That would be a solid interpretation were it not for the fact that I can coerce the linking to work and the tests to run as noted in this comment down in the other trouser-leg of the thread.
        That would be a solid interpretation were it not for the fact that I can coerce the linking to work and the tests to run as noted in this comment down in the other trouser-leg of the thread.

        Yeah - I saw that comment after I posted ... and wondered ...
        And etj has pointed out that "it's dynamic libraries EUMM can't find".

        Still, to me it seems unreasonable to expect the build to work if EU::MM can't find those libraries - given (my assumption) that none of those linking directives will therefore be present in the build's "make" stage.
        However, given my lack of understanding of MacOs processes, I should just shut up.

        Cheers,
        Rob
Re: Warning (mostly harmless): No library found for -lxml2
by bliako (Abbot) on Aug 02, 2024 at 08:27 UTC

    from a diagonal google search it looks to me the error is coming from OSX and not perl. Code signing libraries perhaps.

      Yes, I think it's to do with MacOS and code-signing. But I would expect MakeMaker to generate a Makefile that avoids that trap.
        And with that, I finally thought to myself: I wonder if my version of MakeMaker is too old? On checking, I found that I had version 7.34, which the changelog says is from 19 March 2018 ... more than six years old!

        I upgraded to the current version (7.70) and found that perl Makefile.PL now runs without warnings (good!) ...

        ... but that the actual make now fails completely, saying

        SimpleServer.xs:34:10: fatal error: 'EXTERN.h' file not found
        Oh well. Onward and upward!