# Typical Configurations

> ## Preprocessor defines

> The eXtremeDB/rt sources should be compiled with a set of C preprocessor defines that describe the hardware and operating system configuration.

> These defines fall into several groups (explained below):

>         [x64] OS Hardware Debugging [Minicore]

> ### x64

> - (should be defined for 64 bit platforms) `MCO_PLATFORM_X64`

> ### OS

> - `_LINUX`
> - `_MACOS`
> - `_WIN32`
> - `_ZEPHYR`
> - `_FREERTOS`
> - `_LYNX`
> - `_INTEGRITY`
> - `_THREADX`
> - `_UCOS`
> - `_VXWORKS`
> - `_QNX`
> - `_ECOS`
> - `_NETOS`

> ### Hardware

> - `_Ix86`
> - `_ARM32` (applicable to 64 bits, too)
> - `_MIPS`
> - `_PPC`
> - `_XTENZA`

> ### Debugging

> Build Modes

> The eXtremeDB/rt runtime is typically built in two modes:

> Debug Mode – should enable the compiler’s debugging facilities and at least MCO_CFG_CHECKLEVEL_1 (preferably both levels 1 and 2). This configuration helps developers detect and resolve issues during development.

> `DEBUG MCO_CFG_CHECKLEVEL_1 MCO_CFG_CHECKLEVEL_2`

> Release Mode – provides the best performance and minimizes code, data, and stack footprint. This mode should be used only when the developer is confident that the application is stable and ready for production.

> `NDEBUG MCO_CFG_CHECKLEVEL`

> Application and Database kernel integrity checks

> The eXtremeDB/rt runtime includes additional verification procedures to ensure the integrity of both code and data. These checks are enabled by defining `MCO_CFG_CHECKLEVEL_x` on the compiler command line (either directly or as part of the project settings).

> - If no `MCO_CFG_CHECKLEVEL_x` are defined, all additional verifications are disabled; only basic runtime validation of API input parameters is performed. This configuration corresponds to the Release build Mode
> - `MCO_CFG_CHECKLEVEL_1` enables quick checks of the database API input parameters. This helps catch invalid data passed by the application (using the fatal error handler instead of error codes that might be overlooked), invalid internal data structures, and potential invalid pointers or stack overflows.
> - `MCO_CFG_CHECKLEVEL_2` enables kernel-level consistency checks of internal structures such as page chains, heaps, and memory allocators. These checks greatly improve robustness but may increase execution time and reduce overall database performance.

> ### Minicore

> When eXtremeDB/rt is compiled with `MCO_CFG_MINIMAL` define, some core features are limited (for example, the maximal number of database instances) or excluded (for example, statistics collection) from the build in order to minimize the code footprint. Please refer to `if(n)def MCO_CFG_MINIMAL` in target/mcolib/mcocfg.h, target/mcolib/mcodisk.h, include/mco.h for the details.

> ## Examples

> ### FreeRTOS on a 32 bits ARM processor without debugging and with minicore:

>         _FREERTOS _ARM32 MCO_CFG_MINIMAL NDEBUG

> ### Linux on a x86 processor, 64 bits, debugging enabled:

>         _LINUX MCO_PLATFORM_X64 _Ix86 DEBUG MCO_CFG_CHECKLEVEL MCO_CFG_CHECKLEVEL_1 MCO_CFG_CHECKLEVEL_2 MCO_CFG_CHECKLEVEL_3 MCO_CFG_CHECKLEVEL_1 MCO_CFG_CHECKLEVEL_2 MCO_CFG_CHECKLEVEL_3 MCO_CFG_CHECKLEVEL_PIN MCO_DEBUG_DISK_CACHE