Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
CMake
CMake
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,198
    • Issues 3,198
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 16
    • Merge Requests 16
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • External Wiki
    • External Wiki
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • CMake
  • CMakeCMake
  • Issues
  • #21688

Closed
Open
Opened Jan 11, 2021 by Rodolfo Schulz de Lima@rodlima

Linker error when cross-compiling CUDA code to aarch64-linux

A regression was introduced by cmake-3.17 where cross-compilation of CUDA code ends up with a linker error:

/usr/libexec/gcc/aarch64-linux-gnu/ld: cannot find -lcudadevrt /usr/libexec/gcc/aarch64-linux-gnu/ld: cannot find -lcudart_static

cmake isn't passing to the linker the directory that contains these libraries, and error ensues.

I suspect that the problem might be around this code: https://gitlab.kitware.com/cmake/cmake/-/blob/v3.19.2/Modules/CMakeDetermineCUDACompiler.cmake#L502

It excludes these libraries from the implicit library list used with cuda, but the target library path still remains in CMAKE_CUDA_HOST_IMPLICIT_LINK_DIRECTORIES, and cmake thus doesn't pass them to the linker.

This regression is presented in cmake-3.19.2 as well. It doesn't happen in cmake-3.16.9

To upload designs, you'll need to enable LFS and have admin enable hashed storage. More information
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: cmake/cmake#21688