简体   繁体   中英

ICC can't open header file

I am trying to compile a code (not mine; uses C to communicate with cuda) that came with its own makefile, and I'm getting the following error message:

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

I used "locate" and checked that /usr/local/cuda/include/cuda_runtime.h exists; then I tried adding it to my .bashrc in the variables PATH, LD_LIBRARY_PATH, and C_INCLUDE_PATH but none seems to work. Is there another variable for the path of icc header files? If not, why can't the compiler open the file?

(I can provide more info, but I really don't know what is relevant in this case)

In Linux (and probably MacOS), the compiler include path is*

/opt/intel/compilers_and_libraries_2018.0.128/linux/compiler/include

and the library path is

/opt/intel/compilers_and_libraries_2018.0.128/linux/compiler/lib

so you just need to make sure that cuda_runtime.h file (along with other necessary header files) are in the compiler path.

*assuming Intel's compiler icc is installed properly, and the installation path is left as default.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM