Deploying Kanzi applications to QNX¶
Before you can build a Kanzi application for your target platforms, set up and configure the Kanzi build environment for your target platforms. The build environment includes tools that the Kanzi build system uses to build your application for your target platforms.
The Kanzi QNX platform packages are available on request.
Requirements¶
To build and deploy Kanzi applications to QNX, you need:
QNX Software Development Platform. You can get the QNX development tools at https://blackberry.qnx.com.
Python 2.7.x
Scons 2.5.1
Before deploying your Kanzi application to your QNX target device, make sure that device is running the QNX Screen service. See http://www.qnx.com/developers/docs/7.0.0/index.html#com.qnx.doc.screen/topic/manual/cscreen_about.html.
Building Kanzi applications for QNX¶
SCons runs the SConstruct file in the configuration directory of the platform from which you run the scons
command. SConstruct file is the entry point for building the application and contains the information about the Kanzi Engine location and runs these files:
<KanziWorkspace>/Engine/configs/platforms/common/config.py
includes the Kanzi library definitions and common build flags used when building for all platforms.<KanziWorkspace>/Engine/configs/platforms/<PlatformName>/config.py
includes the Kanzi platform-specific build flags and defines, and the toolchain. Edit this file when you want to customize the build configuration for your platform. For example, to match the locations of your platform SDK and board support package.<ProjectName>/Application/configs/platforms/common/config.py
includes the optional, project-specific common configuration parameters.<ProjectName>/Application/configs/platforms/<PlatformName>/config.py
includes the optional, project-specific platform configuration parameters.
To build Kanzi applications for QNX:
Open the command line in the configuration directory of the platform for which you want to build the Kanzi application (
<ProjectName>/Application/configs/platforms/<PlatformName>
) and make sure you have the correct environment variables set.For example, to build your Kanzi application for Linux, open the command line in the
<ProjectName>/Application/configs/platforms/linux_x11_glx_cpp98
directory.Run the
scons
command with the build parameters for your Kanzi application.Syntax
scons <library> <type> <name>
Parameters
library
(Optional) the graphics library:
ES2
builds the application with OpenGL ES 2.0ES3
builds the application with OpenGL ES 3.0
type
(Optional) the build type:
Release
builds the application with compiler optimizations enabled. The release option builds smaller files than the debug option. Use this option for production purposes. Default value.Debug
builds the application with disabled compiler optimizations and contains full debug information you can use with a debugger. The debug option builds larger files and debug applications run slower. Use this option for development purposes.Profiling
builds the application with compiler optimizations enabled and links the application against the Profiling build. Use this option when you want to measure the performance of different parts of Kanzi Engine. For example, when you want to find out how much time Kanzi uses on different tasks during application startup, or which parts of the application take a lot of time to run. See Measuring application performance.
name
(Optional) the name of the project
Examples
// Builds the application with the default settings as specified // in config.py and SConstruct configuration files. scons
// Builds the debug version of the application. scons debug
// Builds the debug version of the application with the // OpenGL ES 3.0 graphics library from the |ks| // project named MyProject. scons ES3 debug MyProject
Scons builds the Kanzi application source code and binary files in the <ProjectName>/Application/output
directory.
Deploying Kanzi applications to a QNX device¶
To deploy Kanzi applications to QNX:
Build your Kanzi application for QNX. See Building Kanzi applications for QNX.
Connect your QNX device to your computer.
From the
<ProjectName>/Application/output
directory copy to your QNX target device:Kanzi application exe file
kzb files that your Kanzi application uses
application.cfg
file which contains a list of all the kzb files your Kanzi application uses
On your QNX target device open the command line and add execution rights for your Kanzi application on that device:
// Adds execution rights on the QNX target device // for the Kanzi application called MyApplication. chmod 755 MyApplication
On the command line start the application on your QNX target device:
// Starts the Kanzi application called MyApplication. ./MyApplication
Known issues¶
When you use QNX 7.0.0 and update your QNX software through the QNX Software Center, the compilation of Kanzi applications fails with error
Kanzi-3_6_5-qnx700_screen_aarch64-es3-freetype-static/Engine/include/kanzi/core/cpp/cstdio.hpp:42:12: error: 'std::snprintf' has not been declared
QNX introduced this error in an update of their software development platform where the
std::snprintf
is missing in header files.Workaround: To remove the compilation error, add to the preprocessor flags the
-DKZ_USE_C99_SNPRINTF
definition.