Skip to content

Instantly share code, notes, and snippets.

@javisantana
Last active May 21, 2019 10:00
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save javisantana/66030b7c4a45267924c403ab9d10d153 to your computer and use it in GitHub Desktop.
Save javisantana/66030b7c4a45267924c403ab9d10d153 to your computer and use it in GitHub Desktop.
how to build clickhouse on osx high sierra

IMPORTANT, this worked with CH stable (76629e9) version on 2019/02/14

install requirements

from the original osx build doc page https://clickhouse.yandex/docs/en/development/build_osx.html

build clickhouse

Add /usr/local/include to the default path for gcc (for some reason gcc-7 was not using that folder on osx)

export C_INCLUDE_PATH=/usr/local/include
export CPLUS_INCLUDE_PATH=/usr/local/include

In order to workaround a syslog.h bug introduced in high sierra you need to add some compiler flags. unixodbc library also need to be

usr/local/Cellar/cmake/3.10.2/bin/cmake .. -DCMAKE_CXX_COMPILER=/usr/local/bin/g++-7 -DCMAKE_C_COMPILER=/usr/local/bin/gcc-7 -DCOMPILER_FLAGS="-mmacosx-version-min=10.12 -lodbc -L/usr/local/Cellar/unixodbc/2.3.1/lib"  -DODBC_INCLUDE_DIRECTORIES=/usr/local/Cellar/unixodbc/2.3.1/include/ -DODBC_LIBRARIES=/usr/local/Cellar/unixodbc/2.3.1/lib

run make

make -j `sysctl -n hw.ncpu`

test if everything worked:

➜ sudo ./dbms/src/Server/clickhouse server --config ../dbms/src/Server/config.xml
Include not found: clickhouse_remote_servers
Include not found: clickhouse_compression
Should logs to /var/log/clickhouse-server/clickhouse-server.log
Should error logs to /var/log/clickhouse-server/clickhouse-server.err.log
Logging to console
2018.02.14 10:41:33.462616 [ 1 ] <Information> : Starting daemon with revision 54342
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment