我正在尝试编译自己的makefile附带的代码(不是我的;使用C与cuda进行通信),并且收到以下错误消息:
icc -fPIC -vec-report1 -g -O3 -fno-strict-aliasing -DNDEBUG -I. -I/include -DUNIX -DCPU_RECOMPUTE=1 -DFULL_DOUBLE=0 -c classify_functions.cpp -o classify_functions.o
classify_functions.cpp(4): catastrophic error: cannot open source file "cuda_runtime.h"
#include <cuda_runtime.h>
^
compilation aborted for classify_functions.cpp (code 4)
make: *** [classify_functions.o] Error 4
最佳答案
在Linux(可能是MacOS)中,编译器的包含路径为*
/opt/intel/compilers_and_libraries_2018.0.128/linux/compiler/include
/opt/intel/compilers_and_libraries_2018.0.128/linux/compiler/lib
cuda_runtime.h
文件(以及其他必要的头文件)在编译器路径中即可。https://stackoverflow.com/questions/16134354/