clickhouse-odbc icon indicating copy to clipboard operation
clickhouse-odbc copied to clipboard

Driver error on mac M1 Big sur 11.4

Open dimaaasex91 opened this issue 4 years ago • 6 comments

Hi,

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

dimaaasex91 avatar Jun 29 '21 15:06 dimaaasex91

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

traceon avatar Jun 29 '21 23:06 traceon

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.

evmnaumov avatar Jun 30 '21 09:06 evmnaumov

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

Spar9a avatar Jul 01 '21 13:07 Spar9a

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.

zmchary avatar Nov 02 '21 05:11 zmchary

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

tarunparmar avatar May 19 '22 22:05 tarunparmar

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.

zmchary avatar Sep 23 '22 06:09 zmchary