Before you can build MariaDB Connector/ODBC, you need to have the following tools installed:
cmake
git
a C compiler - (i.e. Visual Studio on Windows or gcc on Unix-like platforms)
There are no other build dependencies on Windows.
On Unix-like platforms, you also need to have the following tools installed:
make
- libraries and development headers
If you want your build to support on Unix-like platforms, then you also need to have the following tools installed:
- libraries and development headers
On Linux, you may need to run one of following commands to install these dependencies.
For example, the following command would install the necessary packages on RHEL, CentOS, and similar Linux distributions:
And the following command would install the necessary packages on Debian, Ubuntu, and similar Linux distributions:
We recommend that you build from the git repository rather than from a source package.
If you are building from the git repository, then your next step would be to clone a local copy of the MariaDB Connector/ODBC source code from the git repository.
The git repository is available on GitHub:
You can clone it by executing the command like the following:
If you want to build a specific revision or version of MariaDB Connector/ODBC, then you will need to checkout the specific branch or tag by executing the command like the following:
This example will put your source tree into the 3.0.8 version state.
You can build MariaDB Connector/ODBC by executing the command like the following:
To install a freshly built MariaDB Connector/ODBC on Windows, execute the following:
Or to install it on Unix-like platforms, execute the following:
Building MariaDB Connector/ODBC from a source package is a bit different than building it from the git repository. The source package comes without source code. And in order to build MariaDB Connector/ODBC, you need to download MariaDB Connector/C source separately and then copy it into the 'libmariadb' subdirectory in the root of the MariaDB Connector/ODBC source tree. Other steps are all the same as for building from git checkout.
Also, it should be possible to build from source package using the MariaDB Connector/C headers and library installed on your system. You need to ensure that the appropriate MariaDB Connector/C version is installed. Most probably you will need to point your compiler and/or linker to the location of the MariaDB Connector/C headers and/or library. e.g.
sudo yum install git cmake make gcc openssl openssl-devel unixODBC unixODBC-develsudo apt-get update
sudo apt-get install git cmake make gcc libssl-dev unixodbc odbcinst unixodbc-devgit clone https://github.com/MariaDB/mariadb-connector-odbc.git
cd mariadb-connector-odbcgit checkout 3.0.8cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCONC_WITH_UNIT_TESTS=Off -DCONC_WITH_MSI=OFF -DCMAKE_INSTALL_PREFIX=/usr/local .
cmake --build . --config RelWithDebInfomsiexec.exe /i wininstall\mariadb-connector-odbc-3.0.8-win32.msisudo make installcmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCONC_WITH_UNIT_TESTS=Off -DCMAKE_C_FLAGS_RELWITHDEBINFO="-I/usr/local/incude/mariadb -L/usr/local/lib" .