UPC++/UPC link failures on Cray

Issue #220 wontfix
Paul Hargrove created an issue

When running the UPC++/UPC interoperability tests via CI on OLCF's Titan, we see link failures such as the following, due to the link flags for libhugetlbfs (fairly esoteric, and generated by Cray's wrapper compilers) appearing twice in the link command:

upcc: error running '/usr/bin/gmake --no-print-directory' to link application:
/usr/lib/../lib64/libhugetlbfs.a(elflink.o): In function `__libhugetlbfs_do_remap_segments':
/usr/src/packages/BUILD/cray-libhugetlbfs-2.16/elflink.c:2169: multiple definition of `__libhugetlbfs_do_remap_segments'
/usr/lib/../lib64/libhugetlbfs.a(elflink.o):/usr/src/packages/BUILD/cray-libhugetlbfs-2.16/elflink.c:2169: first defined here
/usr/lib/../lib64/libhugetlbfs.a(elflink.o): In function `__libhugetlbfs_do_remap_segments':
/usr/src/packages/BUILD/cray-libhugetlbfs-2.16/elflink.c:2312: multiple definition of `__libhugetlbfs_do_remap_segments_end'
/usr/lib/../lib64/libhugetlbfs.a(elflink.o):/usr/src/packages/BUILD/cray-libhugetlbfs-2.16/elflink.c:2312: first defined here
[...output truncated.  There are many more from the same lib...]

While this issue has been observed on Titan, it is believed that Cori or Theta would show the same failure if one sets CRAYPE_LINK_TYPE=dynamic. However, this has not yet been confirmed. As described in issue #157 and https://upc-bugs.lbl.gov/bugzilla/show_bug.cgi?id=3813 , we may need to use dynamic linking on Cray systems to avoid an orthogonal problem.

Dan has suggested that a (relatively simple) script can be used to remove the duplicate linker argument(s) which cause the problem. If one names this script upcxx-upc then the interoperability documentation (in docs/upc-hybrid.md) would be updated to recommend upcc -link-with='upcxx-upc <args>'.

Comments (3)

  1. Paul Hargrove reporter

    It seems I had forgotten some important past work in this area.
    This was reported to OLCF support ( https://upc-bugs.lbl.gov/bugzilla/show_bug.cgi?id=3883 ) and it has been determined that the cc and CC compiler wrappers in craype/2.5.14 (and newer) avoid this problem.

    I also appear to have had the static-vs-dynamic distinction wrong (Titan is NOT defaulting to dynamic).

    TL;DR:
    This is a problem with Cray's compiler wrappers, which was resolved in craype/2.5.14.

  2. Log in to comment