在搜索-lcudart时跳过不兼容的libcudart.so [英] skipping incompatible libcudart.so when searching for -lcudart
问题描述
当我使用nvcc 5.0编译.cu文件时,编译器会给我以下信息。
When I compile .cu file with nvcc 5.0, the compiler gives me following information.
/ usr / bin / ld:skip在搜索-lcudart时不兼容/usr/local/cuda-5.0/lib/libcudart.so
/usr/bin/ld: skipping incompatible /usr/local/cuda-5.0/lib/libcudart.so when searching for -lcudart
似乎是警告或错误。我不知道事情是什么。
It seems either a warning or an error. I don't know what the matter is.
有没有人知道有关此信息的更多详细信息?
Is there anyone knowing more details about this information?
推荐答案
当尝试将64位代码与32位库链接时,通常会发生此警告,请参阅以下问题:跳过不兼容的库编译。
This warning often happens when trying to link a 64-bit code with a 32-bit library, see this question: Skipping Incompatible Libraries at compile.
您需要区分两个库文件:
You need to distinguish 2 library files:
-
$ CUDA_HOME / lib / libcudart.so
是32位版本的cudart
库。 -
$ CUDA_HOME / lib64 / libcudart.so
是cudart
库的64位版本。
$CUDA_HOME/lib/libcudart.so
, the 32-bit version of thecudart
library.$CUDA_HOME/lib64/libcudart.so
, the 64-bit version of thecudart
library.
(在您的情况下, $ CUDA_HOME
是 / usr / local /cuda-5.0
)
基本上,链接器首先找到32位库( -L $
Basically, the linker finds the 32-bit library first (-L
options are searched in order) and returns that warning even if it ends up finding the proper library.
您可能需要添加选项, $ CUDA_HOME / lib
到环境变量$ $ CUDA_HOME / lib64
code> ld 可以在32位版本之前为您的64位架构找到合适的库。
You probably need to add $CUDA_HOME/lib64
to your LD_LIBRARY_PATH
environment variable before $CUDA_HOME/lib
so that ld
can find the proper library for your 64-bit architecture before the 32-bit version.
这篇关于在搜索-lcudart时跳过不兼容的libcudart.so的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!