且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

NVCC不会在/usr/lib/x86_64-linux-gnu中查找库-为什么?

更新时间:2023-10-17 10:49:04

NVCC或nvlink在名为LIBRARIES的环境变量中查找路径.但是-在执行此操作之前,将执行外壳脚本/etc/nvcc.profile(至少在Devuan上).

NVCC, or perhaps nvlink, looks for paths in an environment variable named LIBRARIES. But - before doing so, the shell script /etc/nvcc.profile is executed (at least, it is on Devuan).

在Devuan 3.0上,该文件的一行显示为:

On Devuan 3.0, that file has a line saying:

LIBRARIES   =+ $(_SPACE_) -L/usr/lib/x86_64-linux-gnu/stubs

,因此默认情况下,这就是您的NVCC查找的位置.

so that's where your NVCC looks to by default.

因此,您可以执行以下两项操作之一:

You can therefore do one of two things:

  1. 在NVCC外部设置环境变量,例如在您的~/.profile~/.bashrc文件中:

export LIBRARIES=-L/usr/lib/x86_64-linux-gnu/stubs

  • nvcc.profile行更改为:

  • Change that nvcc.profile line to say:

    LIBRARIES   =+ $(_SPACE_) -L/usr/lib/x86_64-linux-gnu -L/usr/lib/x86_64-linux-gnu/stubs
    

  • NVCC将成功构建您的二进制文件.

    and NVCC will successfully build your binary.