XRT icon indicating copy to clipboard operation
XRT copied to clipboard

Fix build issues when creating deb packages

Open hkhonming opened this issue 2 years ago • 16 comments

Problem solved by the commit

Fixed build failures for build_deb_edge.sh

How problem was solved, alternative solutions (if any) and why they were rejected

  1. debian packaging skills is outdated and I just synchronise it with the latest packaging script
  2. Fix the bug in dkms-edge.cmake introduced after the removal of cu_plram.c
  3. Update to build on jammy by default

Risks (if any) associated the changes in the commit

Most changes are specific to debian packaging and so it should be safe for other usage. The dkms-edge.cmake is an obvious bug after a removal of the cu_plram.c and so the fix is pretty straightforward too.

What has been tested and how, request additional testing if necessary

Tested to generate .deb file in 2022.1 branch head. If we need to cherrypick the change to master branch. Probably we need to test it too since I am not sure if there are other changes in master branch that require packaging script change.

Documentation impact (if any)

If there are document on how to create .deb files. We should update it and remove the need of the sysroot, as well as mentioning we are building jammy by default now.

hkhonming avatar Sep 07 '22 16:09 hkhonming

Can one of the admins verify this patch?

gbuildx avatar Sep 07 '22 16:09 gbuildx

ok to test

chvamshi-xilinx avatar Sep 07 '22 18:09 chvamshi-xilinx

Build Failed! :(

gbuildx avatar Sep 07 '22 18:09 gbuildx

retest this please.

dayeh-xilinx avatar Sep 07 '22 20:09 dayeh-xilinx

Build Failed! :(

gbuildx avatar Sep 07 '22 20:09 gbuildx

@stsoe During the enablement in jammy, the latest version of XRT packaged is 2.13.466. As far as I know it should be coming from the 2022.1 branch

hkhonming avatar Sep 08 '22 09:09 hkhonming

Build Failed! :(

gbuildx avatar Sep 08 '22 09:09 gbuildx

retest this please.

dayeh-xilinx avatar Sep 08 '22 18:09 dayeh-xilinx

Build Failed! :(

gbuildx avatar Sep 08 '22 21:09 gbuildx

retest this please.

dayeh-xilinx avatar Sep 08 '22 22:09 dayeh-xilinx

Build Passed!

gbuildx avatar Sep 09 '22 06:09 gbuildx

Build Passed!

gbuildx avatar Sep 09 '22 09:09 gbuildx

Hi @hkhonming, one query did you use cross compilation for testing this? (host - x64 or amd64) because when I tested on amd64 host it fails if I don't provide sysroot

rbramand-xilinx avatar Sep 11 '22 13:09 rbramand-xilinx

@rbramand-xilinx The original script depends on the setup of sbuild chroot & the xilinx sysroot. I am removing the sysroot since XRT itself actually just depends on standard libraries. In this case, you will still need to setup a standard sbuild chroot in arm64 architecture.

hkhonming avatar Sep 12 '22 00:09 hkhonming

@rbramand-xilinx The original script depends on the setup of sbuild chroot & the xilinx sysroot. I am removing the sysroot since XRT itself actually just depends on standard libraries. In this case, you will still need to setup a standard sbuild chroot in arm64 architecture.

@hkhonming I am confused, you are saying that sbuild chroot in arm64 is needed but removed sysroot option, how does that work? Also we would like to do cross compilation mostly, so we need to provide sysroot flag right?

rbramand-xilinx avatar Sep 12 '22 05:09 rbramand-xilinx

@rbramand-xilinx The original script depends on the setup of sbuild chroot & the xilinx sysroot. I am removing the sysroot since XRT itself actually just depends on standard libraries. In this case, you will still need to setup a standard sbuild chroot in arm64 architecture.

@hkhonming I am confused, you are saying that sbuild chroot in arm64 is needed but removed sysroot option, how does that work? Also we would like to do cross compilation mostly, so we need to provide sysroot flag right?

The original setup used sbuild-createchroot to pull the sysroot to the chroot environment. Since there are no specific dependencies on Xilinx packages. You can just use normal mk-sbuild jammy/focal --arch=arm64 to create the chroot. Then sbuild should be able to build XRT through qemu.

Ref: https://packaging.ubuntu.com/html/setting-up-sbuild.html

hkhonming avatar Sep 12 '22 11:09 hkhonming

I am confused. 2022.1 did not support jammy. Is this meant for master?

I was just about asking the same. Is there someone expected to also add some documentation about how to use this?

keryell avatar Oct 31 '22 18:10 keryell

Hi, I will send a fresh PR for master and address comments on this PR. This PR is mainly for Edge platforms. Regarding documentation, at present we are using this internally and I will create a confluence page with steps on creating packages using the script. We can add the steps to XRT docs based on marketing ask

rbramand-xilinx avatar Nov 01 '22 14:11 rbramand-xilinx

Hi, I will send a fresh PR for master and address comments on this PR. This PR is mainly for Edge platforms. Regarding documentation, at present we are using this internally and I will create a confluence page with steps on creating packages using the script. We can add the steps to XRT docs based on marketing ask

This is open-source code and we need also some documentation on how to build this on Edge platforms. This is what we are looking at right now on our ZCU102. Why a new PR? Just go on working on it. Globally open-sourcing tends to increase the software quality. @Ralender: could you add your perl issues here?

keryell avatar Nov 01 '22 15:11 keryell

@Ralender: ping.

keryell avatar Nov 08 '22 18:11 keryell

Hi @hkhonming , You can close this PR as https://github.com/Xilinx/XRT/pull/7148 is merged to master XRT, Users can use master XRT branch to build debian packages.

chvamshi-xilinx avatar Nov 15 '22 10:11 chvamshi-xilinx

Supersede by https://github.com/Xilinx/XRT/pull/7148

hkhonming avatar Nov 15 '22 10:11 hkhonming