shown in other instead.
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.
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:
- 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.
If this option isn't specified, components won't be built.
- For Windows OS add <UnigineSDK>/externs/bin path to PATH environment variable to use Unigine batch scripts for more handy SCons call
- In the command prompt, go to the target directory which contains a SConscript file (depending on what you are going to compile).
- Type scons and pressENTER 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:
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:
C:\Windows\system32>c: C:\Windows\system32>cd c:\UnigineSDK\source\app\main C:\UnigineSDK\source\app\main>scons
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 Linux and Mac OS platforms. Use Unigine batch scripts for Windows. For example:
Using Scons Under Windows
To create the 32-bit version of the Unigine engine that supports double precision coordinates, use the following. By default the development version is created.
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.
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:
mac-name:~ username$ cd ~/home/username/UnigineSDK/source/app/main/ mac-name:main username$ scons debug=0 cross=x86
When building with SCons, the available options are the following:
- 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. Possible values are:It is not recommended to override the default settings.
- 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 theSIMD 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
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.
- openal - include OpenAL sound support. The default is 1.
- cuda - include CUDA support. The default is 0.
- opencl - include OpenCL support. The default is 0.
- editor - include UnigineEditor functionality. The default is 1.
- terminal - enable TELNET terminal. The default is 0.
- openexr - OpenEXR format. The default is 1.
- splash - Custom splash. The default is 1.
- quadbuffer - NVidia QuadBuffer. Available for Sim SDK only. The default is 0.
- geodetic - Geodetic feature. Available for Sim SDK only. The default is 1.
- 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.