# Issues with the PYNQ make

**URL:** <https://discuss.pynq.io/t/issues-with-the-pynq-make/141>\
**Category:** Support\
**Created:** [May 29, 2019, 11:37pm UTC](https://discuss.pynq.io/t/issues-with-the-pynq-make/141 "2019-05-29T23:37:03Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Walter\_Maguire](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/walter_maguire/32/96_2.png) [@Walter\_Maguire](https://discuss.pynq.io/u/Walter_Maguire)\
**Post date:** [May 29, 2019, 11:37pm UTC](https://discuss.pynq.io/t/issues-with-the-pynq-make/141/1 "2019-05-29T23:37:03Z")

</div>

Hi all,

In addition to my previous post concerning the porting of petalinux meta-user layers and associated configurations I have also noticed several issues with the current PYNQ image build tools.

If I navigate to the sd build folder and enter the following

make clean  
make

The PYNQ image is built, the output is shown below.

Sector size (logical/physical): 512 bytes / 512 bytes  
I/O size (minimum/optimal): 512 bytes / 512 bytes  
Disklabel type: dos  
Disk identifier: 0xecdb1c95

Device Boot Start End Sectors Size Id Type  
/home/developer/PYNQ/sdbuild/output/PYNQ-pnfs-2.4.img1 \* 2048 206847 204800 100M c W95 FAT  
/home/developer/PYNQ/sdbuild/output/PYNQ-pnfs-2.4.img2 206848 11242159 11035312 5.3G 83 Linux

Command (m for help): The partition table has been altered.  
Syncing disks.

- total\_size=5621080
- truncate -s 5621080K /home/developer/PYNQ/sdbuild/output/PYNQ-pnfs-2.4.img

Now trying do it using the make BOARDDIR=\<absolute\_path\>/myboards as described in the Readme.md file in the sdbuild directory.

developer@smoz:~/PYNQ/sdbuild$ make clean  
if [-e /home/developer/PYNQ/sdbuild/build/gcc-mb]; then chmod u+w -fR /home/developer/PYNQ/sdbuild/build/gcc-mb; fi  
rm -rf /home/developer/PYNQ/sdbuild/build/gcc-mb  
rm -rf /home/developer/PYNQ/sdbuild/build  
rm -rf /home/developer/PYNQ/sdbuild/output  
developer@smoz:~/PYNQ/sdbuild$ make BOARDDIR=/home/developer/PYNQ/boards/PYNQ-pnfs/  
which vivado | fgrep 2018.3  
/tools/Xilinx/Vivado/2018.3/bin/vivado  
which sdx | fgrep 2018.3  
/tools/Xilinx/SDx/2018.3/bin/sdx  
which petalinux-config | fgrep 2018.3  
/tools/pkg/petalinux/2018.3/tools/common/petalinux/bin/petalinux-config  
which arm-linux-gnueabihf-gcc  
/tools/pkg/petalinux/2018.3/tools/linux-i386/gcc-arm-linux-gnueabi/bin/arm-linux-gnueabihf-gcc  
which microblaze-xilinx-elf-gcc  
/tools/pkg/petalinux/2018.3/tools/linux-i386/microblaze-xilinx-elf/bin/microblaze-xilinx-elf-gcc  
which ct-ng  
/opt/crosstool-ng/bin/ct-ng  
which python | fgrep /usr/bin/python  
/usr/bin/python  
sudo -n mount \> /dev/null  
bash /home/developer/PYNQ/sdbuild/scripts/check\_Env.sh  
bash /home/developer/PYNQ/sdbuild/scripts/check\_mounts.sh

It stops after check\_mounts

Okay, lets assume something is not 100% cleaned after the make clean. Next I reboot the machine, rerun the Xilinx tools setup scripts and try again.

developer@smoz:~$ source /tools/Xilinx/Vivado/2018.3/settings64.sh  
developer@smoz:~$ source /tools/Xilinx/SDx/2018.3/settings64.sh  
developer@smoz:~$ source /tools/pkg/petalinux/2018.3/settings.sh  
PetaLinux environment set to ‘/tools/pkg/petalinux/2018.3’  
INFO: Checking free disk space  
INFO: Checking installed tools  
INFO: Checking installed development libraries  
INFO: Checking network and other services  
developer@smoz:~$ cd PYNQ/sdbuild/  
developer@smoz:~/PYNQ/sdbuild$ make BOARDDIR=/home/developer/PYNQ/boards/PYNQ-pnfs/  
which vivado | fgrep 2018.3  
/tools/Xilinx/Vivado/2018.3/bin/vivado  
which sdx | fgrep 2018.3  
/tools/Xilinx/SDx/2018.3/bin/sdx  
which petalinux-config | fgrep 2018.3  
/tools/pkg/petalinux/2018.3/tools/common/petalinux/bin/petalinux-config  
which arm-linux-gnueabihf-gcc  
/tools/pkg/petalinux/2018.3/tools/linux-i386/gcc-arm-linux-gnueabi/bin/arm-linux-gnueabihf-gcc  
which microblaze-xilinx-elf-gcc  
/tools/pkg/petalinux/2018.3/tools/linux-i386/microblaze-xilinx-elf/bin/microblaze-xilinx-elf-gcc  
which ct-ng  
/opt/crosstool-ng/bin/ct-ng  
which python | fgrep /usr/bin/python  
/usr/bin/python  
sudo -n mount \> /dev/null  
bash /home/developer/PYNQ/sdbuild/scripts/check\_Env.sh  
bash /home/developer/PYNQ/sdbuild/scripts/check\_mounts.sh  
developer@smoz:~/PYNQ/sdbuild$

Fails at exactly the same place as before.

Now just do a make on its own and all is okay.

So on my system at lease there is an issue with the command make make BOARDDIR=\<absolute\_path\>/myboards

Another issue with the build process is running make after a successful build also has the same problem. This is significant as the tools on my system don’t appear to be maintaining state and minor changes require the entire build to be re-run which takes several hours.

Has anybody else experienced these issues and does anyone know how to fix it?

Thanks,

Walter

---

<div class="post-metadata">

**Author:** ![rock](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/rock/32/32_2.png) [@rock](https://discuss.pynq.io/u/rock)\
**Post date:** [May 31, 2019, 12:09am UTC](https://discuss.pynq.io/t/issues-with-the-pynq-make/141/2 "2019-05-31T00:09:47Z")

</div>

What is your board name? Also, can you show the spec file content?

---

<div class="post-metadata">

**Author:** ![Walter\_Maguire](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/walter_maguire/32/96_2.png) [@Walter\_Maguire](https://discuss.pynq.io/u/Walter_Maguire)\
**Post date:** [May 31, 2019, 1:28am UTC](https://discuss.pynq.io/t/issues-with-the-pynq-make/141/3 "2019-05-31T01:28:35Z")

</div>

Hi Rock,

The details of the spec file and steps taken are detailed in this post

> [@Porting of petalinux meta-user recipes](https://discuss.pynq.io/t/porting-of-petalinux-meta-user-recipes/140):
>
> Hi all, Which forum should I use to post questions, this one [https://discuss.pynq.io/](https://discuss.pynq.io/) or the older [Redirecting to Google Groups](https://groups.google.com/forum/#!forum/pynq_project)? My particular issue is concerned with porting petalinux\_bsp meta-user layer configurations to PYNQ builds. The method is described in the Readme.md file located in the PYNQ sdbuild directory. The document states “Meta-user configurations can be added to the myboards/Myboard/petalinux\_bsp folder so the patches will be applied to the new BSP.” I have tried this fo…

The contents of the spec file are

The content of the PYNQ-pnfs.spec file is

ARCH\_PYNQ-pnfs := arm  
BSP\_PYNQ-pnfs := pnfs.bsp  
BITSTREAM\_PYNQ-pnfs := cz2\_wrapper.bit  
STAGE4\_PACKAGES\_PYNQ-pnfs := pynq boot\_leds peekpoke sampleapp ethernet

pnfs.bsp is the bsp generated from executing in the associated SDK hardware directory  
petalinux-package --bsp -p ~/peta-z2/pnfs/ --hwsource . --output pnfs.bsp

Note, this issue exists using the standard board files which come with the PYNQ distribution.

I will have a look at the scripts and makefiles when I have a chance to see if I can determine where the issue lies.

Regards

Walter

---

<div class="post-metadata">

**Author:** ![rock](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/rock/32/32_2.png) [@rock](https://discuss.pynq.io/u/rock)\
**Post date:** [May 31, 2019, 5:13pm UTC](https://discuss.pynq.io/t/issues-with-the-pynq-make/141/4 "2019-05-31T17:13:02Z")

</div>

The problem is after a successful build, you have all the target files in your system so make won’t do anything other than checking your environment. To restart from a certain stage, you need to remove the corresponding target file. For example, if you only want to rebuild stage4 packages, just remove the final image in the output folder and run make again.

---

<div class="post-metadata">

**Author:** ![Walter\_Maguire](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/walter_maguire/32/96_2.png) [@Walter\_Maguire](https://discuss.pynq.io/u/Walter_Maguire)\
**Post date:** [June 6, 2019, 12:44am UTC](https://discuss.pynq.io/t/issues-with-the-pynq-make/141/5 "2019-06-06T00:44:25Z")

</div>

Hi Rock,

Thanks for getting back. Perhaps it might be an idea to add some more targets to the make file which support the deleting of key sections. I haven’t checked what proportion of the overall build time rebuilding the stage 4 packages would take after deleting the final image in the output folder. I will have a look. Hopefully not too long.

Regards

Walter
