prabindh / darknet

Convolutional Neural Networks
http://pjreddie.com/darknet/
Other
122 stars 46 forks source link

darknet-cpp compilation failed on Ubuntu 16.04 #67

Closed ooobelix closed 6 years ago

ooobelix commented 6 years ago

Hi,

my goal is to build CPP Darknet thanks "make darknet-cpp" on Ubuntu 16.04 with latest version v6.4 but:

./examples/classifier.c:682:26: error: invalid conversion from ‘void’ to ‘int’ [-fpermissive] int *indexes = calloc(top, sizeof(int));

I can see in the logs that I compiling with c++0x

... g++ -Iinclude/ -Isrc/ -DOPENCV pkg-config --cflags opencv -DGPU -I/usr/local/cuda/include/ -DCUDNN -Wno-write-strings -std=c++0x -Wall -Wno-unused-result -Wno-unknown-pragmas -Wfatal-errors -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -c ./src/cost_layer.c -o obj-cpp/cost_layer.o ...

But as you have said:

Note: darknet-cpp requires a C++11 compiler for darknet-cpp, and arapaho builds.

So I modify the Makefile as follow without success, same issue:

--CFLAGS=-Wall -Wno-unused-result -Wno-unknown-pragmas -Wfatal-errors -fPIC ++CFLAGS=-std=c++11 -Wall -Wno-unused-result -Wno-unknown-pragmas -Wfatal-errors -fPIC

Finaly I modify examples/classifier.c as follow and it works better:

-- int indexes = calloc(top, sizeof(int)); ++ //int indexes = calloc(top, sizeof(int)); ++ int indexes = (int ) malloc(sizeof(int)*top);

But it failed on this:

darknet.c:(.text.startup+0x39a) : undefined reference to « run_isegmenter(int, char**) »

Thanks in advance

prabindh commented 6 years ago

Last update on Linux front was this commit - https://github.com/prabindh/darknet/commit/01365fbea88b461f19715fdbadc6dbe89f5573a4

The later updates were on Windows, hence Linux build is broken. Let me fix it.

prabindh commented 6 years ago

The corresponding tag for the last Linux build was v6.2.

prabindh commented 6 years ago

@ooobelix Please check latest master that resolves this, and also moves to latest mainline code. I will do more checks on the latest build soon.

ooobelix commented 6 years ago

Hi @prabindh, thanks for your job and fixes! Compilation under Ubuntu 16.04 on v6.5-1-g372b25d is working.

I have some questions:

Thanks again for your job!

prabindh commented 6 years ago

On below - this is a merge issue, will update.

ooobelix commented 6 years ago

Ok. Thanks again for your job!