Menu
Simba Technologies
Simba Technologies

SimbaEngine X SDK 10.1.3
Developing Drivers for Data Stores Without SQL

SimbaEngine X SDK Documentation > Building Your Driver > C++ on Linux, Unix, and MacOS

C++ on Linux, Unix, and MacOS

The SimbaEngine X SDK include a sample makefile with each of the sample driver projects. You can use this makefile to build the sample driver, then use it as a template for creating a makefile for your custom driver.

Note:

We recommend that you use the script mk.sh in the Source directory of your sample driver project. It is not recommended to use the makefile directly.

Build Configurations

The sample makefiles include targets for both debug and release versions of the drivers and the SimbaServer. The output location, or file path, indicates the bitness, compiler, and platform version. For example, when the debug version of the Quickstart driver is build on a 64-bit Linux machine with the gcc compiler, the resulting shared object is located in:

.../Bin/Linux_x86_gcc/debug64/libQuickstart64.so

Default Settings in the Sample Makefile

To help you compile and build the sample drivers on a variety of machines, the sample shell script and sample makefiles automatically detect your machine's operating system, bitness, and default compiler, then use the appropriate settings to run the build. By default, the makefiles build a release version that is dynamically linked to dependencies.

You can override these default settings by specifying them in the mk.sh command line, or by setting them as environment variables.

Changing the version of XCode on macOS

By default, on macOS the sample makefile detects the highest available version of the XCode compiler, and uses that to build the sample drivers. If you download a different version of the SimbaEngine X SDK, you must set the active developer directory to match.

Example:

Assume you have both XCode 6 and XCode 7 on your machine, and you download the XCode 6 version of the SimbaEngine X SDK. The sample makefile tries to use the XCode7 compiler, but this fails. Set the environment variable DEVELOPER_DIR to configure the active developer directory:

export DEVELOPER_DIR=/Application/Xcode6.1.app

Overriding Default Settings

The following table describes the options that you can use to override the default behaviour of the sample makefiles. Multiple options are allowed, for example:

./mk.sh MODE=debug BITS=32

Option Description

BUILDSERVER

Set to 1 to build a server (.exe) instead of a driver (.so or .dylib). By default, a driver is built.

Example:

./mk.sh BUILDSERVER=1

CXX

On Solaris, specify the compiler to use. Allowed values are the name of the compiler, for example g++, g++44, or g++59.

Example:

./mk.sh CXX=g++59

SDK_

Specifies the subpath to the dependencies. This value is autodetected by default, but you can override it.

The path where the dependencies are installed contains architecture information and the compiler version. For example, the lCU libraries might be installed at ThirdParty/icu/53.1/centos5/gcc4_4. The SimbaEngine X SDK autodetects this information to allow your driver to use the correct dependencies. You can override this information to specify dependencies in a different location.

Example:

./mk.sh SDK_=Darwin/xcode7_2

MODE

Set to debug to build the debug version of the driver. By default, the release version of the driver is built.

Example:

./mk.sh MODE=debug

BITS

Specifies the bitness of the driver you wish to build. By default, the makefiles build a driver that matches the bitness of your operating system, but you can override this option. For example, when building on a 64-bit platform, you can use this option to specify a 32-bit driver.

Allowed values are 32, 64, and 3264.

Use 3264 to indicate an OSX universal binary that combines 32 and 64 bit code.

Example:

./mk.sh BITS=32

ICU_STATIC

Set to 1 to statically link to the ICU library. By default, the makefiles build a driver that dynamically links to the ICU library.

Example:

./mk.sh ICU_STATIC=1

OPENSSL_STATIC

Set to 1 to statically link to the OpenSSL library. By default, the makefiles build a driver that dynamically links to the OpenSS library.

Example:

./mk.sh ICU_STATIC=1

Build an ODBC Driver (a Shared Object) for Local Connections

This section describes the settings you can use to build your custom ODBC driver for local connections (that is, not as a SimbaServer). You can build with or without the Simba SQLEngine. This section references the core makefile for the sample drivers, ${SIMBAENGINE_DIR}/Makefiles/kit.mk.

Note:

For each of the steps below, be sure to include the correct libraries for the compiler, bitness, and release/debug configuration.

  1. Set the compiler and linker to build a shared object. The exact option depends on the compiler.
  2. Include the Simba Core SDK libraries, as specified by the variable CORESDK.a in the file ${SIMBAENGINE_DIR}/Makefiles/kit.mk. Be sure to include the correct libraries for the compiler, bitness, and release/debug configuration. For example:
    • libCore.a
    • libSimbaDSI.a
    • libSimbaSupport.a
  3. Include the Simba ODBC libraries, as specified by the variable ODBCSDK.a. For example:
    • libSimbaODBC.a
  4. If your driver uses the SQL Engine, include the SQL Engine libraries, as specified by the variable SQLENGINE.a. For example:
    • libAEProcessor.a
    • libDSIExt.a
    • libExecutor.a
    • libParser.a
  5. Include the Core SDK include paths, as specified by the variable CORESDK_CPPFLAGS. For example:
    • ${SIMBAENGINE_DIR}/Include/DSI
    • ${SIMBAENGINE_DIR}/Include/DSIClient
    • ${SIMBAENGINE_DIR}/Include/Support
    • ${SIMBAENGINE_DIR}/Include/Support/Exceptions
    • ${SIMBAENGINE_DIR}/Include/Support/TypedDataWrapper
    • ${SIMBAENGINE_DIR}/ThirdParty/odbcheaders
  6. Include the ICU include paths, as specified by the variable ICU_LDLIBS. The path and file name contain version, bitness, and release/debug information. For example:
    • ${SIMBAENGINE_DIR}hirdParty/icu/53.1.x/Linux_x86_gcc/release64/lib
  7. If your driver uses the SQL Engine, include the SQL Engine and expat include paths, as specified by the variables SQLENGINE_CPPFLAGS and EXPAT_FLAGS in the kit.mk file. Note that the Expat directory contains a version number. For example:
    • ${SIMBAENGINE_DIR}/Include/SQLEngine
    • ${SIMBAENGINE_DIR}/Include/SQLEngine/AETree
    • ${SIMBAENGINE_DIR}/Include/SQLEngine/DSIExt
    • ${SIMBAENGINE_DIR}/Include/ThirdParty/Expat/2.2.0

Build as a SimbaServer (an EXE) for Remote Connections

This section describes the settings you can use to build your custom ODBC driver as a SimbaServer. You can build with or without the Simba SQLEngine. This section references the core makefile for the sample drivers, ${SIMBAENGINE_DIR}/Makefiles/kit.mk.

Note:

For each of the steps below, be sure to include the correct libraries for the compiler, bitness, and release/debug configuration.

  1. Set the compiler and linker to build an application (.exe). The exact option depends on the compiler.
  2. Include the Simba Core SDK libraries, as specified by the variable CORESDK.a in the file ${SIMBAENGINE_DIR}/Makefiles/kit.mk. Be sure to include the correct libraries for the compiler, bitness, and release/debug configuration. For example:
    • libCore.a
    • libSimbaDSI.a
    • libSimbaSupport.a
  3. Include the Simba Server libraries, as specified by the variable SERVERSDK.a. For example:
    • libSimbaCSCommon.a
    • libSimbaServer.a
    • libSimbaServerMain.a
  4. If your driver uses the SQL Engine, include the SQL Engine libraries, as specified by the variable SQLENGINE.a. For example:
    • libAEProcessor.a
    • libDSIExt.a
    • libExecutor.a
    • libParser.a
  5. Include the Core SDK include paths, as specified by the variable CORESDK_CPPFLAGS. For example:
    • ${SIMBAENGINE_DIR}/Include/DSI
    • ${SIMBAENGINE_DIR}/Include/DSIClient
    • ${SIMBAENGINE_DIR}/Include/Support
    • ${SIMBAENGINE_DIR}/Include/Support/Exceptions
    • ${SIMBAENGINE_DIR}/Include/Support/TypedDataWrapper
    • ${SIMBAENGINE_DIR}/ThirdParty/odbcheaders
  6. Include the Server SDK include paths, as specified by the variable SERVERSDK_CPPFLAGS. For example:
    • ${SIMBAENGINE_DIR}/Include/Server
  7. Include the ICU include paths, as specified by the variable ICU_LDLIBS. The path and file name contain version, bitness, and release/debug information. For example:
    • ${SIMBAENGINE_DIR}/ThirdParty/icu/53.1.x/Linux_x86_gcc/release64/lib
  8. Include the Open SLL include paths, as specified by the variable OPENSSL_LDLIBS. The path and file name contain version, bitness, and release/debug information. For example:
    • ${SIMBAENGINE_DIR}/ThirdParty/openssl/1.1.0/Linux_x86_gcc/release64/lib
  9. If your driver uses the SQL Engine, include the SQL Engine and expat include paths, as specified by the variables SQLENGINE_CPPFLAGS and EXPAT_FLAGS in the kit.mk file. Note that the Expat directory contains a version number. For example:
    • ${SIMBAENGINE_DIR}/Include/SQLEngine
    • ${SIMBAENGINE_DIR}/Include/SQLEngine/AETree
    • ${SIMBAENGINE_DIR}/Include/SQLEngine/DSIExt
    • ${SIMBAENGINE_DIR}/Include/ThirdParty/Expat/2.2.0

 

Related Links

5 Day Guides at http://www.simba.com/resources/sdk/documentation/

SimbaClientServer User Guide at http://www.simba.com/resources/sdk/documentation/