Deploying Kanzi applications to Linux

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 most convenient way to build Kanzi applications for Linux is to do the building on Linux. If you have the Linux toolchain for Windows, you can build Kanzi applications for Linux on Windows. In that case point the Kanzi build scripts to that toolchain.

You can configure the input event devices that Kanzi listens to on Linux ports where the native windowing system does not provide input device handling.

See Input event devices on Linux.

Building Kanzi application for Linux

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 Linux:

  1. In Kanzi Studio select File > Open Kanzi Command Prompt and in the Kanzi Command Prompt in the configuration directory of the platform for which you want to build the Kanzi application (<ProjectName>/Application/configs/platforms/<PlatformName>).

    For example, to build your Kanzi application for Linux, open the Kanzi Command Prompt in the <ProjectName>/Application/configs/platforms/linux_x11_glx_cpp98 directory.

  2. 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.0

    • GL builds the application with OpenGL

    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 with
    // the OpenGL graphics library.
    scons GL debug
    
    // Builds the debug version of the application with the
    // OpenGL ES 2.0 graphics library from the Kanzi Studio
    // project named MyProject.
    scons ES2 debug MyProject
    

    Scons builds the Kanzi application source code and binary files in the <ProjectName>/Application/output directory.

See also

Deploying Kanzi applications

Application development