QT6 on Jetson Orin Nano from Source

Hello
I could build Qt6 on JetPack 5.1.2 according to this post, the installation with sudo make installwas successful but no desktop link were generated.
I exported the PATH=/usr/local/Qt-6.1.1/bin:$PATH

As setenvis not supported, how to set the desktop links and/or start Qt-creator from the command line?

Thanks
Giuliano

Hi,
A user has shared the script:

#!/bin/sh

####################################################################################
# This script builds from sources (AGX Orin R36.2):                                #
# - Qt6 (by default non-free version with QtWebEngine), free version is commented  #
# - qt-creator                                                                     #
#                                                                                  #
# Not tested that much, take it as a starting point and further share improvements #
####################################################################################


# Set target install dir (here using dir in /usr/local thus the sudos in Qt6/QtCreator install commands)
export Qt6_DIR=/usr/local/Qt-6.6.1-non-free

###################
# Boost clocks    #
###################
sudo jetson_clocks

########################
# Install dependencies #
########################
sudo apt-get install -y build-essential libfontconfig1-dev libdbus-1-dev libfreetype6-dev libicu-dev libinput-dev libxkbcommon-dev libsqlite3-dev libssl-dev libpng-dev libjpeg-dev libglib2.0-dev libpulse-dev libasound2-dev libcups2-dev libegl1-mesa-dev libvulkan-dev libxcb1-dev libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev '^libxcb.*-dev' libnss3-dev libxshmfence-dev libxkbfile-dev libxkbcommon-x11-dev python3-html5lib 

####################
# For QtWebEngine  #
####################
sudo apt-get install -y bison gperf flex python2 libasound2-dev libcups2-dev libdrm-dev libegl1-mesa-dev libnss3-dev libpci-dev libpulse-dev libudev-dev libxtst-dev gyp ninja-build 
sudo apt-get install -y libssl-dev libxcursor-dev libxcomposite-dev libxdamage-dev libxrandr-dev libfontconfig1-dev libxss-dev libwebp-dev libjsoncpp-dev libopus-dev libminizip-dev libavutil-dev libavformat-dev libavcodec-dev libevent-dev libvpx-dev libsnappy-dev libre2-dev libprotobuf-dev protobuf-compiler
#sudo apt-get install -y docker-compose
# For QtWebEngine, node.js >= 14 may be required...
#../install_NodeJs_20.sh
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
NODE_MAJOR=20
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list
sudo apt-get update && sudo apt-get install nodejs -y

####################
# Download sources #
####################
wget -c --quiet --show-progress --progress=bar:force:noscroll https://download.qt.io/official_releases/qt/6.6/6.6.1/single/qt-everywhere-src-6.6.1.tar.xz
tar -xvf qt-everywhere-src-6.6.1.tar.xz 
rm qt-everywhere-src-6.6.1.tar.xz

#############################
# Configure a release build #
#############################
mkdir build-release
cd build-release

# Direct cmake conf...
cmake -Wno-dev -GNinja -DQT_BUILD_TESTS=ON -DFEATURE_xcb=ON -DFEATURE_xkbcommon_x11=ON -DBUILD_qtwebengine=ON -DLLVM_DIR=/usr/lib/llvm-15/lib/ -DClang_DIR=/usr/lib/cmake/clang-15 -DCMAKE_INSTALL_PREFIX=$Qt6_DIR ../qt-everywhere-src-6.6.1

# Using top level configure script for open source version
#../qt-everywhere-src-6.6.1/configure -platform linux-g++ -xcb -opensource -confirm-license -prefix /usr/local/Qt-6.6.1/ -make tools -make tests -- -Wno-dev 

# Alternate, similar to above
#../qt-everywhere-src-6.6.1/configure -platform linux-g++ -xcb -opensource -confirm-license -prefix /usr/local/Qt-6.6.1/ -- -DQT_BUILD_TESTS=ON -DFEATURE_xcb=ON -DFEATURE_xkbcommon_x11=ON -DBUILD_qtwebengine=OFF


###################
# Build           #
###################
# Keep one core available in case CRON task happens during the build so that it doesn't trigger timeout 
build_cores=`expr $(nproc) - 1`
cmake --build . -j$build_cores

###################
# Test            #
###################
#ctest . -C Release

###################
# Install         #
###################
# Only use sudo if you don't have permissions for target install dir 
sudo cmake --install .
export PATH=$Qt6_DIR/bin:$PATH
export LD_LIBRARY_PATH=$Qt6_DIR/lib:$LD_LIBRARY_PATH

###################
# Check           #
###################
qtdiag

###################
# qt-creator      #
###################
cd ..
git clone --recursive https://code.qt.io/qt-creator/qt-creator.git
mkdir build-qt-creator
cd build-qt-creator
sudo mkdir $Qt6_DIR/tools
cmake -G Ninja -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=$Qt6_DIR/tools -D BUILD_WITH_PCH=OFF -D BUILD_TESTING=ON -D WITH_TESTS=ON ../qt-creator
cmake --build . -j$build_cores
# Only use sudo if you don't have permissions for target install dir 
sudo cmake --install .
export PATH=$Qt6_DIR/tools/bin:$PATH
export LD_LIBRARY_PATH=$Qt6_DIR/tools/lib:$LD_LIBRARY_PATH
cd ..

# Run QtCreator
# There might be some soft assertions failing on first run
qtcreator

# If ok so far, add environment to your user's .bashrc (to be done only once)
echo export PATH=$Qt6_DIR/bin:$PATH >> ~/.bashrc
echo export PATH=$Qt6_DIR/tools/bin:$PATH >> ./bashrc
echo export LD_LIBRARY_PATH=$Qt6_DIR/lib:$LD_LIBRARY_PATH >> ~/.bashrc
echo export LD_LIBRARY_PATH=$Qt6_DIR/tools/lib:$LD_LIBRARY_PATH >> ./bashrc
#echo export Qt6_DIR=$Qt6_DIR >> ~/.bashrc

Please use clean 5.1.2 or 5.1.3 and run the script.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.