Please note - git submodules are used in this project.
When you clone such a project, by default you get the directories that contain submodules, but none of the files within them. So, in order to build the project, you need either:
- clone repo with all submodules altogether (use
--recursive)
git clone --recursive https://github.com/yandex/clickhouse-odbc- or add submodules manually after main project cloned - in the root of source tree run:
git submodule init && git submodule updateYou'll need to have installed:
- Fresh C compiler, which understands -std=c++14
- Static libraries
- static libgcc
- static libstdc++
- static libodbc
- cmake >= 3
CentOS is shipped with gcc 4.X, which is not suitable for this task. Fedora and CentOS do not have static libodbc provided, so you'll need either to build your own, or download 3-rd party packages. Static libodbc is available for Fedora 25 and Fedora 26. If you are running another OS, you can try to build your own RPMs from this project.
Install unixodbc >= 2.3.0
sudo apt install unixodbc-dev- At the root of source directory:
mkdir -p build; cd build && cmake .. && make -j $(nproc || sysctl -n hw.ncpu || echo 2)- clickhouse-odbc.so will be at
build/driver/clickhouse-odbc.so
vim ~/.odbc.ini:
[ClickHouse]
Driver = $(PATH_OF_CLICKHOUSE_ODBC_SO)
Description = ClickHouse driver
DATABASE = default
SERVER = localhost
PORT = 8123
FRAMED = 0
Run isql -v ClickHouse