in reply to Warning (mostly harmless): No library found for -lxml2

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.

Replies are listed 'Best First'.
Re^2: Warning (mostly harmless): No library found for -lxml2
by MikeTaylor (Sexton) on Aug 01, 2024 at 09:46 UTC
    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?

        Hi, Corion. Yes, the libraries are all needed. I didn't want to overload the thread with too much information, but after the perl Makefile.PL shown above, the output of make is:
        $ make cp SimpleServer.pm blib/lib/Net/Z3950/SimpleServer.pm AutoSplitting blib/lib/Net/Z3950/SimpleServer.pm (blib/lib/auto/Net/Z3 +950/SimpleServer) cp logging-server.pl blib/lib/Net/Z3950/logging-server.pl cp grs_test.pl blib/lib/Net/Z3950/grs_test.pl cp OID.pm blib/lib/Net/Z3950/OID.pm cp GRS1.pm blib/lib/Net/Z3950/GRS1.pm cp ztest.pl blib/lib/Net/Z3950/ztest.pl Running Mkbootstrap for SimpleServer () chmod 644 "SimpleServer.bs" "/usr/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- SimpleServ +er.bs blib/arch/auto/Net/Z3950/SimpleServer/SimpleServer.bs 644 "/usr/bin/perl" "/System/Library/Perl/5.30/ExtUtils/xsubpp" -typemap +'/System/Library/Perl/5.30/ExtUtils/typemap' SimpleServer.xs > Simpl +eServer.xsc mv SimpleServer.xsc SimpleServer.c cc -c -I/usr/local/Cellar/yaz/5.34.0_2/include -DYAZ_POSIX_THREADS=1 +-DYAZ_HAVE_XML2=1 -DYAZ_HAVE_XSLT=1 -DYAZ_HAVE_EXSLT=1 -g -pipe -DPER +L_USE_SAFE_PUTENV -Os -DVERSION=\"1.28\" -DXS_VERSION=\"1.28\" -iw +ithsysroot "/System/Library/Perl/5.30/darwin-thread-multi-2level/CORE +" SimpleServer.c rm -f blib/arch/auto/Net/Z3950/SimpleServer/SimpleServer.bundle LD_RUN_PATH="/usr/local/Cellar/yaz/5.34.0_2/lib" cc -bundle -undefine +d dynamic_lookup SimpleServer.o -o blib/arch/auto/Net/Z3950/SimpleS +erver/SimpleServer.bundle \ -L/usr/local/Cellar/yaz/5.34.0_2/lib -lyaz_server -lyaz \ ld: warning: -undefined dynamic_lookup may not work with chained fixup +s chmod 755 blib/arch/auto/Net/Z3950/SimpleServer/SimpleServer.bundle Manifying 2 pod documents
        So the issue potential here is if course the -undefined dynamic_lookup warning. Again, at the time it seems benign. And it's not clear whether it's related to the "mostly harmless" warnings, but obvious both pertain to linking.
        Sorry, I should have been clearer about this. Yes, both the headers and the libraries are installed, as is shown by a later successful make test (although I have to go through another bit of detail to make that work — details to follow elsewhere in the thread).