• 0
kotra sharmila

sdsoc_opencv error

Question

hi ,

this is sharmila i installed SDx tools i am new to this.

->first time creating the project application project we need to add platform zybo is not there in platform list.

->I am tried so many methods to add custom platform for sdx 2017.4 and petalinux also 2017.4.

->and also any one share how to generate platform and creation of project in SDx guidelines in step by step.

any answer will help to me.

Thanks in advance,

K sharmila

Share this post


Link to post
Share on other sites

Recommended Posts

  • 0

hi,

this is sharmila am adding custom platform zybo_z7_20 successfully.

->and tried to run the opencv face detection project but it showing the below error i changed the libraries also can anyone helpme.

 

image.thumb.png.4bf6803d6312a32fe7e65666d58ec4a2.png 

regards ,

 sharmila

image.png

image.png

image.png

main.cpp

Share this post


Link to post
Share on other sites
  • 0

Hi @kotra sharmila,

I do not have much experience with SDSoC. I have reached out to more experience SDSoC engineers to see if they have any input for you. Please also attach the log file to better help us see what is going on.

thank you,

Jon

Share this post


Link to post
Share on other sites
  • 0

thanks for your quick reply

actually i got the below error now

 

 

09:34:45 **** Incremental Build of configuration Debug for project face_web ****
make pre-build main-build
sdsoc_make_clean Debug
 
Building target: face_web.elf
Invoking: SDS++ Linker
sds++ -L/usr/lib --remote_ip_cache /home/roash-sw-linux/Desktop/projects/ip_cache -o "face_web.elf"  ./src/main.o   -lopencv_videoio -lopencv_flann -lopencv_highgui -lopencv_core -lopencv_imgcodecs -dmclkid 0  -sds-sys-config linux -sds-proc linux -sds-pf "/home/roash-sw-linux/Desktop/SdSoC-Zybo-z7-20/SDSoC-Zybo-Z7-20-master/sdsoc/zybo_z7_20/export/zybo_z7_20"
Removing implementation files from previous run
Analyzing object files
... /home/roash-sw-linux/Desktop/projects/face_web/Debug/src/main.o
Using prebuilt hardware
Skipping block diagram (BD), address map, port information and device registration for partition 0
Prepare hardware access API functions
Create accelerator stub functions
Compile hardware access API functions
Compile accelerator stub functions
Enable generation of boot files
Compile hardware access API functions
Link application ELF file
/home/roash-sw-linux/opt/Xilinx/SDK/2017.4/gnu/aarch32/lin/gcc-arm-linux-gnueabi/bin/../lib/gcc/arm-linux-gnueabihf/6.2.1/../../../../arm-linux-gnueabihf/bin/ld: cannot find -lopencv_videoio
/home/roash-sw-linux/opt/Xilinx/SDK/2017.4/gnu/aarch32/lin/gcc-arm-linux-gnueabi/bin/../lib/gcc/arm-linux-gnueabihf/6.2.1/../../../../arm-linux-gnueabihf/bin/ld: cannot find -lopencv_flann
/home/roash-sw-linux/opt/Xilinx/SDK/2017.4/gnu/aarch32/lin/gcc-arm-linux-gnueabi/bin/../lib/gcc/arm-linux-gnueabihf/6.2.1/../../../../arm-linux-gnueabihf/bin/ld: cannot find -lopencv_highgui
/home/roash-sw-linux/opt/Xilinx/SDK/2017.4/gnu/aarch32/lin/gcc-arm-linux-gnueabi/bin/../lib/gcc/arm-linux-gnueabihf/6.2.1/../../../../arm-linux-gnueabihf/bin/ld: cannot find -lopencv_core
/home/roash-sw-linux/opt/Xilinx/SDK/2017.4/gnu/aarch32/lin/gcc-arm-linux-gnueabi/bin/../lib/gcc/arm-linux-gnueabihf/6.2.1/../../../../arm-linux-gnueabihf/bin/ld: cannot find -lopencv_imgcodecs
collect2: error: ld returned 1 exit status
ERROR: [SdsCompiler 83-5019] Exiting sds++ : Error when calling 'arm-linux-gnueabihf-g++     /home/roash-sw-linux/Desktop/projects/face_web/Debug/src/main.o /home/roash-sw-linux/Desktop/projects/face_web/Debug/_sds/swstubs/portinfo.o -L/usr/lib -lopencv_videoio -lopencv_flann -lopencv_highgui -lopencv_core -lopencv_imgcodecs   -L /home/roash-sw-linux/opt/Xilinx/SDx/2017.4/target/aarch32-linux/lib -L/home/roash-sw-linux/Desktop/projects/face_web/Debug/_sds/swstubs -Wl,--start-group  -Wl,--end-group -Wl,--start-group    -lpthread -lsds_lib -lxlnk_stub  -Wl,--end-group -o /home/roash-sw-linux/Desktop/projects/face_web/Debug/_sds/swstubs/face_web.elf'
sds++ log file saved as /home/roash-sw-linux/Desktop/projects/face_web/Debug/_sds/reports/sds.log
ERROR: [SdsCompiler 83-5004] Build failed

make: *** [face_web.elf] Error 1
makefile:45: recipe for target 'face_web.elf' failed

09:35:00 Build Finished (took 14s.913ms)

 

 

sds.log

sds_main.log

Share this post


Link to post
Share on other sites
  • 0

Hello @kotra sharmila,

From the logs that you provided I observed that you have some errors in the linking stage, some libraries cannot be found (opencv_videoio, opencv_flann, opencv_highgui, opencv_core, opencv_imgcodecs) and a warning generated by the fact that you compare a signed integer variable with an unsigned integer variable.

To solve the linking stage errors, use a xfopencv sample project as start point. Find more details in SDSoC platform readme.

Quote

*NOTE* When creating a project that uses xfopencv, it is best to always use a sample project as a starting point. The source files can be replaced with the new project's source. This is because the sample project sets up a lot of build settings like include paths, libraries, and symbols that are required for the libraries to build.

To solve the comparison warning, you can change

int i=0

to

unsigned int i=0

Let me know if you have any questions.

Share this post


Link to post
Share on other sites
  • 0

thanks for your quick reply can you please tell me how to run that project what you have attatched in sdsoc there is no cpp files .

how can i run in gui

regards

k sharmila

 

Share this post


Link to post
Share on other sites
  • 0
On 1/31/2019 at 6:25 AM, kotra sharmila said:

thanks for your quick reply can you please tell me how to run that project what you have attatched in sdsoc there is no cpp files . 

how can i run in gui 

regards

k sharmila

 

Hello,

I didn't attached any project. Do you mean the sample project that I mentioned?

Share this post


Link to post
Share on other sites
  • 0

hi,

No,I was asking about the errors above i got some clang specific error can you please help me how to clear that one.

-- i got that error for all projects like opencv ,xfopencv like that.

Regards,

K Sharmila

Share this post


Link to post
Share on other sites
  • 0

Try to use the following steps from Digilent SDSoC Platform README:

To install this platform and run the sample programs, do the following:

1. Set the SYSROOT environment variable and launch SDx. This is done in Linux by
   opening a new terminal and running:

   source /opt/Xilinx/SDx/2017.4/settings64.sh
   export SYSROOT=<extracted platform absolute path>/zybo_z7_20/sw/sysroot
   sdx
 
   In Windows, go to Start->Control Panel->System->Advanced->Environment Variables
   and create a new environment variable called SYSROOT with the value:

   <extracted platform absolute path>\zybo_z7_20\sw\sysroot

   Then launch SDx 2017.4 as normal.

2. Point to an empty directory to use as a workspace.

*NOTE* If you are also using the platform source then make sure you use a new,
       empty workspace, not the workspace with the platform generator project.
       SDx currently has a bug that breaks the ability to hardware accelerate
       functions in a platform's include path when that platform's project is
       also in the workspace.

3. In the top menu bar, click "Xilinx->Add Custom Platform..."
4. In the new window, click "Add Custom Platform..." and select the folder with
   the extracted platform (the folder this document is found in).
5. Click OK.
6. Now, in the top menu bar, click "File->New->SDx Project...".
7. Select Application Project and then press Next.
8. Name the project and press Next.
9. Select zybo_z7_20 and click Next.
10. Select Linux from the System Configuration drop-down.
11. Click Next, no other options should need to be changed on this page.
12. Select a sample application to run and click finish to create the project.

*NOTE* When creating a project that uses xfopencv, it is best to always use a
       sample project as a starting point. The source files can be replaced with
       the new project's source. This is because the sample project sets up a
       lot of build settings like include paths, libraries, and symbols that are
       required for the libraries to build.

13. Click the hammer button to build the project. This can take between 5-30 min
    on typical host machines.

If the build process is successful, using a sample project, your system is set correctly. Let me know if you encounter any issues using the above mentioned steps.

From this point you can try to replace the sources from the sample project with your code and try to build again.

Share this post


Link to post
Share on other sites
  • 0

hi,

am following the above steps and created the sample project with default SDx example vector add its worked properly and created binaries , elf and all.

but am going for next step copy the src files from that revision pcam5 project sources and runned it showing the same error.

what can i do...

Workspace 1_057.png

Share this post


Link to post
Share on other sites
  • 0

Close SDx and run the following commands in a terminal:

source /opt/Xilinx/SDx/2017.4/settings64.sh 
export SYSROOT=<extracted platform absolute path>/zybo_z7_20/sw/sysroot

After that, run

sdx

in the same terminal window and try to build the project again.

Share this post


Link to post
Share on other sites
  • 0

The absolute path to a file or directory is specified from the root directory (/). In your case:

/home/roash-sw-linux/path_to_the_folder_which_contains_the_downloaded_platform/zybo_z7_20/sw/sysroot

 

Share this post


Link to post
Share on other sites
  • 0

Hi,

am encouter with new error previous errors was gone like i changed to test platform for same project there only like zc702,701,zed,701 again i came to zybo .

->previous errors was gone but these errors related to program ??

Workspace 1_070.png

Share this post


Link to post
Share on other sites
  • 0
20 minutes ago, kotra sharmila said:

no sdx sample project build perfectly ,

I am confused. In this post you mentioned you were able to successfully build the default SDx example vector add project.

Quote

this project i downloded fron revision github and tried not my own project

Can you provide the link to the github project you are referring to?

Share this post


Link to post
Share on other sites
  • 0

Hi ,

it means it worked and build successfull for vec add (sdx examples) alredy there in samples.

-->but the above error got for another project (am creting empty project and copied the src in live i/o project)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now