Skip to content

Doku lacks information how to build/activate build of ODBC driver #74

Closed

Description

@shinguz

Doku lacks information how to build/activate build of ODBC driver

can you please elaborate how to compile/active clickhouse odbc driver in the doku?

https://github.com/yandex/ClickHouse/tree/32057cf2afa965033cf850a081e7a9dfa306594d/dbms/src/ODBC

Activity

  1. alexey-milovidov commented on Aug 15, 2016

    @alexey-milovidov
    Member

    ODBC driver is not ready for production usage.
    You should build ODBC driver only if you are going to participate in development.

    Quick description:

    ODBC driver is completely isolated from the rest of code base. All its sources are located in dbms/src/ODBC directory and build separately. This is intended to minimize dependencies and allow to build on multiple platforms (Linux, Windows, Mac, Android, etc.)
    It would be relatively easy to build and contribute because of small isolated code base.

    To build on Linux, use instructions from build.sh file.
    To install and test, see README.

    It has very verbose logging by default (for development), you could disable in Log.h

    Current status: driver tested and works with following programs:
    isql
    Tora
    Libreoffice Base
    Poco::Data::ODBC library

    Only SELECTs was tested.

  2. shinguz commented on Aug 15, 2016

    @shinguz
    Author

    Thanks Alexey for the info!

    But this is too short for me. I am not a dev. I came so far but stuck:

    cd ClickHouse-master/contrib/libpoco
    ./configure --static --config=Linux
    Unknown configuration: Linux
    Please use the --config option to specify another build configuration
    The following configurations are available:
    ls: cannot access /tmp/ClickHouse-master/contrib/libpoco/build/config: No such file or directory

    sudo apt-get install libpoco-dev unixodbc-dev
    cd ClickHouse-master/dbms/src/ODBC
    ./build.sh
    In file included from ResultSet.cpp:2:0:
    Statement.h: In member function ‘void Statement::sendRequest()’:
    Statement.h:49:23: error: ‘class Poco::Net::HTTPClientSession’ has no member named ‘reset’
    connection.session.reset();
    ^

    So I assume the 2nd problem is caused by the first one...

  3. alexey-milovidov commented on Aug 16, 2016

    @alexey-milovidov
    Member

    ODBC sources is build with 'stock' Poco library.

    Install 'stock' version of Poco:

    wget http://pocoproject.org/releases/poco-1.7.4/poco-1.7.4.tar.gz
    cd poco-1.7.4
    
    mcedit build/config/Linux
    

    add -fPIC to STATICOPT_CC and STATICOPT_CXX

    ./configure --static --config=Linux
    make -j24
    sudo make install
    

    Install latest version of unixodbc:

    wget ftp://ftp.unixodbc.org/pub/unixODBC/unixODBC-2.3.4.tar.gz
    tar xf unixODBC-2.3.4.tar.gz
    cd unixODBC-2.3.4/
    ./configure
    make -j24
    sudo make install
    

    Then go to dbms/src/ODBC directory and run:

    ./build.sh
    

    After this step, you will get odbc.so file, which is the ODBC driver.

  4. alexey-milovidov commented on Dec 26, 2017

    @alexey-milovidov
    Member

    ODBC driver is moved to separate repository:
    https://github.com/yandex/clickhouse-odbc

    There you will find all details about building on Linux, Windows, Mac.

  5. added a commit that references this issue on Jun 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions