incluit / OpenVino-Driver-Behaviour

Apache License 2.0
116 stars 37 forks source link

make error #2

Closed nhadiq closed 5 years ago

nhadiq commented 5 years ago

error: iteration 1 invokes undefined behavior [-Werror=aggressive-loop-optimizations] y = abs(q(i)) + abs(e(i));


error: ‘*((void*)& v +-8)’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
                         v(j,i) = -x * s + z * c;
HernanG234 commented 5 years ago

Hi @nhadiq97,

Sorry for the delayed response, I didn't get the email (or missed it) and the project was on pause for a while. Could you fix this issue? I haven't seen it before, could you give me some info of the compilation steps that you run so I can try to reproduce it?

Sorry again and thanks for reporting the issue! We'll be working on it.

Cheers, Hernán

HernanG234 commented 5 years ago

Just checked, that's a problem in dlib. What version of gcc are you using? Are you passing any specific compilation flags apart from the already defined?

MJ410 commented 5 years ago

Hi @HernanG234 ,

I'm getting this error while i execute the make command:

Building CXX object dlib_build/dlib/CMakeFiles/dlib.dir/external/libjpeg/jdhuff.cpp.o /home/administrator/Downloads/OpenVino-Driver-Behaviour/third-party/dlib/dlib/external/libjpeg/jdhuff.cpp:23:32: error: unknown option after ‘#pragma GCC diagnostic’ kind [-Werror=pragmas]

pragma GCC diagnostic ignored "-Wshift-negative-value"

Please check and respond.

flaviojpriotti commented 5 years ago

Hi @MJ410,

Did you install the python dev package? If not, please try to do it. Also, I recommend you install python 3.6.

You could try: sudo apt install python3.6 python3.6-dev sudo apt remove python3-dev (to ensure that the other version of Python version wouldn't interfere)

You remember to delete the files generated previously inside build folder and compile again.

Please, let us know if you can run the program!

Regards, Flavio.

MJ410 commented 5 years ago

Hi @flaviojpriotti and @HernanG234 ,

Thank you for the reply.

I followed the steps suggested by you, formatted the system and reinstalled everything, but I'm still getting the below error:


Building CXX object dlib_build/dlib/CMakeFiles/dlib.dir/external/libjpeg/jdhuff.cpp.o /home/ubuntu1/OpenVino-Driver-Behaviour/third-party/dlib/dlib/external/libjpeg/jdhuff.cpp:23:32: error: unknown option after ‘#pragma GCC diagnostic’ kind [-Werror=pragmas]

pragma GCC diagnostic ignored "-Wshift-negative-value"

                            ^

cc1plus: all warnings being treated as errors dlib_build/dlib/CMakeFiles/dlib.dir/build.make:1574: recipe for target 'dlib_build/dlib/CMakeFiles/dlib.dir/external/libjpeg/jdhuff.cpp.o' failed make[2]: [dlib_build/dlib/CMakeFiles/dlib.dir/external/libjpeg/jdhuff.cpp.o] Error 1 CMakeFiles/Makefile2:193: recipe for target 'dlib_build/dlib/CMakeFiles/dlib.dir/all' failed make[1]: [dlib_build/dlib/CMakeFiles/dlib.dir/all] Error 2 Makefile:127: recipe for target 'all' failed make: *** [all] Error 2

Screenshot from 2019-07-10 15-49-34

I think when I execute the make command, all the warnings related to the dlib folder are being treated as errors and the build fails. (as shown in the above image)

Please let me know if there is a way to solve this.

Regards

flaviojpriotti commented 5 years ago

Hi again @MJ410,

Currently, what version of gcc do you have? You can update to gcc-7 apt-get install gcc-7

And, you can use update-alternatives to make it default: update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 60

Please, let me know if you can run the program. Regards, Flavio.

timlee0119 commented 5 years ago

Hi @flaviojpriotti , I got exactly the same error message as @MJ410 got when executing make. I've tried to installed python3.6, python3.6-dev, gcc-7 and set them as default, however, still not able to fix the issue. Please help to solve this. Thanks

timlee0119 commented 5 years ago

Hi @flaviojpriotti , I got exactly the same error message as @MJ410 got when executing make. I've tried to installed python3.6, python3.6-dev, gcc-7 and set them as default, however, still not able to fix the issue. Please help to solve this. Thanks

I solve this by commenting out the '#pragma GCC diagnostic ignored "Wshift-negative-value"' lines in "third-party/dlib/dlib/external/libjpeg/jdhuff.cpp" and "third-party/dlib/dlib/external/libjpeg/jdphuff.cpp" and then make again.

HernanG234 commented 5 years ago

Hi @timlee0119,

DLib compiles "its own" libjpeg, and for some reason it throws this error. We are not able to reproduce locally for the moment. Could you run this line and tell me its output?

readlink -e /usr/lib/x86_64-linux-gnu/libjpeg.so

Thanks!

HernanG234 commented 5 years ago

Okey, here's the thing. DLib has its own BLAS library which tries to compile if it can't find any of them installed (openblas, intel mkl, libblas). When this happens, it needs to compile its own libjpeg and throws the error mentioned above. There are 2 ways to solve this:

  1. Lightweight solution, install another libjpeg (on Ubuntu):

sudo apt-get install libjpeg8-dev OR sudo apt-get install libjpeg9-dev

  1. Recommended solution, install a full BLAS library as it will boost the program's performance a bit. We recommend installing Intel's MKL as it works faster and takes advantage of your Intel's hardware.

You could also install openblas:

sudo apt-get install libopenblas-dev

or libblas (untested):

sudo apt-get install libblas-dev

With that, DLib shouldn't compile the file that's causing the trouble.

Cheers!