In our example we are using a host PC running CERN CentOS 7 for x86_64 and a ZCU102 evaluation board with a Xilinx Zynq Ultrascale+ MPSoC (ZynqMP) or an ATLAS MUCTPI V1 with a Xilinx Zynq SoC (Zynq). The host PC and the ZynqMP or Zynq are connected in a private network. In this network the IP address of the host is and the one of the ZynqMP or Zynq is . In addition, the host PC is in the CERN public network and has full internet access.

1 Create a CentOS/aarch64 or armv7hl root file system

Cross install a root file system from scratch using dnf for both aarch64 and armv7hl.
In our case the filesystem will be located at $ROOTFS_PATH=/home/ppapageo/NFS.

1.1 Install dnf

sudo yum install dnf

1.2 Install qemu

Get the qemu static executable. Qemu has to exist in the same directory in respect to the host and target filesystems. In our case we copy it to the /usr/local/bin the host and target root file system.
export ROOTFS_PATH=/your/target/path

chmod +x qemu-aarch64-static
mkdir -p $ROOTFS_PATH/usr/local/bin
cp -a qemu-aarch64-static $ROOTFS_PATH/usr/local/bin
sudo cp -a qemu-aarch64-static /usr/local/bin

chmod +x qemu-arm-static
mkdir -p $ROOTFS_PATH/usr/local/bin
cp -a qemu-arm-static $ROOTFS_PATH/usr/local/bin
sudo cp -a qemu-arm-static /usr/local/bin
We also need inform the binfmt_misc to use the static qemu:
sudo vim /etc/binfmt.d/qemu-aarch64.conf
##clear the file and add the following line:

sudo vim /etc/binfmt.d/qemu-arm.conf
##clear the file and add the following line:

Restart and verify:
sudo systemctl restart systemd-binfmt.service

sudo cat /proc/sys/fs/binfmt_misc/qemu-aarch64

sudo cat /proc/sys/fs/binfmt_misc/qemu-arm

1.3 Install the root file system

Download and run the mkrootfs python script.
Add any extra packages in a file and pass it to the --extra option. (e.g. extra_rpms.txt )
git clone ssh://
cd centos-rootfs

sudo python --root=$ROOTFS_PATH --arch=aarch64 --extra=extra_rpms.txt

sudo python --root=$ROOTFS_PATH --arch=armv7hl --extra=extra_rpms.txt
Special thanks to Matthias Wittgen, SLAC, who authored the original version of this script.

2 Boot the ZynqMP with the CentOS/aarch64 root file system

2.1 Boot the ZynqMP

Make sure you have configured the network to accept NFS through the firewall.
Prepare the SD card (we are using yocto for the preparation of the boot files).
In the uEnv.txt file on the SD card, add the nfs boot options in the bootargs; change the IP address and root filesystem path accordingly:
bootargs=earlycon clk_ignore_unused root=/dev/nfs rootfstype=nfs ip= nfsroot=,nfsvers=3 rw rootwait

2.2 Set up an ntp server

In order for the clocks of the host PC and the ZynqMP to be synchronized, an ntp server and client setup is needed. We use a chrony daemon.

2.3 Install additional packages using dnf

Additional packages can be installed with dnf from repositories specified in the .conf file.
For example:

cd centos-rootfs

dnf -y -c dnf.conf --forcearch=aarch64 \
	--releasever=7 \
	--repo=centos-base,centos-updates,centos-extras,arm64-epel \
	--installroot=$ROOTFS_PATH \
	install ${your_package}

dnf -y -c dnf.conf --forcearch=armv7hl \
	--releasever=7 \
	--repo=centos-base,centos-updates,centos-extras,arm-epel \
	--installroot=$ROOTFS_PATH \
	install ${your_package}

When running dnf update and some packages fail to install due to scriptlet failures try the same command with the option --setopt=tsflags=noscripts .

3 Build and install a specific version of GCC

CentOS usually comes with a version of gcc which might be outdated for other software that you may want to build. As an example, we are building gcc version 8.2 as required by ROOT and the ATLAS TDAQ software.
tar -xJf gcc-8.2.0.tar.xz
cd gcc-8.2.0
mkdir build
cd build
make -j $(($(nproc) + 1))
make install -j $(($(nproc) + 1))

4 Download and compile ROOT

Install external dependencies: cmake3 libX11-devel libXext-devel libXpm-devel libXft-devel  redhat-lsb-core python-devel
git clone ${PREFIX}/ROOT
Install a newer version of GCC, e.g. GCC 8.2 (see above).
Root tries to download some packages from the internet. If your board has not internet access (you can give access the board by following this guide), you will have to download them manually from the host side. The target urls are usually located at ${package}/src/${package}-stamp/${package}-urlinfo.txt/-gitinfo.txt. In this case:
export PREFIX=/root/installation/path
wget -P ${PREFIX}/ROOT/build/VDT-prefix/src
wget -P ${PREFIX}/ROOT/build/builtins/openssl/OPENSSL-prefix/src
wget -P ${PREFIX}/ROOT/build/TBB-prefix/src
Comment out the downloading section on the .cmake file:
cd ${PREFIX}/ROOT/build/interpreter/llvm/src/tools/cling/tools/plugins/clad/clad-prefix/tmp/
vi clad-gitclone.cmake
git clone ${PREFIX}/ROOT/build/interpreter/llvm/src/tools/cling/tools/plugins/clad/clad-prefix/src/clad
Now on the ZynqMP side:
export CXX=/usr/local/bin/g++
export CC=/usr/local/bin/gcc
export LIBRARY_PATH=/usr/lib64:${LIBRARY_PATH} #the libstdc++ of the locally built gcc is located here
cd build
cmake3 ../
make -j $(($(nproc) + 1))

Then you can source and use ROOT:

source ${PREFIX}/ROOT/build/bin/


As an example of a more complex software we are building a subset of the ATLAS TDAQ software. The instructions of the process can give you a general idea on how the building can be achieved. For the actual software, access to the ATLAS TDAQ repositories will be required.

6 Cross Compile with CentOS sysroot


7 Miscellaneous

Visit CentOSForZynqMPMisc for hints and tips concerning system administration.

-- PanagiotisPapageorgiou - 2019-05-17
Edit | Attach | Watch | Print version | History: r30 < r29 < r28 < r27 < r26 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r30 - 2019-07-24 - RalfSpiwoks
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    SystemOnChip All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2023 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback