{"action":"opened","issue":{"url":"https://api.github.com/repos/pjreddie/darknet/issues/695","repository_url":"https://api.github.com/repos/pjreddie/darknet","labels_url":"https://api.github.com/repos/pjreddie/darknet/issues/695/labels{/name}","comments_url":"https://api.github.com/repos/pjreddie/darknet/issues/695/comments","events_url":"https://api.github.com/repos/pjreddie/darknet/issues/695/events","html_url":"https://github.com/pjreddie/darknet/issues/695","id":314316682,"number":695,"title":"Compile Error With OpenCv 2.4.9 and CUDA  8.0","user":{"login":"wangdayan","id":19343286,"avatar_url":"https://avatars2.githubusercontent.com/u/19343286?v=4","gravatar_id":"","url":"https://api.github.com/users/wangdayan","html_url":"https://github.com/wangdayan","followers_url":"https://api.github.com/users/wangdayan/followers","following_url":"https://api.github.com/users/wangdayan/following{/other_user}","gists_url":"https://api.github.com/users/wangdayan/gists{/gist_id}","starred_url":"https://api.github.com/users/wangdayan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wangdayan/subscriptions","organizations_url":"https://api.github.com/users/wangdayan/orgs","repos_url":"https://api.github.com/users/wangdayan/repos","events_url":"https://api.github.com/users/wangdayan/events{/privacy}","received_events_url":"https://api.github.com/users/wangdayan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-04-14T10:04:15Z","updated_at":"2018-04-14T10:04:15Z","closed_at":null,"author_association":"NONE","body":"Hello, I want to compile YOLOv3 in ubuntu.\r\n\r\n1. when I run “make”, It happens:\r\n\r\nwangqianyun@humanmotion-Z97X-UD5H:~/darknet$ make\r\ngcc -Wall -Wno-unused-result -Wno-unknown-pragmas -Wfatal-errors -fPIC -Ofast -DOPENCV -DGPU -shared obj/gemm.o obj/utils.o obj/cuda.o obj/deconvolutional_layer.o obj/convolutional_layer.o obj/list.o obj/image.o obj/activations.o obj/im2col.o obj/col2im.o obj/blas.o obj/crop_layer.o obj/dropout_layer.o obj/maxpool_layer.o obj/softmax_layer.o obj/data.o obj/matrix.o obj/network.o obj/connected_layer.o obj/cost_layer.o obj/parser.o obj/option_list.o obj/detection_layer.o obj/route_layer.o obj/upsample_layer.o obj/box.o obj/normalization_layer.o obj/avgpool_layer.o obj/layer.o obj/local_layer.o obj/shortcut_layer.o obj/logistic_layer.o obj/activation_layer.o obj/rnn_layer.o obj/gru_layer.o obj/crnn_layer.o obj/demo.o obj/batchnorm_layer.o obj/region_layer.o obj/reorg_layer.o obj/tree.o obj/lstm_layer.o obj/l2norm_layer.o obj/yolo_layer.o obj/convolutional_kernels.o obj/deconvolutional_kernels.o obj/activation_kernels.o obj/im2col_kernels.o obj/col2im_kernels.o obj/blas_kernels.o obj/crop_layer_kernels.o obj/dropout_layer_kernels.o obj/maxpool_layer_kernels.o obj/avgpool_layer_kernels.o -o libdarknet.so -lm -pthread  `pkg-config --libs opencv`  -L/usr/local/cuda/lib64 -lcuda -lcudart -lcublas -lcurand -lstdc++ \r\n/usr/bin/ld: cannot find -l-L/usr/local/cuda/lib64\r\n/usr/bin/ld: cannot find -lcudart\r\n/usr/bin/ld: cannot find -lcublas\r\n/usr/bin/ld: cannot find -lcurand\r\ncollect2: error: ld returned 1 exit status\r\nMakefile:82: recipe for target 'libdarknet.so' failed\r\nmake: *** [libdarknet.so] Error 1\r\n\r\n\r\n\r\n\r\n\r\n2. My Makefile looks like this:\r\n\r\nGPU=1\r\nCUDNN=0\r\nOPENCV=1\r\nOPENMP=0\r\nDEBUG=0\r\n\r\nARCH= -gencode arch=compute_30,code=sm_30 \\\r\n      -gencode arch=compute_35,code=sm_35 \\\r\n      -gencode arch=compute_50,code=[sm_50,compute_50] \\\r\n      -gencode arch=compute_52,code=[sm_52,compute_52]\r\n#      -gencode arch=compute_20,code=[sm_20,sm_21] \\ This one is deprecated?\r\n\r\n# This is what I use, uncomment if you know your arch and want to specify\r\n# ARCH= -gencode arch=compute_52,code=compute_52\r\n\r\nVPATH=./src/:./examples\r\nSLIB=libdarknet.so\r\nALIB=libdarknet.a\r\nEXEC=darknet\r\nOBJDIR=./obj/\r\n\r\nCC=gcc\r\nNVCC=/usr/local/cuda/bin/nvcc\r\nAR=ar\r\nARFLAGS=rcs\r\nOPTS=-Ofast\r\nLDFLAGS= -lm -pthread \r\nCOMMON= -Iinclude/ -Isrc/\r\nCFLAGS=-Wall -Wno-unused-result -Wno-unknown-pragmas -Wfatal-errors -fPIC\r\n\r\nifeq ($(OPENMP), 1) \r\nCFLAGS+= -fopenmp\r\nendif\r\n\r\nifeq ($(DEBUG), 1) \r\nOPTS=-O0 -g\r\nendif\r\n\r\nCFLAGS+=$(OPTS)\r\n\r\nifeq ($(OPENCV), 1) \r\nCOMMON+= -DOPENCV\r\nCFLAGS+= -DOPENCV\r\nLDFLAGS+= `pkg-config --libs opencv` \r\nCOMMON+= `pkg-config --cflags opencv` \r\nendif\r\n\r\nifeq ($(GPU), 1) \r\nCOMMON+= -DGPU -I/usr/local/cuda/include/\r\nCFLAGS+= -DGPU\r\nLDFLAGS+= -L/usr/local/cuda/lib64 -lcuda -lcudart -lcublas -lcurand\r\nendif\r\n\r\nifeq ($(CUDNN), 1) \r\nCOMMON+= -DCUDNN \r\nCFLAGS+= -DCUDNN\r\nLDFLAGS+= -lcudnn\r\nendif\r\n\r\nOBJ=gemm.o utils.o cuda.o deconvolutional_layer.o convolutional_layer.o list.o image.o activations.o im2col.o col2im.o blas.o crop_layer.o dropout_layer.o maxpool_layer.o softmax_layer.o data.o matrix.o network.o connected_layer.o cost_layer.o parser.o option_list.o detection_layer.o route_layer.o upsample_layer.o box.o normalization_layer.o avgpool_layer.o layer.o local_layer.o shortcut_layer.o logistic_layer.o activation_layer.o rnn_layer.o gru_layer.o crnn_layer.o demo.o batchnorm_layer.o region_layer.o reorg_layer.o tree.o  lstm_layer.o l2norm_layer.o yolo_layer.o\r\nEXECOBJA=captcha.o lsd.o super.o art.o tag.o cifar.o go.o rnn.o segmenter.o regressor.o classifier.o coco.o yolo.o detector.o nightmare.o darknet.o\r\nifeq ($(GPU), 1) \r\nLDFLAGS+= -lstdc++ \r\nOBJ+=convolutional_kernels.o deconvolutional_kernels.o activation_kernels.o im2col_kernels.o col2im_kernels.o blas_kernels.o crop_layer_kernels.o dropout_layer_kernels.o maxpool_layer_kernels.o avgpool_layer_kernels.o\r\nendif\r\n\r\nEXECOBJ = $(addprefix $(OBJDIR), $(EXECOBJA))\r\nOBJS = $(addprefix $(OBJDIR), $(OBJ))\r\nDEPS = $(wildcard src/*.h) Makefile include/darknet.h\r\n\r\n#all: obj backup results $(SLIB) $(ALIB) $(EXEC)\r\nall: obj  results $(SLIB) $(ALIB) $(EXEC)\r\n\r\n\r\n$(EXEC): $(EXECOBJ) $(ALIB)\r\n\t$(CC) $(COMMON) $(CFLAGS) $^ -o $@ $(LDFLAGS) $(ALIB)\r\n\r\n$(ALIB): $(OBJS)\r\n\t$(AR) $(ARFLAGS) $@ $^\r\n\r\n$(SLIB): $(OBJS)\r\n\t$(CC) $(CFLAGS) -shared $^ -o $@ $(LDFLAGS)\r\n\r\n$(OBJDIR)%.o: %.c $(DEPS)\r\n\t$(CC) $(COMMON) $(CFLAGS) -c $< -o $@\r\n\r\n$(OBJDIR)%.o: %.cu $(DEPS)\r\n\t$(NVCC) $(ARCH) $(COMMON) --compiler-options \"$(CFLAGS)\" -c $< -o $@\r\n\r\nobj:\r\n\tmkdir -p obj\r\nbackup:\r\n\tmkdir -p backup\r\nresults:\r\n\tmkdir -p results\r\n\r\n.PHONY: clean\r\n\r\nclean:\r\n\trm -rf $(OBJS) $(SLIB) $(ALIB) $(EXEC) $(EXECOBJ) $(OBJDIR)/*\r\n\r\n\r\n\r\n\r\nI have cuda in path\"/usr/local/cuda/\". Thank you very much for helping me!"}}
{"actor":{"display_login":"wangdayan"}}