cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Mathieeo
Observer
Observer
439 Views
Registered: ‎05-12-2020

xrfdc.h No such file or directory

Jump to solution

Hello folks,

I'm trying to use the RFDC features inside my project, which was created with Vitis, and it's simply a C/C++ project, and it's not generated from any BSP.

When I tried to include the "xrfdc. h" header, the compiler complained [xrfdc.h: No such file or directory] however, I thought the RFDC source was already included in the project. I noticed that the project only includes the gnu/aarch64 headers inside the directories by default after further investigation.

Is there a way to enable rfdc or import the source? I looked up in the Xilinx/Vitis installation folder for RFDC related files, and I found the source in this path:

[\Xilinx_2020_2\Vitis\2020.2\data\embeddedsw\XilinxProcessorIPLib\drivers\rfdc_v8_0\src]

Moreover, adding this path to the directory and building the application, the compiler complained from the metal/sys.h. This is another problem that I believe is linked to the fact that I need to configure my project to find these libraries and directories.

 

My project is configured with the following compiler and the linker:

ARM v8 Linux gcc assembler
ARM v8 Linux g++ compiler
ARM v8 Linux g++ linker

 

Thank you in advance for your attention and participation.

-Matthew
0 Kudos
1 Solution

Accepted Solutions
patocarr
Teacher
Teacher
413 Views
Registered: ‎01-28-2008

Hi @Mathieeo 

  There's a few things that need to line up to get that file xrfdc.h in your build. First of all, the firmware design needs to have the RFDC IP in the block design together with the Zynq PS. Next, you create your Petalinux project from the .xsa either from scratch or from BSP. If you're using a development board, use the BSP as it's simpler to set up. Once Petalinux builds, you need to export the SDK so it can be found from Vitis. The petalinux-build —sdk is the command, followed by petalinux-package --sysroot. The packaged sdk will be a sdk.sh script that you'll need to run that copies the SDK files to a new location, by default under images/linux/sdk. From Vitis, you must include the path to the "sysroot", which is a path under the SDK, i.e. images/linux/sdk/sysroot/aarch64-xilinx-linux/usr/include as a compiler option. You'll also need a linker option to a similar path but .../usr/lib. And add a linker miscellanea option "--sysroot=<path-to-sysroot>".

  These posts have more information:

https://forums.xilinx.com/t5/Design-and-Debug-Techniques-Blog/Vitis-Embedded-Linux-Sysroot-and-Library-usage/ba-p/1175461

https://forums.xilinx.com/t5/Embedded-Linux/sdk-applications-and-sysroot-linker-path-issue/m-p/969813

Thanks,

-Pat

 

Give kudos if helpful. Accept as solution if it solves your problem.
https://tuxengineering.com/blog

View solution in original post

2 Replies
patocarr
Teacher
Teacher
414 Views
Registered: ‎01-28-2008

Hi @Mathieeo 

  There's a few things that need to line up to get that file xrfdc.h in your build. First of all, the firmware design needs to have the RFDC IP in the block design together with the Zynq PS. Next, you create your Petalinux project from the .xsa either from scratch or from BSP. If you're using a development board, use the BSP as it's simpler to set up. Once Petalinux builds, you need to export the SDK so it can be found from Vitis. The petalinux-build —sdk is the command, followed by petalinux-package --sysroot. The packaged sdk will be a sdk.sh script that you'll need to run that copies the SDK files to a new location, by default under images/linux/sdk. From Vitis, you must include the path to the "sysroot", which is a path under the SDK, i.e. images/linux/sdk/sysroot/aarch64-xilinx-linux/usr/include as a compiler option. You'll also need a linker option to a similar path but .../usr/lib. And add a linker miscellanea option "--sysroot=<path-to-sysroot>".

  These posts have more information:

https://forums.xilinx.com/t5/Design-and-Debug-Techniques-Blog/Vitis-Embedded-Linux-Sysroot-and-Library-usage/ba-p/1175461

https://forums.xilinx.com/t5/Embedded-Linux/sdk-applications-and-sysroot-linker-path-issue/m-p/969813

Thanks,

-Pat

 

Give kudos if helpful. Accept as solution if it solves your problem.
https://tuxengineering.com/blog

View solution in original post

Mathieeo
Observer
Observer
333 Views
Registered: ‎05-12-2020

Thanks @patocarr

After exporting the sdk in the petalinux project i copied the sysroot folder over my Vitis project (Inside Windows OS) and configured the compiler and linker as the following:

Directories:
<sysroot>/aarch64-xilinx-linux\usr\include
<sysroot>/aarch64-xilinx-linux

Miscellaneous:
-c -fmessage-length=0 -MT"$@" -std=c++11 "--sysroot=sysroot/aarch64-xilinx-linux"

Libraries:
<sysroot>/aarch64-xilinx-linux\lib

 

Save and compile the project, and the compiler was able to find the xrfdc.h file but, I'm having typedef ambiguous between two headers in the sysroot directory.

Compiler output is:

sysroots/aarch64-xilinx-linux/usr/include/metal/io.h:43:5: error: reference to 'memory_order' is ambiguous

sysroots/aarch64-xilinx-linux/usr/include/c++/9.2.0/bits/atomic_base.h note: candidates are: 'typedef enum std::memory_order std::memory_order'
sysroots/aarch64-xilinx-linux/usr/include/metal/compiler/gcc/atomic.h 'typedef enum memory_order memory_order'

 

[Update] 

I fixed the problem by removing any #include <memory> for now because memory header is calling the sysroots/aarch64-Xilinx-linux/usr/include/c++/9.2.0/bits/atomic_base.h file which has a typedef similar to the one located in metal directory (mentioned above). I believe this fix is temporary; we may need to include memory in the future for unique_ptr or off_t usages. I don't know as of today how to solve this problem.

-Matthew
0 Kudos