Skip to content

Commit

Permalink
packages updated to be compatible with ubuntu 22.04 and python3.10
Browse files Browse the repository at this point in the history
  • Loading branch information
skalade committed Sep 28, 2022
1 parent b23f3f6 commit f8381e6
Show file tree
Hide file tree
Showing 42 changed files with 264 additions and 497 deletions.
3 changes: 1 addition & 2 deletions sdbuild/packages/bootpy/boot.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,4 @@
# leds[0:4].off()
# sleep(0.2)
# leds[0:4].on()
# sleep(0.2)

# sleep(0.2)
11 changes: 11 additions & 0 deletions sdbuild/packages/clear_pl_statefile/clear_pl_statefile.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[Unit]
Description=Clears the PL Statefile on boot
Requires=jupyter.service
After=jupyter.service

[Service]
Type=oneshot
ExecStart=/usr/local/bin/clear_pl_statefile.sh

[Install]
WantedBy=basic.target
11 changes: 11 additions & 0 deletions sdbuild/packages/clear_pl_statefile/clear_pl_statefile.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

source /etc/profile.d/pynq_venv.sh
source /etc/profile.d/xrt_setup.sh

# Remove any previous versions of the statefile
echo "from pynq import PL" > /tmp/.pynq_clear_statefile.py
echo "PL.reset()" >> /tmp/.pynq_clear_statefile.py

python3 /tmp/.pynq_clear_statefile.py

8 changes: 8 additions & 0 deletions sdbuild/packages/clear_pl_statefile/pre.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#! /bin/bash

target=$1
script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

sudo cp $script_dir/clear_pl_statefile.sh $target/usr/local/bin
sudo cp $script_dir/clear_pl_statefile.service $target/lib/systemd/system

2 changes: 2 additions & 0 deletions sdbuild/packages/clear_pl_statefile/qemu.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
systemctl enable clear_pl_statefile

5 changes: 4 additions & 1 deletion sdbuild/packages/gcc-mb/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (C) 2022 Xilinx, Inc
# SPDX-License-Identifier: BSD-3-Clause

GCC_MB_SOURCEDIR := $(dir $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)))
GCC_MB_WORKDIR := ${BUILD_ROOT}/gcc-mb
export CT_COMPILE_ROOT = ${GCC_MB_WORKDIR}
Expand All @@ -23,7 +26,7 @@ ${GCC_MB_WORKDIR}/patches: | ${GCC_MB_SOURCEDIR}/patches ${GCC_MB_WORKDIR}
cp -r ${GCC_MB_SOURCEDIR}/patches $@

${NATIVE_BUILD_arm}: | ${GCC_MB_WORKDIR}/samples ${GCC_MB_WORKDIR}/patches
cd ${GCC_MB_WORKDIR} && ct-ng arm-unknown-linux-gnueabihf && sed -i -e 's:2.2.6:2.4.1:' .config && ct-ng build
cd ${GCC_MB_WORKDIR} && ct-ng arm-unknown-linux-gnueabihf && sed -i -e 's:2.4.1:2.2.6:' -e 's|CT_ISL_MIRRORS=.*|CT_ISL_MIRRORS="https://distfiles.macports.org/isl/"|' -e 's|CT_EXPAT_MIRRORS=.*|CT_EXPAT_MIRRORS="https://github.com/libexpat/libexpat/releases/download/R_2_2_6"|' .config && ct-ng build

${GCC_MB_WORKDIR}/arm/microblazeel-xilinx-elf/bin/mb-gcc: | ${NATIVE_BUILD_arm}

Expand Down
5 changes: 5 additions & 0 deletions sdbuild/packages/gcc-mb/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ done
export -n LD_LIBRARY_PATH
# Use cross tools to build the provided configuration
ct-ng $sample

sed -e 's|CT_ISL_MIRRORS=.*$|CT_ISL_MIRRORS="https://distfiles.macports.org/isl/"|' \
-e 's|CT_EXPAT_MIRRORS=.*$|CT_EXPAT_MIRRORS="https://github.com/libexpat/libexpat/releases/download/R_2_2_6"|' \
-i .config

ct-ng build

cd ${ARCH}/microblazeel-xilinx-elf
Expand Down
16 changes: 0 additions & 16 deletions sdbuild/packages/jupyter/qemu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,6 @@ else
export NODE_OPTIONS=--max-old-space-size=4096
fi

# install nodejs 12
curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add -
echo deb https://deb.nodesource.com/node_12.x focal main > /etc/apt/sources.list.d/nodesource.list

# TODO fix hang on the apt-get install...
# apt-get update && apt-get install -y nodejs
if [ ${ARCH} == 'arm' ]; then
wget https://deb.nodesource.com/node_12.x/pool/main/n/nodejs/nodejs_12.22.6-deb-1nodesource1_armhf.deb
dpkg -i *.deb
rm -rf *.deb
else
wget https://deb.nodesource.com/node_12.x/pool/main/n/nodejs/nodejs_12.22.6-deb-1nodesource1_arm64.deb
dpkg -i *.deb
rm -rf *.deb
fi

source /etc/profile.d/pynq_venv.sh

jupyter notebook --generate-config --allow-root
Expand Down
3 changes: 3 additions & 0 deletions sdbuild/packages/libsds/libcma/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (C) 2022 Xilinx, Inc
# SPDX-License-Identifier: BSD-3-Clause

CMA_ARCH ?= $(shell getconf LONG_BIT)
INSTALL_LIB = libcma.so.$(CMA_ARCH)

Expand Down
3 changes: 3 additions & 0 deletions sdbuild/packages/libsds/libcma/libxlnk_cma.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (C) 2022 Xilinx, Inc
// SPDX-License-Identifier: BSD-3-Clause

#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
Expand Down
3 changes: 3 additions & 0 deletions sdbuild/packages/libsds/libcma/pynqlib.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (C) 2022 Xilinx, Inc
// SPDX-License-Identifier: BSD-3-Clause

#define _GNU_SOURCE

#include <stdio.h>
Expand Down
10 changes: 0 additions & 10 deletions sdbuild/packages/phantomjs-fix/phantomjs.patch

This file was deleted.

9 changes: 0 additions & 9 deletions sdbuild/packages/phantomjs-fix/pre.sh

This file was deleted.

2 changes: 1 addition & 1 deletion sdbuild/packages/pybind11/qemu.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
set -x
set -e

VERSION=2.5.0
VERSION=2.6.0
cd /root
wget "https://github.com/pybind/pybind11/archive/v${VERSION}.zip"
unzip v${VERSION}.zip
Expand Down
3 changes: 3 additions & 0 deletions sdbuild/packages/pynq/Makefile
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
# Copyright (C) 2022 Xilinx, Inc
# SPDX-License-Identifier: BSD-3-Clause

PACKAGE_BUILD_pynq += ${PYNQ_UPDATE}
10 changes: 5 additions & 5 deletions sdbuild/packages/pynq/post.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ target=$1
script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

# sdist is built at stage 3
if [ ${PYNQ_BOARD} == "Unknown" ]; then
dist_out=$BUILD_ROOT/PYNQ/dist
mkdir -p $dist_out
cp -rf $target/home/xilinx/pynq_git/dist/* $dist_out
fi
#if [ ${PYNQ_BOARD} == "Unknown" ]; then
# dist_out=$BUILD_ROOT/PYNQ/dist
# mkdir -p $dist_out
# cp -rf $target/home/xilinx/pynq_git/dist/* $dist_out
#fi
sudo rm -rf $target/home/xilinx/pynq_git
7 changes: 6 additions & 1 deletion sdbuild/packages/pynq/qemu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,16 @@ export BOARD=${PYNQ_BOARD}
cd /home/xilinx
mkdir -p jupyter_notebooks

# clone and then install extra packages
python3 -m pip install --upgrade git+https://github.com/Xilinx/PYNQ-Metadata.git
python3 -m pip install --upgrade git+https://github.com/Xilinx/PYNQ-Utils.git

cd pynq_git
BOARD=${PYNQ_BOARD} PYNQ_JUPYTER_NOTEBOOKS=${PYNQ_JUPYTER_NOTEBOOKS} \
python3 -m pip install dist/*.tar.gz --upgrade --no-deps --no-use-pep517
if [ -d notebooks ]; then
cp -r notebooks/* ${PYNQ_JUPYTER_NOTEBOOKS}/
fi
cd ..

old_hostname=$(hostname)
Expand All @@ -34,4 +40,3 @@ chown xilinx:xilinx /home/xilinx/REVISION
chown xilinx:xilinx -R /home/xilinx/pynq
chown xilinx:xilinx -R /home/xilinx/jupyter_notebooks
chown xilinx:xilinx -R $pynq_dir
systemctl enable pl_server
2 changes: 1 addition & 1 deletion sdbuild/packages/pynq_peripherals/qemu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ pip install git+https://github.com/Xilinx/PYNQ_peripherals.git
# TODO pynq CLI depends on XRT, XRT not working in QEMU when `xbutil dump` called
# pynq get-notebooks pynq_peripherals -p $PYNQ_JUPYTER_NOTEBOOKS
mkdir -p $PYNQ_JUPYTER_NOTEBOOKS/pynq_peripherals
cp -r /usr/local/share/pynq-venv/lib/python3.8/site-packages/pynq_peripherals/notebooks/* \
cp -r /usr/local/share/pynq-venv/lib/python3.10/site-packages/pynq_peripherals/notebooks/* \
$PYNQ_JUPYTER_NOTEBOOKS/pynq_peripherals

138 changes: 0 additions & 138 deletions sdbuild/packages/python_packages_focal/qemu.sh

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ then
sudo mkdir -p $target/$target_dir
sudo cp -rf $script_dir/pre-built/$target_dir/* $target/$target_dir
fi

sudo cp $script_dir/requirements.txt $target/root/
18 changes: 18 additions & 0 deletions sdbuild/packages/python_packages_jammy/qemu.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
export HOME=/root

set -x
set -e


# Captured using pip3 freeze on image after packages installed with no versions
cd /root

export PYNQ_VENV=/usr/local/share/pynq-venv

python3 -m venv --system-site-packages $PYNQ_VENV
echo "source $PYNQ_VENV/bin/activate" > /etc/profile.d/pynq_venv.sh
source /etc/profile.d/pynq_venv.sh

python3 -m pip install pip==22.0.2
python3 -m pip install -r requirements.txt
rm requirements.txt
Loading

0 comments on commit f8381e6

Please sign in to comment.