ClickHouse / clickhouse-odbc

ODBC driver for ClickHouse
https://clickhouse.tech
Apache License 2.0
245 stars 86 forks source link

Driver error on mac M1 Big sur 11.4 #363

Open dimaaasex91 opened 3 years ago

dimaaasex91 commented 3 years ago

Hi,

I have driver error on mac M1 Big sur 11.4 image (1) Can you help me?

traceon commented 3 years ago

Try verifying that the driver is installed and DNS is configured correctly, using iodbctest utility (comes with libiodbc.)

evmnaumov commented 3 years ago

Hi! You must build the driver for x86 arch, because you use Tableau under Rosetta2.

First install Homebrew on x86 arch: arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

Then: export PATH="/usr/local/Homebrew/bin:$PATH" - needs to use x86 arch Homebrew

Now, you can follow steps from instruction:

brew install git cmake make poco openssl icu4c libiodbc (or unixodbc if necessary instead libiodbc)

git clone --recursive https://github.com/ClickHouse/clickhouse-odbc.git

cd clickhouse-odbc && mkdir build && cd build

cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DOPENSSL_ROOT_DIR=$(brew --prefix)/opt/openssl -DICU_ROOT=$(brew --prefix)/opt/icu4c -DBUILD_TESTING=OFF ..

-DBUILD_TESTING=OFF - works for me, while building on BigSur. Crashed without it.

cmake --build . --config RelWithDebInfo cmake --build . --config RelWithDebInfo --target package

That's all.

Spar9a commented 3 years ago

Hi! You must build the driver for x86 arch, because you use Tableau under Rosetta2.

First install Homebrew on x86 arch: arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

Then: export PATH="/usr/local/Homebrew/bin:$PATH" - needs to use x86 arch Homebrew

Now, you can follow steps from instruction:

brew install git cmake make poco openssl icu4c libiodbc (or unixodbc if necessary instead libiodbc)

git clone --recursive https://github.com/ClickHouse/clickhouse-odbc.git

cd clickhouse-odbc && mkdir build && cd build

cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DOPENSSL_ROOT_DIR=$(brew --prefix)/opt/openssl -DICU_ROOT=$(brew --prefix)/opt/icu4c -DBUILD_TESTING=OFF ..

-DBUILD_TESTING=OFF - works for me, while building on BigSur. Crashed without it.

cmake --build . --config RelWithDebInfo cmake --build . --config RelWithDebInfo --target package

That's all.

Also, for successful build you need use arch -x86_64 prefix for every next command:

arch -x86_64 brew install git cmake make poco openssl icu4c libiodbc

arch -x86_64 cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DOPENSSL_ROOT_DIR=$(brew --prefix)/opt/openssl -DICU_ROOT=$(brew --prefix)/opt/icu4c -DBUILD_TESTING=OFF ..

arch -x86_64 cmake --build . --config RelWithDebInfo

zmchary commented 2 years ago

If you are using iODBC under Apple Silicon M1, just run

arch -x86_64 /usr/local/bin/brew install clickhouse-odbc

CleanShot 2021-11-02 at 13 40 33@2x

In iODBC Administrator64 which is running under Rosetta2, you can see the right version number instead of ##.## and the driver path is in /usr/local/Cellar which installed by brew under Rosetta2.

That's all.

tarunparmar commented 2 years ago

brew installed driver at location in Cellar but the iODBC manager does not show it , does it have to be installed by admin privilege ?

zmchary commented 1 year ago

brew installed driver at location in Cellar but the iODBC manager does not show it , does it have to be installed by admin privilege ?

Did you check your iODBC manager version? As showed in the picture, it should be Intel 64bit, then click Add a driver to add the driver installed by brew.