macos - nvcc 未知选项 -no_pie

标签 macos gcc cuda ld nvcc

在我的 mac(Snow Leopard) 上更新 CUDA 后,nvidia 的 nvcc 编译器在编译时表现得很奇怪:

 nvcc batched_gemm.cu

我收到以下编译错误,我不知道如何解决这个问题。

ld: unknown option: -no_pie
collect2: ld returned 1 exit status

有人知道问题出在哪里吗?

最佳答案

完成更新后,我假设是最新的稳定版 (v4.1),所以根据

NVIDIA CUDA Toolkit v4.1 Production Release Notes for Windows, Linux, and Mac OS X, CUDA Toolkit Known Issues, *MAC 10.*7:

The host linker on Mac OS 10.7 generates position-independent executables by default. As CUDA does not support position-independent executable currently, the linker must generate position-dependent executable by passing in the -no_pie option. If nvcc is being used to link the application, this option will be passed to the linker by default. To override the default behavior, the -Xlinker -pie option can be passed to nvcc.

关于macos - nvcc 未知选项 -no_pie,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9327265/

相关文章:

使用 gnu 链接器更改入口点

c++ - GCC 4.5.2 链接器在使用异常时出现问题 (C++)

cuda - 如何在 CUDA 中使用二维数组?

macos - 在 Mac 上的 VirtualBox 中的 Windows VM 上使用 dnsmasq (+ MAMP)

c - malloc() 和 memset() 行为

Objective-C WKWebView 不会根据类文档公开 ScrollView

c++ - 将二维数组从 C++ 类传递给 CUDA 函数

compilation - CUDA 5.0 用cmake单独编译库

git - Mac 上的 PyCharm 无法克隆存储库 : remote end hung up unexpectedly

macos - 在 OS X 启动时运行 Python 脚本