liuliu / ccv

C-based/Cached/Core Computer Vision Library, A Modern Computer Vision Library
http://libccv.org
Other
7.08k stars 1.71k forks source link

cuda/cwc_convnet.cu: 6: cuda/cwc_convnet.cu: extern: not found #198

Open shooyu opened 7 years ago

shooyu commented 7 years ago

Hello, guys,

When compile ccv, I get the Error message:

cuda/cwc_convnet.cu -o cuda/cwc_convnet.o -c -O3 --use_fast_math -arch=sm_30 -D HAVE_CBLAS -D HAVE_LIBPNG -D HAVE_LIBJPEG -D HAVE_FFTW3 -D HAVE_LIBLINEAR -D HAVE_AVCODEC -D HAVE_AVFORMAT -D HAVE_SWSCALE -D HAVE_SSE2 -D HAVE_GSL -D HAVE_CUDA cuda/cwc_convnet.cu: 6: cuda/cwc_convnet.cu: extern: not found cuda/cwc_convnet.cu: 15: cuda/cwc_convnet.cu: Syntax error: "}" unexpected makefile:30: recipe for target 'cuda/cwc_convnet.o' failed make: *** [cuda/cwc_convnet.o] Error 2

My system: ubuntu 16.04 cuda 8.0

What is the problem? Could you help me? Thank you! @antimatter15 @liuliu

liuliu commented 7 years ago

Doesn't seem like nvcc is in your $PATH otherwise it would be nvcc cuda/cwc_convnet.cu -o cuda/cwc_convnet.o -c -O3 --use_fast_math -arch=sm_30 -D HAVE_CBLAS -D HAVE_LIBPNG -D HAVE_LIBJPEG -D HAVE_FFTW3 -D HAVE_LIBLINEAR -D HAVE_AVCODEC -D HAVE_AVFORMAT -D HAVE_SWSCALE -D HAVE_SSE2 -D HAVE_GSL -D HAVE_CUDA

try which nvcc

shooyu commented 7 years ago

Thank you!

I check my config.mk, and find NVCC is empty:

CC := clang AR := ar NVCC := CUDA_OBJS := cuda/cwc_convnet.o cuda/cwc_convnet_helper.o cuda/convnet/cwc_convnet_convolutional.o cuda/convnet/cwc_convnet_rnorm.o cuda/convnet/cwc_convnet_pool.o cuda/convnet/cwc_convnet_full_connect.o DEFINE_MACROS := -D HAVE_CBLAS -D HAVE_LIBPNG -D HAVE_LIBJPEG -D HAVE_FFTW3 -D HAVE_LIBLINEAR -D HAVE_AVCODEC -D HAVE_AVFORMAT -D HAVE_SWSCALE -D USE_DISPATCH -D HAVE_SSE2 -D HAVE_GSL -D HAVE_CUDA prefix := /usr/local exec_prefix := ${prefix} CFLAGS := -fblocks -msse2 $(DEFINE_MACROS) -I${prefix}/include NVFLAGS := --use_fast_math -arch=sm_30 $(DEFINE_MACROS) LDFLAGS := -L${exec_prefix}/lib -lm -lcblas -latlas -lpng -ljpeg -lfftw3 -lfftw3f -lpthread -llinear -lavcodec -lavformat -lswscale -ldispatch -lBlocksRuntime -lgsl -lgslcblas -lcuda -lcudart -lcublas -L/usr/local/cuda/lib64

if I force NVCC := nvcc the compile error is nvcc command not found. But I have installed cuda 8.0 and added the $PATH:

~/ccv/ccv-stable/lib$ nvcc -V nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2016 NVIDIA Corporation Built on Tue_Jan_10_13:22:03_CST_2017 Cuda compilation tools, release 8.0, V8.0.61

Is there any problem? Thank you!