This is the documentation for Enlighten.

Code compilation


When you implement Enlighten you can almost always just use the precompiled libraries and sample applications. In rare circumstances you may wish to compile the libraries and sample applications from source.

You can compile in any version of Visual Studio using the provided Enlighten.sln file.

When opening Enlighten.sln in Visual Studio you may be prompted to convert the projects to a newer version. Please ignore this warning and cancel the conversion.


Compilation on the command line

The code is built by a custom tool called the CodeBuildTool. This can be found in the BuildTools folder of the distribution. The inputs to the tool are:

  • A .vcxproj file containing the source file list.
  • An .xml file containing metadata about the project.
  • (Internally) Descriptions of the tool chains that can be used.

For example:

CD /d E:\Enlighten_3.XX
BuildTools\CodeBuildTool build DEBUG_WIN32_2010 Src\Samples\Programs\GeoRadiosity\GeoRadiosity.vcxproj


Some of the compilation build steps overwrite files that are shipped with the SDK. Therefore, all files in your SDK directory should be writable. If the read-only flag has been set by your operating system. for example, when copying the SDK from read-only media, run the fix_files.bat script in the root of your Enlighten directory to correct this.

Build targets

The build target name is case insensitive, and broken into three parts: <Configuration><Platform><ToolSet>

Configuration

Configuration

Description

Library Suffix

Debug

Debug configuration

_d

Unchecked

Unchecked debug configuration

_u

Checked

Checked release configuration

_c

Release

Release configuration

None

The debug configurations differ from the release configuration in these respects:

  • Debug configurations use the debug version of the CRT on platforms that support it
  • On Visual Studio, the STL defined _ITERATOR_DEBUG_LEVEL and _SECURE_SCL symbols will be defined with their debug or release defaults accordingly.
  • The Unchecked configuration is the same as the Debug configuration except that _ITERATOR_DEBUG_LEVEL=0 is set.
  • The Checked configuration is the same as the Release configuration except that _SECURE_SCL is set.
  • Debug configurations test internal assertions and will report (non-blocking) warnings if these fail using the LOG_ASSERT log type. These internal assertions are not intended for use as an error reporting mechanism, and there should be no additional warnings in normal use. Please notify Enlighten Support if you encounter any.

All configurations are optimised, but the Release configuration will outperform the Debug build. We recommend you use the configuration type that matches your CRT and STL usage.

Enlighten 3 Platforms

Platform

Description

Win32

32 bit Windows

Win64

64 bit Windows

XboxOne

Xbox One

PS4

PlayStation 4

XSX

Xbox Series X

PS5

PlayStation 5

32 bit builds are supported for a limited subset of projects:

  • Core libraries: Enlighten3, Enlighten3HLRT, EnlightenPppi, IntelTBB, Zlib.
  • Sample framework libraries: GeoRender, GeoScene, GeoEn2Support, GeoRuntime, GeoPipeline, GeoExport.
  • Sample framework applications: GeoViewer.

There are some platforms that cannot be built with this external tool; the MacOS and iOS implementations. Compilation instructions for these are given below.

Use and compilation of Android and iOS libraries are documented as part of the mobile documentation. Note that Android and iOS libraries are distributed separately to the default distribution package.

Toolset

Platform

ToolSet

Description

Win32/Win64

2015

Visual Studio 2015 (with DLL Crt)

Win32/Win64

2017

Visual Studio 2017 (with DLL Crt)

Win32/Win64

2019

Visual Studio 2019 (with DLL Crt)

Win32/Win64

141#

Visual Studio 2017 MSVC 14.1# (with DLL Crt)

Win32/Win64

142#

Visual Studio 2019 MSVC 14.2# (with DLL Crt)

Win32/Win64

2015ST

Visual Studio 2015 (with static Crt)

Win32/Win64

2017ST

Visual Studio 2017 (with static Crt)

Win32/Win64

2019ST

Visual Studio 2019 (with static Crt)

Win32/Win64

141#ST

Visual Studio 2017 MSVC 14.1# (with static Crt)

Win32/Win64

142#ST

Visual Studio 2019 MSVC 14.2# (with static Crt)

Sample framework projects cannot be compiled with versions of Visual Studio older than 2015.

Many platforms have multiple tool chains available, and Enlighten supports as many as possible natively. Where a toolset is not specified above, this section of the build target should be skipped. Whatever the current SDK environment variables point to will be used, and if this is unsupported by Enlighten an error message will be presented.

The 2017 toolset builds with MSVC compiler version 14.16 by default. To build with a different compiler, specify the compiler version: e.g. toolset 1416 builds with the 14.16 compiler.
By default, Visual Studio 2017 builds use Windows SDK 10.0.15063. You can override this in the toolset name: e.g. 1415-15063.

The 2019 configuration builds with toolset 14.21. To build with a different toolset, specify the toolset version: e.g. configuration 1421 builds with the 14.21 toolset.
By default, Enlighten builds against Windows SDK 10.0.16229. You can override this in the configuration name: e.g. 1421-16229.

Packaging

The core EnlightenSDK package contains the build tools, API documentation, third party libraries and public headers for all platforms. It also contains the most common Windows binaries and libraries. Support for additional platforms are supplied in Overlays; additional zip files that are extracted to the same root folder. These Overlays include the WindowsExtra package, which includes the less common versions of the Windows libraries (all Checked and Static builds).

There are a small subset of platforms whose NDA requires that all mention of them be removed from code that is sent to unapproved developers; the packages for these include modified headers that replace those in the EnlightenSDK baseline. Usage is identical; it should be extracted to the same root folder and you must select the 'overwrite existing files' option when indicated.

External libraries

When you run the CodeBuildTool for the first time, it reports any missing libraries in the output. Libraries are found by looking for environment variables, such as DXSDK_DIR. If any are not set, or set incorrectly, they will be reported and the build will stop.

Sample Framework tools

In order to rebuild the shaders and related support files for the Sample Framework applications, there are some platform-specific tools included in the distribution. As long as the individual platform support packages are extracted over the SDK, these should be found automatically.

C# compiler warnings

The MSBuild environment of Visual Studio expects you to have selected the ATL/MFC components during installation, and adds these paths to the C++ linker path. When we build C# projects from the C++ project, we inherit these paths. Even though the C# compiler doesn't use them, it checks all the entries in $(LibraryPath) and quits if any are missing. The possible fixes are:

  • Build from the command line rather than Visual Studio, or
  • Clear the Library directories of the GeoRadiosity/GeoPrecomp2/etc projects in Visual Studio (right-click project, VC++ Directories), or
  • Install the ATL/MFC components, or
  • Create an empty directory at the location specified

IDE usage

The Visual Studio solution provided can build all the above target configurations, but it may be necessary for you to edit a configuration file if you wish to use a specific toolset. For example, in the solution window there is only one entry for Win32, so we provide a mapping for what toolset to use in the BuildTools/Geomerics.Cpp.props file. If you change here what $(Platform)=='Win32' equates to, you can build VS2012 from VS2010 and vice-versa. Note that we do not automatically change the toolset we compile with when you change IDEs.

Compilation flags

You can see the exact command line used, and therefore all options passed to the compiler, by setting an environment variable before the build:

CD /d E:\Enlighten_3.xx
SET geo.PrintDebugInfo=true
BuildTools\CodeBuildTool build DEBUG_WIN32_2010 Projects\GeoRadiosity\GeoRadiosity.vcxproj

This allows you to inspect all flags and #defines passed to the compiler, as well as any library locations found.

For advanced debugging, .cmd batch files can be found in the build/Intermediate folder. The build generates these files for each tool (compiler/linker/etc.) invocation. These files show the exact command line used, but note that they are a side-effect of the dependency tracking system and are written (but not executed) on each run.