Wednesday, September 23, 2020

Cross Compiling Qt 5.15.1 For Jetson Nano

Cross Compiling Qt 5.15.1 For Jetson Nano

----------------------------------------------------


download toolchain :
----------------------------------
gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu.tar.xz


Start :

--------------

# Target  Side ( jetson official sd image )
-------------------------------

# nfs server
sudo apt-get install nfs-kernel-server

# confign nfs server
# add this line to  /etc/exports
/    *(rw,nohide,insecure,no_subtree_check,async,no_root_squash)
service nfs-kernel-server restart

# qtbase
sudo apt-get install libboost1.58-all-dev libudev-dev libinput-dev libts-dev libmtdev-dev libjpeg-dev libfontconfig1-dev libssl-dev libdbus-1-dev libglib2.0-dev libxkbcommon-dev libegl1-mesa-dev libgbm-dev libgles2-mesa-dev mesa-common-dev xcb libxcb-xkb-dev x11-xkb-utils libx11-xcb-dev libxkbcommon-x11-dev libwayland-dev

# qtmultimedia
sudo apt-get install libasound2-dev libpulse-dev gstreamer1.0-omx libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev  gstreamer1.0-alsa

# qtwebengine
sudo apt-get install libvpx-dev libsrtp0-dev libsnappy-dev libnss3-dev

# qtlocation
sudo apt-get install libgeoclue-2-dev libdbus-glib-1-dev libgudev-1.0-dev libbluetooth-dev

# Host Side (ubuntu 64 os)
---------------------------

mkdir /QT-Jetson
mkdir /QT-Jetson/sysroot
mkdir /lib/aarch64-linux-gnu

apt-get install nfs-common

mount (jetson ip}:/ /QT-Jetson/sysroot
mount (jetson ip}:/lib/aarch64-linux-gnu  /lib/aarch64-linux-gnu

# extract  ( qt source ) qt-everywhere-src-5.15.1.tar.gz    to    /QT-Jetson/qt-everywhere-src-5.15.1

# extract  ( compiler  ) gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu.tar.xz
               to    /QT-Jetson/gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu


cd /QT-Jetson/qt-everywhere-src-5.15.1

note : simple modification :
------------------------------------------------------------------------------------------------------------------------------
in file : ./qtbase/mkspecs/common/sanitize.conf
change last 3 lines 
from :
QMAKE_SANITIZE_UNDEFINED_CFLAGS   = -fsanitize=undefined -fsanitize=float-divide-by-zero
QMAKE_SANITIZE_UNDEFINED_CXXFLAGS = -fsanitize=undefined -fsanitize=float-divide-by-zero
QMAKE_SANITIZE_UNDEFINED_LFLAGS   = -fsanitize=undefined -fsanitize=float-divide-by-zero

to:
QMAKE_SANITIZE_UNDEFINED_CFLAGS   = -fsanitize=undefined
QMAKE_SANITIZE_UNDEFINED_CXXFLAGS = -fsanitize=undefined
QMAKE_SANITIZE_UNDEFINED_LFLAGS   = -fsanitize=undefined

------------------------------------------------------------------------------------------------------------------------------

/configure -release -opengl es2 -device linux-jetson-tx1-g++ -device-option CROSS_COMPILE=/QT-Jetson/gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu- -sysroot /QT-Jetson/sysroot/ -opensource -confirm-license -make libs -prefix /usr/local/Qt-Jeston-5.15.1 -no-xcb -recheck

make

make install

Wednesday, May 27, 2020

Build ( Cross Compile ) Qt5.14.2 For Raspberry pi4 (raspbian Buster lite OS)
----------------------------------------------------

download toolchain :
----------------------------------
https://app.box.com/s/f8uksyvam238boo8dnguyin547e9l1gl

or
http://thebugfreeblog.blogspot.com/2019/
and download : Download Linux x64 cross toolchain GCC 8.3.0


Start :
--------------

# Target  Side ( raspbian os )
-------------------------------

# nfs server
sudo apt-get install nfs-kernel-server

# confign nfs server
# add this line to  /etc/exports
/    *(rw,nohide,insecure,no_subtree_check,async,no_root_squash)
service nfs-kernel-server restart

# qtbase
sudo apt-get install libboost1.58-all-dev libudev-dev libinput-dev libts-dev libmtdev-dev libjpeg-dev libfontconfig1-dev libssl-dev libdbus-1-dev libglib2.0-dev libxkbcommon-dev libegl1-mesa-dev libgbm-dev libgles2-mesa-dev mesa-common-dev xcb libxcb-xkb-dev x11-xkb-utils libx11-xcb-dev libxkbcommon-x11-dev libwayland-dev

# qtmultimedia
sudo apt-get install libasound2-dev libpulse-dev gstreamer1.0-omx libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev  gstreamer1.0-alsa

# qtwebengine
sudo apt-get install libvpx-dev libsrtp0-dev libsnappy-dev libnss3-dev

# qtlocation
sudo apt-get install libgeoclue-2-dev libdbus-glib-1-dev libgudev-1.0-dev libbluetooth-dev



# Host Side (ubuntu 64 os)
---------------------------

mkdir /opt/rpi
mkdir /opt/rpi/sysroot
mkdir /lib/arm-linux-gnueabihf

apt-get install nfs-common
mount raspberrypi.local:/ /opt/rpi/sysroot
mount raspberrypi.local:/lib/arm-linux-gnueabihf /lib/arm-linux-gnueabihdf

# extract  ( qt source ) qt-everywhere-src-5.14.2.tar.gz    to    /opt/rpi/qt-everywhere-src-5.14.2
# extract  ( compiler  ) rpi-gcc-8.3.0.tar.gz                to    /opt/rpi/rpi-gcc-8.3.0

cd /opt/rpi/qt-everywhere-src-5.14.2

./configure -release -opengl es2 -device linux-rasp-pi4-v3d-g++ -device-option CROSS_COMPILE=/opt/rpi/rpi-gcc-8.3.0/bin/arm-linux-gnueabihf- -sysroot /opt/rpi/sysroot/ -opensource -confirm-license -make libs -prefix /usr/local/Qt-rasp4-5.14.2 -no-xcb -recheck

make

make install