I'm trying to compile darknet for windows using cygwin. I already have CUDA installed on windows, and I've created symlinks from cygwin folders to windows folders:
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
Now, ls /usr/local/cuda/include
lists files in the CUDA include folder (including cuda_runtime.h).
After running make
from darknet folder, some files are compiled until convolutional_kernels.cu
is reached. Then gcc
throws:
<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
even though, just couple of lines before there is this:
<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
which clearly shows that CUDA includes (e.g. cuda_runtime.h) are reachable.
The only way I've modified makefile
is that I asked of nvcc
to explicitly use gcc
instead of windows' cl.exe
. At line 23 I've changed NVCC=nvcc
to NVCC=nvcc -ccbin gcc
Does anyone have an idea how to solve this compilation error?