Build of rb1d-basic is failing at Link time using the nightly build (and on Kotten)

Issue #207 invalid
Scott Baden created an issue

In the scott/rb1d/upcxx folder:

cori03 rb1d/upcxx% /usr/common/ftg/upcxx/nightly/hsw/intel/PrgEnv-intel-6.0.4-18.0.1.163-2019.03.13/bin/upcxx -g -o rb1d-basic  rb1d-basic.o dumpAns.o fillGhost.o 
/usr/bin/ld: rb1d-basic.o: in function `main':
/global/u2/b/baden/Codes/scott/rb1d/upcxx/rb1d-basic.cpp:145: undefined reference to `fillGhost(double*, int, upcxx::global_ptr<double, (upcxx::memory_kind)1>&, upcxx::global_ptr<double, (upcxx::memory_kind)1>&)'
/usr/bin/ld: /global/u2/b/baden/Codes/scott/rb1d/upcxx/rb1d-basic.cpp:167: undefined reference to `fillGhost(double*, int, upcxx::global_ptr<double, (upcxx::memory_kind)1>&, upcxx::global_ptr<double, (upcxx::memory_kind)1>&)'
/usr/bin/ld: link errors found, deleting executable `rb1d-basic'

Comments (6)

  1. Dan Bonachea

    @sbaden - this appears to be a bug in your code.

    When I type make in this directory it links in fillGhost.cpp which defines this overload:

    void fillGhost(double *u, int lo, int hi, int phase, global_ptr<double> &uL, global_ptr<double> &uR)
    

    However rb1d-np.cpp is declaring (but not defining) this overload, and then using it:

    void fillGhost(double *u, int locPnts, global_ptr<double> &uL, global_ptr<double> &uR);
    

    The linker correctly reports that you've referenced a function that is not defined with the right signature in the objects it was given.

  2. Scott Baden reporter

    Thanks for clarifying. The appearance of memory_kind in the load line mislead me. This will be an issue for some users who aren't invoking memory kinds. It's not UPC++'s fault, but an artifact of C++. The memory kind template argument is optional, but I suspect there is no way of suppressing unused optional arguments from error messages

    I would much rather see fillGhost(double*, int, upcxx::global_ptr<double>&, upcxx::global_ptr<double>&)

  3. Dan Bonachea

    @sbaden - correct this is a C++ issue that we have no control over. Error messages will show the full template instantiation, including defaulted parameters. C++ users are used to seeing this in error messages including STL types, most of which include defaulted template parameters.

  4. Paul Hargrove

    FWIW, the same application fails to link with our Sep release (with no mention of memory kinds):

    {phargrov@kotten upcxx}$ module swap gcc gcc/8.2.0 {phargrov@kotten upcxx}$ module load upcxx/2018.9.0/gcc-8.2.0 {phargrov@kotten upcxx}$ make /opt/upcxx/gcc-8.2.0/stable-2018.9.0/bin/upcxx -c -I../common -g rb1d-nd.cpp -o rb1d-nd.o /opt/upcxx/gcc-8.2.0/stable-2018.9.0/bin/upcxx -c -I../common -g dumpAnsOrderly.cpp -o dumpAnsOrderly.o /opt/upcxx/gcc-8.2.0/stable-2018.9.0/bin/upcxx -c -I../common -g fillGhost.cpp -o fillGhost.o /opt/upcxx/gcc-8.2.0/stable-2018.9.0/bin/upcxx -c -I../common -g OrderlyOutput.cpp -o OrderlyOutput.o /opt/upcxx/gcc-8.2.0/stable-2018.9.0/bin/upcxx -o rb1d-nd rb1d-nd.o dumpAnsOrderly.o fillGhost.o OrderlyOutput.o OrderlyOutput.o: In function upcxx::detail::future_header_result<>::results_of(upcxx::detail::future_header*)': /home/pcp1/phargrov/scott/rb1d/upcxx/OrderlyOutput.cpp:12: multiple definition ofOrderlyOutput(std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >&)' dumpAnsOrderly.o:/home/pcp1/phargrov/scott/rb1d/upcxx/OrderlyOutput.cpp:12: first defined here rb1d-nd.o: In function main': /home/pcp1/phargrov/scott/rb1d/upcxx/rb1d-nd.cpp:134: undefined reference tofillGhost(double, int, upcxx::global_ptr<double>&, upcxx::global_ptr<double>&)' /home/pcp1/phargrov/scott/rb1d/upcxx/rb1d-nd.cpp:154: undefined reference to `fillGhost(double, int, upcxx::global_ptr<double>&, upcxx::global_ptr<double>&)' collect2: error: ld returned 1 exit status make: *** [rb1d-nd] Error 1

  5. Log in to comment