Programming
Fundamentials
Setting Up Development Environment
UnigineScript
High-Level Systems
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
GUI
Double Precision Coordinates
API
Core Library
Containers
Engine Classes
Node-Related Classes
Rendering-Related Classes
Physics-Related Classes
Bounds-Related Classes
GUI-Related Classes
Controls-Related Classes
Pathfinding-Related Classes
Utility Classes

Manual Compilation via SCons

Using SCons you can re-build the Unigine engine and its components (standalone tools, plugins for 3D editors) as well as binary executable of a custom application. It reads the default compilation settings stored in SConstruct and SConscript files which are provided in the Unigine SDK.

Notice
Rebuilding the Unigine engine and tools is avalable only in the full source version of the SDK.

Building with SCons

You should properly set the development environment to build with SCons.

To build the development version of the Unigine engine, its tools or a custom application (the same bitness as the native platform) via SCons, perform the following steps:

  1. Specify the SCONSFLAGS environment variable with -Q and -u options to avoid typing them by hand every time:
    • -Q to suppress SCons status messages (except commands that are executed to rebuild files). This is optional.
    • -u to search up the folder structure until an SConstruct file is found and build components at or below the current folder.
      Notice
      If this option isn't specified, components won't be built.
  2. In the command prompt, go to the target directory which contains a SConscript file (depending on what you are going to compile).
  3. Type scons and press ENTER to start building. By default cross-compilation is disabled and the compiled application and tools have the native bitness. If necessary, you can set your custom compilation options. For example:
    Shell commands
    C:\Windows\system32>c:
    
    C:\Windows\system32>cd c:\UnigineSDK\source\app\main
    
    C:\UnigineSDK\source\app\main>scons
    To build the release version of the Unigine engine, tools or an application for a native platform (here, Windows), you should type scons debug=0. For example:
    Shell commands
    C:\UnigineSDK\source\app\main>scons debug=0

Cross-Compilation with SCons

SCons allows for building the Unigine engine, its tools or a custom application for platforms with different bitness by specifying the cross option. For example:

Using Scons Under Windows

To create the 64-bit version of the Unigine engine that supports double precision coordinates, use the following. By default the development version is created.

Shell commands
C:\UnigineSDK\source\app\main>scons cross=x64 double_precison=1

Using Scons Under Linux

If you want to build the 32-bit release version of the Unigine engine for a native platform (here, Linux), type the following.

Shell commands
username@pc-name$ cd /home/username/UnigineSDK/source/app/main/
username@pc-name$ scons debug=0 cross=x86

Using Scons Under Mac OS X

To compile a 32-bit release version of the Unigine engine for Mac OS X, type the following:

Shell commands
mac-name:~ username$ cd ~/home/username/UnigineSDK/source/app/main/
mac-name:main username$ scons debug=0 cross=x86

Compilation Options

When building with SCons, the available options are the following:

  • platform PLATFORM - platform to build for. Possible values are:
    • default - the native platform that SCons is currently run on (for Linux). To create 64-bit Windows application, scons with the cross=x64 option should be run. For Mac OS X the default is always 64-bit architecture. This is a default option.
  • cross BITS - bitness of the target platform. Possible values are:
    • default - version with the same bitness as the platform that SCons is currently run on. This is a default option.
    • x86 - 32-bit version
    • x64 - 64-bit version
  • debug - generate detailed debugging information or not. Possible values are: 1 (by default) to build the development version, 0 to build the release version.
  • half_texcoords - build with half float texture coordinates. Possible values are: 1 (by default), 0.
  • double_precision - build with double precision coordinates (for large coordinates support). Possible values are: 1, 0 (by default).
  • compiler COMPILER - compiler to be used.
    Notice
    It is not recommended to override the default settings.
    Possible values are:
    • default - the native compiler for the chosen platform. This is the default option.
    • gcc - GCC (the GNU Compiler Collection)
    • msvs - MS Visual Studio compiler
    • clang - Clang compiler
  • jobs JOBS - the number of parallel building jobs to be run. Possible values are: 0, 1, 2, 3, 4, 6, 8, 16. The default is 0.
  • batch - enable batch build mode for MS Visual Studio to skip all prompts for user input. Possible values are: 1 (by default), 0.
  • simd SIMD - perform parallel compilation using the SIMD operations. Possible values are:
    • default - use Streaming SIMD Extensions 2 technology (Intel SIMD). This is the default value.
    • none - do not use SIMD
    • sse - use Streaming SIMD Extensions technology
    • sse2 - use Streaming SIMD Extensions 2 technology (Intel SIMD)
    • avx - use AVX

Renderer Options

If your application is not targeting different platforms at once, it is possible to exclude all information about non-used renderers from the Unigine library and thus decrease its size.

  • opengl - include OpenGL renderer. The default is 1.
  • opengl_44 - include OpenGL 4.4 functionality.
  • opengl_45 - include OpenGL 4.5 functionality.
  • direct3d11 - include DirectX 11 renderer. The default is 1.

Sound Options

  • openal - include OpenAL sound support. The default is 1.
  • xaudio2 - include XAudio2 support. The default is 1.

Computing Options

  • cuda - include CUDA support. The default is 0.
  • opencl - include OpenCL support. The default is 0.

Other Options

  • editor - include UnigineEditor functionality. The default is 1.
  • terminal - enable TELNET terminal. The default is 1.

Protection Options

  • password - encrypt the build. Specify the same password as used for a package with your project data.
  • watermark - create the Unigine watermark in the application viewport or not. Possible values are:
    • no - no watermark (by default)
    • default - default "Unigine" watermark
    • evaluation - "Evaluation kit" watermark
    • confidential - "For internal use only" watermark
  • revision - the Unigine engine revision number.
Last update: 2017-07-03