Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile errors building camera_sobel #24

Open
kutenai opened this issue Apr 22, 2020 · 2 comments
Open

Compile errors building camera_sobel #24

kutenai opened this issue Apr 22, 2020 · 2 comments

Comments

@kutenai
Copy link

kutenai commented Apr 22, 2020

Greetings. I'm trying to compile the camera_sobel, but getting compile errors.

I've tried using the 17.1 and 18.1 build tools versions, but I get the same error for both

edhenderson@ubuntu:~/proj/machine_learning/c5soc_opencl/application/camera_sobel$ make
arm-linux-gnueabihf-g++   -Wall -std=c++11 -O2 -c host/src/video.cpp -o host/src/video.o -I/home/edhenderson/intelFPGA/17.1/hld/host/include   -Ihost/inc  -I../common/inc  -I/usr/include/SDL2  -DFPGA_DEVICE 
host/src/video.cpp: In function ‘void video_set_format()’:
host/src/video.cpp:86:20: error: invalid conversion from ‘__u32 {aka unsigned int}’ to ‘v4l2_buf_type’ [-fpermissive]
  video.format.type = stream_flag;
                    ^
host/src/video.cpp: In function ‘void buffer_request()’:
host/src/video.cpp:156:24: error: invalid conversion from ‘__u32 {aka unsigned int}’ to ‘v4l2_buf_type’ [-fpermissive]
  video.buffer.req.type = stream_flag;
                        ^
Makefile:118: recipe for target 'host/src/video.o' failed
make: *** [host/src/video.o] Error 1
edhenderson@ubuntu:~/proj/machine_learning/c5soc_opencl/application/camera_sobel$ 

Do I need to go back to 16.x?? I'd really prefer to move forward of course. My next step is to start digging into the libraries and include files and see if I can track down the source of the error. I'm kind of thinking this is a version issue, but without more experience with OpenCL, it will take me some time to track this down.

Any advice or assistance would be much appreciated

@kutenai
Copy link
Author

kutenai commented Apr 23, 2020

I was able to fix the above issues by modifying video.cpp

//static int stream_flag = V4L2_BUF_TYPE_VIDEO_CAPTURE;
static v4l2_buf_type stream_flag = V4L2_BUF_TYPE_VIDEO_CAPTURE;

Next, I found an issue with missing files
#include <SDL2/SDL.h>

I am working on Ubuntu, so I found I could install sdr2 using apt-get. Of course, I'm pretty sure that isn't going to work since the compiler would try and build against the "ubuntu" library, but I'm cross compiling... so not I'm stuck. I did try and add the /usr/include directory to load SDR, but then it has an issue finding immintrin.h. I found this in the directory
~/intelFPGA/18.1/embedded/ds-5/sw/ARMCompiler6.10.1/lib/clang/7.0.0/include/, but then I get a ton of other errors, so, obviously, I have incompatible libraries

Can you help with information about how your environment was set up to build these applications??

@kutenai
Copy link
Author

kutenai commented Apr 23, 2020

Okay, I found a way to do this, but it's a bit hacky. I'm copying the /usr/include and /usr/lib paths from the arm core and using them for cross compiling. I should be able to download this though right??

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant