elucideye / acf

Aggregated Channel Feature object detection in C++ and OpenGL ES 2.0 based on https://github.com/pdollar/toolbox
BSD 3-Clause "New" or "Revised" License
49 stars 20 forks source link

ogles_gpgpu compile error #98

Closed FFFFFUNKYMUZIK closed 6 years ago

FFFFFUNKYMUZIK commented 6 years ago

Hello, I'm trying to compile this project in my local Ubuntu 14.04, but I suffered from the compile error.

I'm not friendly with hunter as well, I want you to figure out what causes these problems.

On project root directory first I enter the following on the console: source ./bin/acf/hunter_env.sh and next: polly.py --config Debug --install --verbose for compiling it with default native compiler(gcc, g++ 4.8.4) on my ubuntu.

compile is processing on openCV and other sub projects, but It ended at ogles_gpgpu and FAIL with following grammer error messages:

proc/base/filterprocbase.h:114:47: error: ‘nullptr’ was not declared in this scope const char* fragShaderSrcForCompilation = nullptr; // used fragment shader source for shader compilation

proc/base/procbase.h:164:65: error: ISO C++ forbids declaration of ‘delegate’ with no type [-fpermissive] virtual void getResultData(const FrameDelegate& delegate = {}, int index = 0) const;

proc/base/procbase.cpp:111:5: error: ‘fbo’ was not declared in this scope fbo->readBuffer(data, index); ^ there are plenty of error messages like these. What should I do for these problems?

headupinclouds commented 6 years ago

You need to use a C++11 compiler. I believe 4.8 implements most of C++11, but you need to specify a toolchain in order to enable that with -std=c++11

https://stackoverflow.com/a/29984837

I think that will work. In general it will be better to use g++-5, which is tested in the CI config. Here are two examples of gcc w/ C++11 toolchains that should work:

FFFFFUNKYMUZIK commented 6 years ago

Thank you for your support!!!

Actually I compiled with gcc-4-8-c11 compiler right after post this issue, but there's some build issues. It fails at building libprotobuf, error log is like following:

[ 21%] Built target libprotobuf make[4]: Leaving directory ~/.hunter/_Base/e7fe3f0/596fe5f/a0274a8/Build/OpenCV/Build/OpenCV-Release-prefix/src/OpenCV-Release-build' make[3]: *** [all] Error 2 make[3]: Leaving directory~/.hunter/_Base/e7fe3f0/596fe5f/a0274a8/Build/OpenCV/Build/OpenCV-Release-prefix/src/OpenCV-Release-build' make[2]: Leaving directory ~/.hunter/_Base/e7fe3f0/596fe5f/a0274a8/Build/OpenCV/Build' make[1]: Leaving directory~/.hunter/_Base/e7fe3f0/596fe5f/a0274a8/Build/OpenCV/Build' make[2]: [OpenCV-Release-prefix/src/OpenCV-Release-stamp/OpenCV-Release-build] Error 2 make[1]: [CMakeFiles/OpenCV-Release.dir/all] Error 2 make: *** [all] Error 2

[hunter FATAL ERROR ] Build step failed (dir: ~/.hunter/_Base/e7fe3f0/596fe5f/a0274a8/Build/OpenCV [hunter FATAL ERROR ] [Directory:~/.hunter/_Base/Download/Hunter/0.22.8/e7fe3f0/Unpacked/cmake/projects/OpenCV]

(Home directory is mannually edited as ~) When I use g++-5 compiler, it success without any compile issue. Thanks a lot!

headupinclouds commented 6 years ago

👍

The opencv protobuf dependency fails on several not-quite-latest compilers for some reason. It isn't required for acf and another fix would be just to exclude it from the OpenCV dependency list in the LOCAL config, although g++-5 is probably a better/easier fix.