ICC无法打开头文件

时间:2013-04-21 17:54:28

标签: compiler-errors header-files icc

我正在尝试编译一个代码(不是我的;使用C与cuda通信),它带有自己的makefile,并且我收到以下错误消息:

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

我使用“locate”并检查/usr/local/cuda/include/cuda_runtime.h是否存在;然后我尝试在变量PATH,LD_LIBRARY_PATH和C_INCLUDE_PATH中将它添加到我的.bashrc中,但似乎都没有。是否有另一个icc头文件路径的变量?如果没有,为什么编译器不能打开文件?

(我可以提供更多信息,但我真的不知道在这种情况下有什么相关性)

1 个答案:

答案 0 :(得分:0)

在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文件(以及其他必要的头文件)在编译器路径中。

*假设Intel的编译器icc安装正确,安装路径保留为默认路径。