Menu

#118 Parallel-build breakage (wrong libnco linked)

None
closed-out-of-date
None
9
2020-04-10
2019-12-17
No

Several Makefile recipes involve linking binaries against the libnco library that is part of this distro. Many of those specify it as foo_LDADD = libnco.la, but some have foo_LDADD=-lnco instead. The former causes linking directly to the library that was built whereas the latter searches -L paths (which can include global locations that have all sorts of other things installed). Part of the autotools magic is that the former automatically sets a foo:libnco.la dependency, whereas the latter does not. As a result, the latter has the possibility of libnco not yet being fully compiled by the time foo is linked, and -lnco resolving to a different version in the globally installed directories. Here are the places:

  • configure.ac line 410 - no idea how to diagnose what this does or fix it because I am on OS X:)

  • nco++/Makefile.am several places. "-L../nco" should be removed and "-lnco" replaced by "../libnco.la" everywhere.

  • nco_c++/Makefile.am line 24 should change:

-tst_LDADD = -lnco_c++
+tst_LDADD = libnco_c++.la

Discussion

  • Daniel Macks

    Daniel Macks - 2019-12-17

    Oh, and per autotools docs, -lfoo and libfoo.la flags should go in foo_LDADD not foo_LDFLAGS.

     
  • Charlie Zender

    Charlie Zender - 2019-12-17

    Thank you for reporting this Daniel. We are woefully incompetent with autoconf. It would be great if you would create a PR with all the fixes you deem necessary :)

     
  • Charlie Zender

    Charlie Zender - 2019-12-18
    • status: open --> open-accepted
    • assigned_to: Charlie Zender
    • Group: -->
    • Priority: 5 --> 9
     
  • Charlie Zender

    Charlie Zender - 2019-12-19

    I tried your suggestions. Replacing -lnco with -l../nco/libnco.la works. In fact it fixes a longstanding compiler issue with ncap2 on Cori at NERSC. However, replacing ncap2_LDFLAGS with ncap2_LDADD produces errors. I would be grateful if you could try that and offer any insight.

     
  • Daniel Macks

    Daniel Macks - 2019-12-20

    Is the current code in git (or CVS, or...) somewhere?

     
    • Charlie Zender

      Charlie Zender - 2019-12-20

      github.com/nco/nco.git

       
  • Charlie Zender

    Charlie Zender - 2020-04-10
    • status: open-accepted --> closed-out-of-date
     
  • Charlie Zender

    Charlie Zender - 2020-04-10

    Daniel, we are closing this because the patch you provided (thanks for trying!) breaks our regression tests as described on the GitHub PR page.

     

Log in to post a comment.