0

我正在尝试使用 cygwin 为 windows编译暗网。我已经在 Windows 上安装了 CUDA,并且创建了从 cygwin 文件夹到 Windows 文件夹的符号链接:

ln -sv /cygdrive/c/Program\ Files/NVIDIA\ GPU\ Computing\ Toolkit/CUDA/v8.0/include/ /usr/local/cuda/include
ln -sv /cygdrive/c/Program\ Files/NVIDIA\ GPU\ Computing\ Toolkit/CUDA/v8.0/lib/x64/ /usr/local/cuda/lib64

现在,ls /usr/local/cuda/include列出 CUDA 包含文件夹中的文件(包括 cuda_runtime.h)。

make从暗网文件夹运行后,一些文件被编译直到convolutional_kernels.cu到达。然后gcc抛出:

<built-in>: note: this is the location of the previous definition
nvcc -ccbin gcc -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_50,code=[sm_50,compute_50] -gencode arch=compute_52,code=[sm_52,compute_52] -Iinclude/ -Isrc/ -DGPU -I/usr/local/cuda/include/ --compiler-options "-Wall -Wno-unknown-pragmas -Wfatal-errors -fPIC -Ofast -DGPU" -c ./src/convolutional_kernels.cu -o obj/convolutional_kernels.o
gcc: error: cuda_runtime.h: No such file or directory
gcc: error: unrecognized command line option ‘-nologo’
gcc: error: unrecognized command line option ‘-EHsc’
convolutional_kernels.cu
make: *** [Makefile:88: obj/convolutional_kernels.o] Error 1

尽管如此,在这之前只有几行:

<built-in>: note: this is the location of the previous definition
gcc -Iinclude/ -Isrc/ -DGPU -I/usr/local/cuda/include/ -Wall -Wno-unknown-pragmas -Wfatal-errors -fPIC -Ofast -DGPU -c ./src/lstm_layer.c -o obj/lstm_layer.o
In file included from /usr/local/cuda/include/device_types.h:53:0,
             from /usr/local/cuda/include/builtin_types.h:56,
             from /usr/local/cuda/include/cuda_runtime.h:86,
             from include/darknet.h:14,
             from ./src/activations.h:3,
             from ./src/lstm_layer.h:4,
             from ./src/lstm_layer.c:1:
/usr/local/cuda/include/host_defines.h:84:0: warning: "__cdecl" redefined
#define __cdecl

这清楚地表明 CUDA 包含(例如 cuda_runtime.h)是可以访问的。

我修改的唯一方法makefile是我要求nvcc明确使用gcc而不是 windows' cl.exe。在第 23 行,我已更改NVCC=nvccNVCC=nvcc -ccbin gcc

有谁知道如何解决这个编译错误?

4

0 回答 0