compiler-errors - ICC无法打开头文件

我正在尝试编译自己的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

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

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

最佳答案

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

*假设英特尔的编译器icc已正确安装,并且安装路径保留为默认设置。

https://stackoverflow.com/questions/16134354/

相关文章:

xml - 访问AS3中XML对象的可能未定义的属性?

java - 泛型错误-找不到符号类

c++ - 试图编译 boost 依赖库 - "is private"错误

c++ - 使用 Boost.Python 和静态库构建

actionscript-3 - 如何使用ASC2.0修复Error “A conflict exi

c++ - VC++编译器忽略重载函数

c++ - 无法在NetBeans IDE中编译C++-给出错误 “CreateProcess er

c++ - 在C++中,编译-std = c++ 0x需要什么?

ios - iOS项目提供 “Automatic Reference Count Issue”

c++ - qmobilityglobal.h : No such file or director