Building Qt

From Texas Instruments Embedded Processors Wiki

Jump to: navigation, search
Translate this page to   




Contents

Useful Links

New home for Qt

Qt is now hosted on qt-project.org.

Qt Embedded Download Location


TI software Package Download Location


Getting Started Guides


Qt 4.8, Qt5

Refer to below page for configuration information for Cortex-A8 processors

https://github.com/prabindh/qt-configs

Qt 4.7


Setting up Target before Qt Build

     -You may need to refer the Technical Reference Manual of your Processor to determine whether it has SGX or not

FileSystem:

Code Sourcery Toolchain:

Note: For BeagleBoard, please use the same toolchain as the one used to compile your kernel & filesystem
Bootargs:


Building Qt with OpenGL ES accelerated by SGX

     - OMAP3515/30

     - DM3715/30

     - AM3517

     - AM3717

Please refer Building_Qt_with_OpenGL_ES_accelerated_by_SGX, which is an article dedicated for this configuration.



Building Qt 

You can follow these steps to build Qt *without* OpenGL ES support for any ARM based TI Processor.


Step 1:

It is assumed that you have downloaded Qt embedded libraries and have set up the target board as mentioned above in this wiki


Step 2:

Copy the qmake conf for your processor. Replace <NAME_OF_PROCESSOR> with the name of your target in all the steps below:

cp -R [qt-install-dir]/mkspecs/qws/linux-arm-g++/ [qt-install-dir]/mkspecs/qws/linux-<NAME_OF_PROCESSOR>-g++/

Fix/Add qmake.conf under [qt-install-dir]/mkspecs/qws/linux-<NAME_OF_PROCESSOR>-g++/qmake.conf

#
# qmake configuration for building with arm-linux-g++
#

include(../../common/g++.conf)
include(../../common/linux.conf)
include(../../common/qws.conf)

# modifications to g++.conf
#Toolchain

#Compiler Flags to take advantage of the ARM architecture
QMAKE_CFLAGS_RELEASE = Please update this flag with your arm family specific compiler optimization options
QMAKE_CXXFLAGS_RELEASE = Please update this flag with your arm family specific compiler optimization options

QMAKE_CC = arm-none-linux-gnueabi-gcc
QMAKE_CXX = arm-none-linux-gnueabi-g++
QMAKE_LINK = arm-none-linux-gnueabi-g++
QMAKE_LINK_SHLIB = arm-none-linux-gnueabi-g++

# modifications to linux.conf
QMAKE_AR = arm-none-linux-gnueabi-ar cqs
QMAKE_OBJCOPY = arm-none-linux-gnueabi-objcopy
QMAKE_STRIP = arm-none-linux-gnueabi-strip

load(qt_config)

Note: For a different toolchain, please change the qmake.conf above accordingly. e.g For Angstrom Toolchain, you may need to change arm-none-linux-gnueabi-gcc to arm-angstrom-linux-gnueabi-gcc

sample qmake.conf for AM35xx/OMAP35xx (Cortex-A8 family)

#
# qmake configuration for building with arm-linux-g++
#

include(../../common/g++.conf)
include(../../common/linux.conf)
include(../../common/qws.conf)

# modifications to g++.conf
#Toolchain

#Compiler Flags to take advantage of the ARM architecture
QMAKE_CFLAGS_RELEASE =   -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp
QMAKE_CXXFLAGS_RELEASE = -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp

QMAKE_CC = arm-none-linux-gnueabi-gcc
QMAKE_CXX = arm-none-linux-gnueabi-g++
QMAKE_LINK = arm-none-linux-gnueabi-g++
QMAKE_LINK_SHLIB = arm-none-linux-gnueabi-g++

# modifications to linux.conf
QMAKE_AR = arm-none-linux-gnueabi-ar cqs
QMAKE_OBJCOPY = arm-none-linux-gnueabi-objcopy
QMAKE_STRIP = arm-none-linux-gnueabi-strip

load(qt_config)

sample qmake.conf for AM18x (ARM9 family)

#
# qmake configuration for building with arm-linux-g++
#

include(../../common/g++.conf)
include(../../common/linux.conf)
include(../../common/qws.conf)

# modifications to g++.conf
#Toolchain

#Compiler Flags to take advantage of the ARM architecture
QMAKE_CFLAGS_RELEASE =   -O3 -march=armv5te
QMAKE_CXXFLAGS_RELEASE = -O3 -march=armv5te

QMAKE_CC = arm-none-linux-gnueabi-gcc
QMAKE_CXX = arm-none-linux-gnueabi-g++
QMAKE_LINK = arm-none-linux-gnueabi-g++
QMAKE_LINK_SHLIB = arm-none-linux-gnueabi-g++

# modifications to linux.conf
QMAKE_AR = arm-none-linux-gnueabi-ar cqs
QMAKE_OBJCOPY = arm-none-linux-gnueabi-objcopy
QMAKE_STRIP = arm-none-linux-gnueabi-strip

load(qt_config)

If you want to add touchscreen support, the Qmake configuration should specify the path to the touchscreen library in QMAKE_INCDIR and QMAKE_LIBDIR.

The sample configurations for ARM9 and Cortex-A8 are available at the links below. Update the path to the touch screen library in the corresponding qmake.conf file


Step 3:

cd [qt-install-dir]

./configure --help 
./configure -prefix <PATH> -embedded arm -platform qws/linux-x86-g++ -xplatform qws/linux-omap3-g++ -depths 16,24,32 -no-mmx 
-no-3dnow -no-sse -no-sse2 -no-glib -no-cups -no-largefile -no-accessibility -no-openssl -no-gtkstyle -qt-mouse-pc -qt-mouse-linuxtp 
-qt-mouse-linuxinput -plugin-mouse-linuxtp -plugin-mouse-pc -fast 

Note:


Step 4:

> make

> make install

e.g. if the path in "-prefix" option of configure is "-prefix /opt/qt" and you use "make install INSTALL_ROOT=/home/alpha/nfs/", then the qt binaries will be installed at "/home/alpha/nfs/opt/qt"


 Step 5:

Running the Qt Application:

After copying/installing the qt binaries in the target filesystem, you can run the qt examples & qt demos

For the commands below, I have installed my qt-embedded in the path: /opt/qt-embedded

[mailto:root@arago root@arago]:~# export LD_LIBRARY_PATH=/lib:/usr/lib:/usr/local/lib:/opt/qt-embedded/lib 
 root@arago:~# cd /opt/qt-embedded/demos/

root@arago:~# cd composition root@arago:~# ./composition -qws



You can see the output either on the lcd or dvi output depending on how you configured your target board to output




Creating Project in Qt


Configuration Examples

Comment: examples below are taken from real-world tests but don't mean you shouldn't consider other options. Especially where modules are not build you might remove that option to get the full Qt functionality (e.g. -no-phonon was used in one case to reduce compile time as we had no need for phonon in our application demo).

Qt 4.5.x Embedded Linux: Configuration for OMAP-L137

./configure -prefix /opt/qt -embedded arm -platform /qws/linux-x86-g++ -xplatform /qws/linux-omapl1-mv-g++ -qt-kbd-usb -depths 16 -no-cups -no-largefile -no-accessibility -no-opengl -no-openssl

Qt 4.5.x WinCE: Configuration for OMAP3

Make sure that your path contains <wince_qt_dir>\bin. Then open a Visual Studio shell and enter:

configure.exe -platform win32-msvc2005 -xplatform wince60standard-armv4i-msvc2005


Here we assume that WinCE Platform Builder and the OMAP3 WinCE BSP are installed. Now type "nmake" inside a Platform Builder build shell to generate Qt DLLs. The DLLs maybe installed into C:/Windows on the WinCE file system or reside in the same folder as the Qt application (e.g. on SD card or USB disk). This is especially useful for testing.

For generating the run-time tree do this:

set INSTALL_ROOT=\some_path


nmake install

This will copy all relevant files into C:\some_path. From there copy to the WinCE target.

Qt 4.5.x Embedded Linux: Configuration for DM365 with Avnet LCD

If using the Avnet LCD kit, some patches need to be applied to the kernel. Follow the instructions on DM365 touchscreen with Qt.

For touchscreen support, ensure the following lines are in the gmake.conf file:

#modifications to include ts-lib
QMAKE_INCDIR            = /home/user/workdir/dm365/usr/include
QMAKE_LIBDIR            = /home/user/workdir/dm365/lib

Add the following lines to the /root/.profile file on the target. This sets the environment variables for touch screen support, and for Qt to use the second OSD window (/dev/fb2).

export QWS_MOUSE_PROTO=tslib:/dev/input/event0
export QWS_DISPLAY=LinuxFb:/dev/fb2

See Also



Leave a Comment

Comments

Comments on Building Qt


Contents

Fk jiang said ...

Hi all, I have built my QT according to the page,and I can see the surface of the demos,but cannot use my mouse and keyboard to control it,what's the problem? (The output is on dvi) Bestregards,

--Fk jiang 03:28, 26 July 2010 (CDT)

Cvalicka said ...

I seem to have keyboard input but not mouse input. Any luck?

--Cvalicka 17:15, 8 September 2010 (CDT)

PeterJerald said ...

Hi all, I have successfully built QT and also i can able to see the applications but i cant able to enable the remote functionality in QT. Any body Please help me,Thanks in advance. Regards, Peter Jerald

--PeterJerald 00:40, 15 September 2010 (CDT)

Blacksword said ...

I've wrote a document about how to integrate Qt Commercial with TI SDK.

Please refer http://blog.csdn.net/chanuei/archive/2011/03/05/6225689.aspx

--Blacksword 02:43, 5 March 2011 (CST)

Prabindh said ...

Hello Blacksword / Chanuei,

Thank you very much for your work.

However, please note that the "E" letter indicates "Embedded" (Qt Embedded), and not "Evaluation". Customers can use the libraries for production.

--Prabindh 20:51, 6 March 2011 (CST)

Blacksword said ...

Sorry for that misunderstand.

As ten people asked, all the answer point to Evaluation. That's the judgement from.

Anyway, LGPL is really problem, especially for plugins. That's the reason I wrote that doc.

BTW. accessibility is kicked off from the suggest configuration. Some time it is very important to support it. Otherwise it will drive us to mess.

--Blacksword 08:19, 7 March 2011 (CST)

Taku said ...

Hello, everyone

I, according to the article Building Qt, tried to build. However, there are a problem.

make

{standard input}: Assembler messages: {standard input}:1182: Error: selected processor does not support Thumb mode `swp r6,r4,[r3]' make[1]: *** [.obj/release-shared-emb-arm/qobject.o] Error 1

Do you have any advice ?


--Taku 22:34, 12 August 2011 (CDT)

Ckw089 said ...

Hi,

Can I actually build and run the Qt application on LogicPD eXperimenter Kit for OMAPL138 ?

kc wong

--Ckw089 04:25, 24 August 2011 (CDT)

Nmmane eln said ...

Hi i don't want to use 3d graphics just simple gui. for that i have configured and build qt for arm A8/A9. but the problem is, i have got two cursors on application startup. what can i do to get out of this error.

my config options are- //============ ./configure -prefix /opt/qt_tslib -embedded arm -platform /qws/linux-x86-g++ -xplatform /qws/linux-DM3730-g++ -depths 16,24,32 -no-mmx -no-3dnow -no-sse -no-sse2 -no-glib -no-cups -no-largefile -no-accessibility -no-openssl -no-gtkstyle -qt-mouse-pc -qt-mouse-linuxtp -qt-mouse-linuxinput -plugin-mouse-linuxtp -plugin-mouse-pc -qt-mouse-tslib -fast //============

--Nmmane eln 01:33, 1 April 2012 (CDT)

Personal tools
Namespaces
Variants
Actions
Navigation
Print/export
Toolbox