UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Scholar beandigital
Scholar
1,360 Views
Registered: ‎04-27-2010

Compiling an app in SDK with missing libs

I have created an empty Linux project in SDK 2018.2. I am running SDK in Windows 10. I am using a file that has the following libs

 

#include <unistd.h>
#include <fcntl.h>
#include <libudev.h>

When I try and compile I get warnings on the first two and an error on the last. How would I resolve this? Do I need to get the include files and then point to them? Trouble is that I am working in Windows and these are Linux files. Thanks

0 Kudos
11 Replies
Moderator
Moderator
1,325 Views
Registered: ‎04-24-2017

Re: Compiling an app in SDK with missing libs

Hi @beandigital,

 

XSDK doesn't provide all the linux package libraries to use in applications now you have two options.

 

  1. Build the petalinux sdk(petalinux-build --sdk) and then use the libraries using XSDK
  2. Create applications using recipes and include all the build dependency libraries and packages.
Thanks,
Sandeep
PetaLinux Yocto | Embedded SW Support

---------------------------------------------------------------------------
Don’t forget to Reply, Kudo, and Accept as Solution.
---------------------------------------------------------------------------
0 Kudos
Scholar beandigital
Scholar
1,319 Views
Registered: ‎04-27-2010

Re: Compiling an app in SDK with missing libs

Hi @sandeepg

 

I am a bit confused :). I have Vivado and SDK on my Win 10 machine. I then have a VM running Ubuntu that has Petalinux on it. I have got Linux running on my board and managed to create a Hello World in SDK (on Win 10) that I can run on the board. So do I need to run SDK on Ubuntu to get the libs working? Or can I do something to use the libs with SDK on Win 10?

Thanks

0 Kudos
Moderator
Moderator
1,312 Views
Registered: ‎09-12-2007

Re: Compiling an app in SDK with missing libs

Ok, so the flow you would use is (as Sandeep mentioned) in Petalinux to generate the sysroots is:

  • petalinux-build --sdk
  • petalinux-package --sysroot
    • This will place the sysroots folder in the images/linux folder in your petalinux project directory

 

If you are using the SDK in Windows, then you would need to copy this folder (sysroots) local to your windows machine

Then to create a Linux Application in SDK:

 

File -> New -> Application Project

In the Linux System Root point to the aarch64-xilinx-linux folder (assuming this is Zynq Ultrascale):

linux_app.PNG

 

Then either use the Hello World template, or Empty application and import your source code.

 

Right click on your application, and add the --sysroot Linker flag:

linker_flags.PNG

 

Then add any supporting libraries (for example here I am using the RFDC so I needed the libmetal, and rfdc and math libs):

libs.PNG

 

Let me know if this helps?

0 Kudos
Scholar beandigital
Scholar
1,308 Views
Registered: ‎04-27-2010

Re: Compiling an app in SDK with missing libs

Thanks for the explanation, I will give it a go and let you know,
0 Kudos
Scholar beandigital
Scholar
1,266 Views
Registered: ‎04-27-2010

Re: Compiling an app in SDK with missing libs

When I try to copy the sysroots folder I get errors :-

There was an error copying the file into /mnt/hgfs/Shared/sysroots/x86_64-petalinux-linux/lib.

error making symbolic link operation not supported

 

0 Kudos
Scholar beandigital
Scholar
1,251 Views
Registered: ‎04-27-2010

Re: Compiling an app in SDK with missing libs

I seemed to have solved the problem by just zipping the dir. I have created a new project and added the path of the sysroot. But I am still having issues with some header files. I am trying to use <linux/dma-mapping.h> but it cant find it.
0 Kudos
Scholar beandigital
Scholar
1,240 Views
Registered: ‎04-27-2010

Re: Compiling an app in SDK with missing libs

Does nobody know how to fix this problem? If I look in my project directory for the Linux project the files seem to be there. Also if I create a new project using the SDK, it says that the sysroot dir should be ../sysroot/stage. But there isnt a stage directory. 

0 Kudos
Highlighted
Newbie milessmith
Newbie
1,036 Views
Registered: ‎10-13-2018

Re: Compiling an app in SDK with missing libs

i was  facing the same problem. but now Thank you so much for this. I was into this issue and tired to tinker around to check if its possible but couldnt get it done. Now that i have seen the way you did it, thanks guys
with
regards

0 Kudos
Observer russellsnow
Observer
997 Views
Registered: ‎09-17-2018

Re: Compiling an app in SDK with missing libs

Petalinux --sdk always fails

 Cloning into '/scratch/rds/projs/desperate_try3/build/tmp/work/x86_64-nativesdk-petalinux-linux/nativesdk-qemu-xilinx/v2.11.0-xilinx-v2018.1+gitAUTOINC+1d5516986e-r0/git/capstone'...
|   GEN     hw/mem/trace.h
| fatal: Unable to look up git.qemu.org (port 9418) (Name or service not known)
| fatal: clone of 'git://git.qemu.org/capstone.git' into submodule path '/scratch/rds/projs/desperate_try3/build/tmp/work/x86_64-nativesdk-petalinux-linux/nativesdk-qemu-xilinx/v2.11.0-xilinx-v2018.1+gitAUTOINC+1d5516986e-r0/git/capstone' failed
| Failed to clone 'capstone'. Retry scheduled
| Cloning into '/scratch/rds/projs/desperate_try3/build/tmp/work/x86_64-nativesdk-petalinux-linux/nativesdk-qemu-xilinx/v2.11.0-xilinx-v2018.1+gitAUTOINC+1d5516986e-r0/git/ui/keycodemapdb'...
|   GEN     hw/i386/trace.h
| fatal: Unable to look up git.qemu.org (port 9418) (Name or service not known)
| fatal: clone of 'git://git.qemu.org/keycodemapdb.git' into submodule path '/scratch/rds/projs/desperate_try3/build/tmp/work/x86_64-nativesdk-petalinux-linux/nativesdk-qemu-xilinx/v2.11.0-xilinx-v2018.1+gitAUTOINC+1d5516986e-r0/git/ui/keycodemapdb' failed
| Failed to clone 'ui/keycodemapdb'. Retry scheduled
|   GEN     hw/i386/xen/trace.h
| Cloning into '/scratch/rds/projs/desperate_try3/build/tmp/work/x86_64-nativesdk-petalinux-linux/nativesdk-qemu-xilinx/v2.11.0-xilinx-v2018.1+gitAUTOINC+1d5516986e-r0/git/capstone'...
| fatal: Unable to look up git.qemu.org (port 9418) (Name or service not known)
| fatal: clone of 'git://git.qemu.org/capstone.git' into submodule path '/scratch/rds/projs/desperate_try3/build/tmp/work/x86_64-nativesdk-petalinux-linux/nativesdk-qemu-xilinx/v2.11.0-xilinx-v2018.1+gitAUTOINC+1d5516986e-r0/git/capstone' failed
| Failed to clone 'capstone' a second time, aborting
| ./scripts/git-submodule.sh: failed to update modules
|
| Unable to automatically checkout GIT submodules ' ui/keycodemapdb capstone'.
| If you require use of an alternative GIT binary (for example to
| enable use of a transparent proxy), then please specify it by
| running configure by with the '--with-git' argument. e.g.
|
|  $ ./configure --with-git='tsocks git'
|
| Alternatively you may disable automatic GIT submodule checkout
| with:
|
|  $ ./configure --disable-git-update'
|
| and then manually update submodules prior to running make, with:
|
|  $ scripts/git-sbumodule.sh update  ui/keycodemapdb capstone
|
|   GEN     hw/9pfs/trace.h
| make: *** [Makefile:39: git-submodule-update] Error 1

0 Kudos
Moderator
Moderator
816 Views
Registered: ‎04-24-2017

Re: Compiling an app in SDK with missing libs

Hi @russellsnow,

 

The qemu nativesdk errors are due to your network proxy settings are not configure please check your proxy settings.

Thanks,
Sandeep
PetaLinux Yocto | Embedded SW Support

---------------------------------------------------------------------------
Don’t forget to Reply, Kudo, and Accept as Solution.
---------------------------------------------------------------------------
0 Kudos
Visitor chcase
Visitor
514 Views
Registered: ‎01-08-2019

Re: Compiling an app in SDK with missing libs

Are there any options for this error if I don't have any network access on the build machine?

0 Kudos