Menu

#210 Parallell make issue: cannot find -llirc

0.9.5
closed
nobody
None
fixed
2016-12-18
2016-07-18
Craig
No

0.9.4a has a problem building sometimes with parallel make (ex, "make -j2").

Here's the full build output when it fails:
https://588864.bugs.gentoo.org/attachment.cgi?id=440748

This issue was reported in the Gentoo issue tracker at https://bugs.gentoo.org/show_bug.cgi?id=588864

Thanks!

Related

Tickets: #210

Discussion

  • Alec Leamas

    Alec Leamas - 2016-07-18

    indeed, I was too quick. Sorry for that.

    Still, I have no clue here. This builds fine using parallel options on at least Fedora (koji and copr), Arch and Debian mentors. One question in the air is if the Gentoo toolchain differs in some respect?

     
  • Bengt Martensson

    Parallel make is all about one single thing: getting the dependencies right and complete. From the log file I gather that libirrrecord.a needs liblirc.so, but the Makefile does not know of this. A Makefile with that sort of incomplete dependencies may work "sometimes", for example sequencially, or in one environment but not another.

    Try to add this dependence. (Sorry, no patch, just "theory".)

     
  • Alec Leamas

    Alec Leamas - 2016-07-19

    From lib/Makefile.am:

    libirrecord_la_LIBADD       = -llirc
    

    So, the dep is seemingly there. This is actually after the fix above, the error message before that fix was exactly Craig's. Mystified. And still ashore...

     
  • Bengt Martensson

    No, it isn't. (Obviously.) That is a flag that is added to the linker command line, not a dependency. If I understand autotools, correctly, you can try setting

    libirrecord_la_DEPENDENCIES = liblirc.la
    

    or just add

    libirrecord.la: liblirc.la
    

    to the end of lib/Makefile.am.

     
  • Alec Leamas

    Alec Leamas - 2016-08-04

    Well... I wouldn't call it obvious. The question of the deps generated by foo_LIBADD is, well, not that obvious.

    Looking in my own lib/Makefile there is (abridged):

    libirrecord_la_LIBADD = -llirc
    libirrecord.la: $(libirrecord_la_LIBADD)
    

    Now, what's the interpretation of a dependency on a linker option?

    According to [1] using non-standard versions of libtool could cause errors like this. That said, I have no problem incorporating a patch like adding

     libirrecord_la_DEPENDENCIES = liblirc.la
    

    should it resolve your problem - it certainly doesn't hurt. But I need some feedback here.

    [1] http://stackoverflow.com/questions/11802727/libtool-doesnt-provide-library-dependencies-to-link

     
  • Bengt Martensson

    Since it did not solve the problem, it was, "obviouly", not the solution. That simple.

    libirrecord.la: $(libirrecord_la_LIBADD)
    

    Bad and useless. Expands to -llirc which is (probably?) not a Make target. (liblirc.la is)

    ld arguments and Make dependencies are really two pair of shoes. I do not know what libtool attempts (someone should check!), but I suspect that there are reasons that ld arguments are not automatically added to the dependencies, like adding system libraries.

    Also recall that libtool (and the rest of the autotools) were written in the 90-ties, when "parallel" was something pretty uncommon. Is Gordon still around?

    The quoted stackoverflow article is not about Make dependencies.

     
    • Alec Leamas

      Alec Leamas - 2016-08-05

      I need input from Craig to resolve this.

      That said, my snippets was from the generated Makefile, not Makefile.am (which is as of master). I have not made any changes since I cannot reproduce the problem.

       
  • Alec Leamas

    Alec Leamas - 2016-08-07

    As stated in PM: the question is if any of the proposed pacthes resolves the problem

     
  • Bengt Martensson

    The following method should ("should") be able to deterministically verify a possible fix:

    First compile the whole package. Then delete lib/libirrecord.la and lib/liblirc.la. In directory lib, try to make libirrecord.la. This should try to link libirrecord.la and should thus fail. After a successful fix, the command will succeed. (In detail: make now knows, through the dependencies, that it will need to build liblirc.la first, and will do so, before attempting to build libirrecord.la.

    Things that might go wrong: there may be liblirc.so-s spread around all around your system.

     
    • Alec Leamas

      Alec Leamas - 2016-08-08

      Now, with soem more time, this becomes interesting.

      First, we have [19439d] which supposedly should have fixed this.

      Second, followiign Bengt's ideas I'm able to reproduce the problem. And indeed, this lib/Makefile.am patch solves the problem:

      libirrecord_la_LIBADD       = -llirc
      +libirrecord_la_DEPENDENCIES = liblirc.la
      libirrecord_la_SOURCES      = irrecord.c
      

      Now, this looks like a automake (libtool?) bug: automake should add the proper deps for LIBADD, but doesn't. However I'm not sure enough (or too lazy) to report this.

      Need input from Craig to confirm that this patch resolves the problem before closing bug.

       

      Related

      Commit: [19439d]


      Last edit: Alec Leamas 2016-08-08
  • Alec Leamas

    Alec Leamas - 2016-08-09
    • status: open --> need-info
     
  • Alec Leamas

    Alec Leamas - 2016-08-09
    • status: need-info --> closed
    • Resolution: na --> fixed
    • Milestone: Future --> 0.9.5
     
  • Alec Leamas

    Alec Leamas - 2016-08-09

    Ah... finally. This is just a simple error (as always) and automake does what it should. Reading the automake manual for the _DEPENDENCIES variable it turns out that the default alternative uses what's in LIBADD, but removes any linker flags like -lliblirc.. Which is perfectly sane. Proper patch is basically

    -libirrecord_la_LIBADD       = -llirc
    +libirrecord_la_LIBADD       = liblirc.la
    

    Verified using Bengt's approach and by reading the manual Fixed in [c2d2f3] and [5e8a14] (master) and [6881bd] (release-0_9_4)

    On a sidenote, this is what the comment in [19439d] prescribed. But, still the one-line patch was wrong. Sigh.

     

    Related

    Commit: [6881bd]
    Commit: [19439d]
    Commit: [5e8a14]
    Commit: [c2d2f3]


    Last edit: Alec Leamas 2016-08-09
  • Craig

    Craig - 2016-12-18

    I think the fix version of this issue is actually 0.9.4b (or maybe 0.9.4c).

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.