# PYNQ2.7 Custom Board Build Error - PYNQ\_SDIST

**URL:** <https://discuss.pynq.io/t/pynq2-7-custom-board-build-error-pynq-sdist/5150>\
**Category:** Support\
**Created:** [January 26, 2023, 5:40pm UTC](https://discuss.pynq.io/t/pynq2-7-custom-board-build-error-pynq-sdist/5150 "2023-01-26T17:40:54Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![osama-usuf](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/osama-usuf/32/3884_2.png) [@osama-usuf](https://discuss.pynq.io/u/osama-usuf)\
**Post date:** [January 26, 2023, 5:40pm UTC](https://discuss.pynq.io/t/pynq2-7-custom-board-build-error-pynq-sdist/5150/1 "2023-01-26T17:40:54Z")

</div>

Hi all,

I am attempting to build an image for PYNQ 2.7 for a custom board.

I am using the `image_v2.7` branch on the GitHub repository.

I have the correct version of tools setup (2020.2 with the y2k22 patch), and I am providing `PYNQ_SDIST` as well as `PREBUILT` variables to the make command as follows:

`make PYNQ_SDIST=/home/Osama/prebuilt/pynq-2.7.0.tar.gz PREBUILT=/home/Osama/prebuilt/focal.arm.2.7.0_2021_11_17.tar.gz BOARDDIR=/home/Osama/PYNQ/boards/ BOARDS=7z045`

My .spec file looks like the following:

```auto
ARCH_7z045 := arm
BSP_7z045 := 
FPGA_MANAGER_7z045 := 0
STAGE4_PACKAGES_7z045 := xrt pynq ethernet pynq_peripherals precached_metadata

```

My board directory contains an .xsa file in `petalinux_bsp/hardware_project` directory, which the build flow should utilize for the bitstream and base PetaLinux project (from what I understand).

The issue I’m facing is that the build flow attempts to rebuild bitstreams for all boards. I found that this happens when the PYNQ source distribution is being re-compiled, but this shouldn’t happen since I am providing the path to the correct `PYNQ_SDIST` file.

Taking a look at the makefile present on the `image_v2.7` branch, I do not see the `PYNQ_SDIST` term defined anywhere. Am I supposed to use some different makefile in order to use that functionality?

---

<div class="post-metadata">

**Author:** ![briansune](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/briansune/32/3087_2.png) [@briansune](https://discuss.pynq.io/u/briansune)\
**Post date:** [January 26, 2023, 6:43pm UTC](https://discuss.pynq.io/t/pynq2-7-custom-board-build-error-pynq-sdist/5150/2 "2023-01-26T18:43:14Z")

</div>

@osama-usuf

Are you sure you read the build guide?

> **[PYNQ SD Card image — Python productivity for Zynq (Pynq)](https://pynq.readthedocs.io/en/v2.7.0/pynq_sd_card.html)**

Make sure yourself read the:

### Using the prebuilt board-agnostic image

### Re-use the PYNQ source distribution tarbal

If you understand the following guide I cannot see this will be the question you are referring.

Enjoy~

---

<div class="post-metadata">

**Author:** ![osama-usuf](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/osama-usuf/32/3884_2.png) [@osama-usuf](https://discuss.pynq.io/u/osama-usuf)\
**Post date:** [January 26, 2023, 7:23pm UTC](https://discuss.pynq.io/t/pynq2-7-custom-board-build-error-pynq-sdist/5150/3 "2023-01-26T19:23:06Z")

</div>

Yes, I have gone through that documentation. I want to re-use the PYNQ source distribution tarbal that is provided on the PYNQ website for the 2.7 version, and I am following the steps as mentioned in the documentation.

I do not want to build bitstreams for the other boards (PYNQ-Z1, Z2, etc.), and so I am trying to directly use the PYNQ\_SDIST parameter. Even after adding this parameter and pointing to the right directory, the make script attempts to rebuild bitstreams for the other boards, whereas it should NOT do this if I understand everything correctly.

I would greatly appreciate if others in this forum could guide as well.

---

<div class="post-metadata">

**Author:** ![briansune](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/briansune/32/3087_2.png) [@briansune](https://discuss.pynq.io/u/briansune)\
**Post date:** [January 27, 2023, 7:46am UTC](https://discuss.pynq.io/t/pynq2-7-custom-board-build-error-pynq-sdist/5150/4 "2023-01-27T07:46:43Z")

</div>

@osama-usuf

As yourself mentioned you had read carefully:  
So I cannot see the build script nor the tarball is faulty.

### Re-use the PYNQ source distribution tarball

To avoid rebuilding the PYNQ source distribution package, and consequently bypass the need to build bitstreams (except for external boards) and MicroBlazes’ bsps and binaries, a prebuilt PYNQ sdist tarball can be reused by specifying the `PYNQ_SDIST` variable when invoking make. The tarball specific to the target PYNQ version will be distributed when a new version is released on [GitHub](https://github.com/Xilinx/PYNQ/releases).

cd /sdbuild/  
make PYNQ\_SDIST=

Please also refer to the [sdbuild readme](https://github.com/Xilinx/PYNQ/blob/master/sdbuild/README.md) on our GitHub repository for more info regarding the image-build flow.

Enjoy

---

<div class="post-metadata">

**Author:** ![osama-usuf](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/osama-usuf/32/3884_2.png) [@osama-usuf](https://discuss.pynq.io/u/osama-usuf)\
**Post date:** [January 27, 2023, 6:20pm UTC](https://discuss.pynq.io/t/pynq2-7-custom-board-build-error-pynq-sdist/5150/5 "2023-01-27T18:20:22Z")

</div>

I found all of this in the documentation already, and it still attempts to build bitstreams for the default boards, which is why I created this thread.

Could you try running the script on your end on a fresh clone of the image\_v2.7 branch for some custom board? It will still attempt to rebuild the bitstreams, even after the PYNQ\_SDIST variable is pointing to the correct prebuilt PYNQ source distribution file.

---

<div class="post-metadata">

**Author:** ![briansune](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/briansune/32/3087_2.png) [@briansune](https://discuss.pynq.io/u/briansune)\
**Post date:** [January 27, 2023, 7:19pm UTC](https://discuss.pynq.io/t/pynq2-7-custom-board-build-error-pynq-sdist/5150/6 "2023-01-27T19:19:14Z")

</div>

@osama-usuf

The guide is referring A | B NOT A & B.  
While the board you are using is custom so modulator also have no obligation to make it able to build.  
While I had compile xc7z100 custom board successfully (MANY TIMES).  
Using make Prebuilt=XXXX BOARDS=XXXX

Build guide 2.7 & 3.0:

> [@Stuck at extract yocoto](https://discuss.pynq.io/t/stuck-at-extract-yocoto/4134/8):
>
> Unless people having hard time on setting up the environment: Vagrant is not a good method to setup the SD build environment. I have not investigate to the bottom but what previous engineer shows there might Virtual R/W issue during such setup. STEPS: I will suggest download 18.04.06 LTS Ubuntu from official website Create a virtual disk size about 200GB or more, set the CPU \>#4, RAM \>#8192 Update Ubuntu packages before setting up the PYNQ 3b) Git clone the PYNQ to /home//PYNQ 3c) sudo ch…

> [@PYNQ 3.0.1 VirtualBox install and SD build](https://discuss.pynq.io/t/pynq-3-0-1-virtualbox-install-and-sd-build/4859):
>
> Thank you PYNQ development team to releasing new 3.0.1 PYNQ. In this custom board build guide the PetaLinux, Vivado, Vitis are using version 2022.1 aka kernel 5.15. The NEW build environment setup script solved most issue when PYNQ 2.7 environment faced but there are still some issue need to take care. Let’s recall the old PYNQ 2.7 install guide: It is good to know the installation of PetaLinux and the environment setup script are almost the same as the attached PYNQ 2.7 install guide on Virt…

@stf  
Could help a bit a better explanation about the TWO make command.

Thank you

---

<div class="post-metadata">

**Author:** ![pynqzen](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/pynqzen/32/97_2.png) [@pynqzen](https://discuss.pynq.io/u/pynqzen)\
**Post date:** [January 28, 2023, 2:53am UTC](https://discuss.pynq.io/t/pynq2-7-custom-board-build-error-pynq-sdist/5150/7 "2023-01-28T02:53:27Z")

</div>

Hi Osama,

There are a couple ways you can do this, I can’t recall with v2.7 if you could just empty all contents of build.sh (found under the PYNQ git repo).

Back then before I knew about clearing the contents I would just git rm -rf the board folders under PYNQ\_REPO\_ROOT/boards/ .

You will need to do a local commit of those changes because when PYNQ builds it re-clones what you have local. If you don’t commit the changes it will ignore them and use the last true commit.

It’s the same game for the Ultra96 PYNQ builds. I didn’t want to wait to have Vivado build a bunch of unused bitstreams. You can look at the build96.sh script, it is simple. [GitHub - Avnet/Ultra96-PYNQ: Board files to build Ultra 96 PYNQ image](https://github.com/Avnet/Ultra96-PYNQ). See the image\_v2.7 branch and v3.0, currently the latest commit for the master branch is v3.0.

Cheers!

---

<div class="post-metadata">

**Author:** ![marioruiz](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/marioruiz/32/2177_2.png) [@marioruiz](https://discuss.pynq.io/u/marioruiz)\
**Post date:** [January 30, 2023, 9:42am UTC](https://discuss.pynq.io/t/pynq2-7-custom-board-build-error-pynq-sdist/5150/8 "2023-01-30T09:42:29Z")

</div>


