我刚刚安装了 CUDA 并一直在关注http://docs.nvidia.com/cuda/cuda-getting-started-guide-for-mac-os-x/index.html
一切正常,直到我尝试将 deviceQuery 等示例代码复制到 ~/Desktop 并编译。
我在编译时收到以下错误:
/Developer/NVIDIA/CUDA-5.5/bin/nvcc -ccbin g++ -I../../common/inc -m64 -Xcompiler -arch -Xcompiler x86_64 -gencode arch=compute_10,code=sm_10 -gencode arch=compute_20,code=sm_20 -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=\"sm_35,compute_35\" -o deviceQuery.o -c deviceQuery.cpp
deviceQuery.cpp:23:25: error: helper_cuda.h: No such file or directory
deviceQuery.cpp: In function ‘int main(int, char**)’:
deviceQuery.cpp:111: error: ‘SPRINTF’ was not declared in this scope
deviceQuery.cpp:116: error: ‘_ConvertSMVer2Cores’ was not declared in this scope
deviceQuery.cpp:206: error: ‘checkCudaErrors’ was not declared in this scope
deviceQuery.cpp:230: error: ‘checkCudaErrors’ was not declared in this scope
deviceQuery.cpp:241: error: ‘checkCudaErrors’ was not declared in this scope
make: *** [deviceQuery.o] Error 1
该代码将在CUDA目录中编译并运行,很明显编译器找不到helper_cuda.h,我也找不到,有人有解决方案吗?