Skip to content

[SYCL] linking sycl gives missing __cpu_model #10

@airlied

Description

@airlied
Contributor

On Fedora 28 + gcc 8.2.1

CMakeFiles/sycl.dir/source/detail/device_info.cpp.o: In function cl::sycl::detail::get_native_vector_width(unsigned long)': device_info.cpp:(.text._ZN2cl4sycl6detail23get_native_vector_widthEm+0x3): undefined reference to __cpu_model'

I can fix this by manually adding -lgcc to the end of the c++ linker line, but that probably means something has gone wrong elsewhere, just mentioning here in case anyone else hits it.

Activity

bader

bader commented on Jan 29, 2019

@bader
Contributor

Hi Dave, thanks for reporting this issue. We have seen the sample problem with Ubuntu and implemented a workaround in CMake files here: https://github.com/intel/llvm/blob/sycl/sycl/CMakeLists.txt#L102
I think we should look at this problem more carefully and implement a more robust solution.

kusma

kusma commented on Jan 29, 2019

@kusma

I'm seeing the same problem as well on Fedora 29 + gcc 8.2.1.

keryell

keryell commented on Jan 30, 2019

@keryell
Contributor

It works out of the box on Ubuntu 18.10 & g++ 8.2.0 at least...

airlied

airlied commented on Feb 1, 2019

@airlied
ContributorAuthor

There's probably no harm in expanding the workaround to always just link -lgcc on gcc.

added a commit that references this issue on Mar 7, 2019

82 remaining items

Loading
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

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @kusma@bader@keryell@airlied

      Issue actions

        [SYCL] linking sycl gives missing __cpu_model · Issue #10 · intel/llvm