Skip to content

libpi_cuda requires threads but Threads is not included via cmake #2404

@Natrocx

Description

@Natrocx

The error looks like this:

FAILED: lib/libpi_cuda.so
: && /usr/bin/g++-8 -fPIC -O3 -pipe -fexceptions -march=native -fasynchronous-unwind-tables -fPIC -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-maybe-uninitialized -Wno-class-memaccess -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wno-comment -fdiagnostics-color -ffunction-sections -fdata-sections -Wall -Wextra -Wno-deprecated-declarations -O3 -DNDEBUG  -Wl,-z,defs -Wl,-z,nodelete -Wl,--color-diagnostics -shared -Wl,-soname,libpi_cuda.so -o lib/libpi_cuda.so tools/sycl/plugins/cuda/CMakeFiles/pi_cuda.dir/pi_cuda.cpp.o  -Wl,-rpath,/opt/cuda/lib64:  /opt/cuda/lib64/libcuda.so  -lgcc_s  -lgcc && :
ld: error: undefined symbol: pthread_once
>>> referenced by pi_cuda.cpp
>>>               tools/sycl/plugins/cuda/CMakeFiles/pi_cuda.dir/pi_cuda.cpp.o:(cuda_piPlatformsGet)

This should easily be solved by adding find_package(Threads) and adding that to the target in the appropriate cmake file

Metadata

Metadata

Assignees

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