Skip to content

Multi-definition issue of including the DPCTL header in multiple CPP sources #946

Closed

Description

@chengjunlu

Hi,

I have two CPP sources include the DPCTL header.
The multi-definition issue happen in linking:

/usr/bin/ld: /tmp/Stream-e835c3.o: in function `std::__detail::_Hash_node<std::pair<_object const* const, std::vector<_object*, std::allocator<_object*> > >, false>::_M_next() const':
/home/guangyey/CLionProjects/pytorch/torch/include/pybind11/pybind11.h:662: multiple definition of `import_dpctl()'; /tmp/Module-08230d.o:/home/guangyey/CLionProjects/pytorch/torch/include/pybind11/pybind11.h:662: first defined here

I can work around the issue by change the import_dpctl to static.

Activity

  1. diptorupd commented on Oct 21, 2022

    @diptorupd
    Contributor

    @chengjunlu Current master should already have the fix. Can you try the latest development snapshot package? The package will need to be installed via Conda.

    Refer https://github.com/IntelPython/dpctl#installing-the-bleeding-edge

  2. chengjunlu commented on Oct 21, 2022

    @chengjunlu
    Author

    @diptorupd Thanks for the suggestion.
    I met the issue on the latest master trunk commit ab46d49.

  3. oleksandr-pavlyk commented on Oct 25, 2022

    @oleksandr-pavlyk
    Contributor

    The fix has been merged to master in 59980a2 in #941, which happened after ab46d49

    Could you please try either tip of the main branch or 59980a2 ?

  4. chengjunlu commented on Oct 28, 2022

    @chengjunlu
    Author

    I am not sure what is suggested.

    I am using the DPCTL by build it from sources instead of installing from the conda or pip

  5. oleksandr-pavlyk commented on Oct 28, 2022

    @oleksandr-pavlyk
    Contributor

    @chengjunlu I am suggesting you build dpctl from sources at the present tip of the master at 36c8f71. The problem you are reporting should be fixed there.

  6. diptorupd commented on Nov 3, 2022

    @diptorupd
    Contributor

    ping @chengjunlu. Does current tip of master work for you? Once you let us know we can close the ticket.

  7. chengjunlu commented on Nov 4, 2022

    @chengjunlu
    Author

    @diptorupd
    Confirmed the issue has been fixed on the latest master.
    Please close this JIRA.

  8. oleksandr-pavlyk commented on Nov 4, 2022

    @oleksandr-pavlyk
    Contributor

    Closing as fixed by #941

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions