loretoparisi / docker

My Docker scripts and Dockerfile for several frameworks.
MIT License
92 stars 64 forks source link

Error when making with OPENCV=1 #3

Open oreilc16 opened 6 years ago

oreilc16 commented 6 years ago

Hi,

I can make with OPENCV=0 (GPU, CUDNN=1 also). I successfully ran images through YOLO. I also successfully ran make darknet-cpp (from another project) with OPENCV=1 inside the same container. But when I run make with opencv=1 here I get the following error:

gcc -Iinclude/ -Isrc/ -DOPENCV `pkg-config --cflags opencv`  -DGPU -I/usr/local/cuda/include/ -DCUDNN  -Wall -fpermissive -Wno-unknown-pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -c ./src/gemm.c -o obj/gemm.o
cc1: warning: command line option '-fpermissive' is valid for C++/ObjC++ but not for C
In file included from /usr/local/include/opencv2/core/core_c.h:48:0,
                 from /usr/local/include/opencv2/highgui/highgui_c.h:45,
                 from include/darknet.h:25,
                 from ./src/utils.h:5,
                 from ./src/gemm.c:2:
/usr/local/include/opencv2/highgui/highgui_c.h:139:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token
 CVAPI(cv::Rect)cvGetWindowImageRect(const char* name);
 ^
./src/gemm.c: In function 'gemm_gpu':
./src/gemm.c:178:20: warning: unused variable 'handle' [-Wunused-variable]
     cublasHandle_t handle = blas_handle();
                    ^
Makefile:88: recipe for target 'obj/gemm.o' failed
make: *** [obj/gemm.o] Error 1

Any help is much appreciated

loretoparisi commented 6 years ago

@oreilc16 Happy that you were able to run make with both OPENCV. The reasons could be several. In this specific case it seems to me this very issue: https://github.com/pjreddie/darknet/issues/200