sowson / darknet

Darknet on OpenCL Convolutional Neural Networks on OpenCL on Intel & NVidia & AMD & Mali GPUs for macOS & GNU/Linux & Windows & FreeBSD
http://pjreddie.com/darknet/
Other
187 stars 31 forks source link

Cannot compile libdarknet.so #70

Closed rcastill closed 2 years ago

rcastill commented 3 years ago

When using makefile:

make -j8
...
make: *** No rule to make target 'obj/gaussian_yolo4_layer.o', needed by 'libdarknet.so'.  Stop.
rcastill commented 3 years ago

Fails as well with cmake build:

make[2]: *** No rule to make target '/opt/AMDAPPSDK-3.0/lib/x86_64/libOpenCL.so', needed by 'liblibdarknet.so'.  Stop
sowson commented 3 years ago

try

git pull && make -j8

is ok now?

rcastill commented 3 years ago

Almost:

It fixed that error, and this one appeared:

/usr/bin/ld: /usr/local/lib/libOpenCL.a(libopencl.c.o): undefined reference to symbol 'dlclose@@GLIBC_2.2.5'

I tried changing:

ifeq ($(ARM), 1)
LDFLAGS= -lm -lpthread
else
LDFLAGS= -lm -lz -lpthread
endif

to

ifeq ($(ARM), 1)
LDFLAGS= -ldl -lm -lpthread
else
LDFLAGS= -ldl -lm -lz -lpthread
endif

but it didn't work.

The solution was to add -ldl after -lOpenCL (in my case, for GPU=1 AMD=1):

LDFLAGS+= -L/usr/lib/x86_64-linux-gnu/ -lOpenCL -ldl -lclBLAS -L/usr/local/lib
sowson commented 2 years ago

Thanks to find a solution!