IMPORTANT, this worked with CH stable (76629e9) version on 2019/02/14
from the original osx build doc page https://clickhouse.yandex/docs/en/development/build_osx.html
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
...