Clickhouse: An official OS X Homebrew formula/tap

Created on 9 Dec 2016  路  4Comments  路  Source: ClickHouse/ClickHouse

A while ago I tried to create a formula for clickhouse.
It worked for me on 10.11.5 and 1.1.54074, but it wasn't accepted by the maintainers.

Their notes were:

This [ClickHouse?] and Boost need to be build using Clang.
Are unixodbc / glib / libtool / gettext linked to at runtime?
more convenient make install
Why max_open_files isn't default? (I'm not sure what's the default value for Linux builds)

See https://github.com/Homebrew/homebrew-core/pull/7222 for more details.

If it's not possible/takes a lot of work to make it compatible with the current state of the project, I guess, there are two things that could be optimal, either:

1) Create a bottled-only formula (package) - precompile Clickhouse for multiple OS X versions and publish it to the official homebrew repository. The contents of the formula would be just like https://github.com/excitoon/homebrew-clickhouse/blob/master/clickhouse-client.rb. Not sure if maintainers would accept it.

or:

2) Create a tap (repository) inside of the Yandex namespace (a yandex/homebrew-clickhouse github repository) so it won't depend on homebrew's requirements/guidelines.

build comp-ci comp-darwin

Most helpful comment

Now we have pre-built ClickHouse binary for OS X.

It does not solve the issue completely, but now we build it for every commit and every pull request in our CI with cross-compilation. This helps to ensure that native OS X build does not break after some commit. You can download the binary and use it directly as a client or server.

How to download:

There are still many things to do:

  1. It does not support SSL, ICU and readline.
  2. Publish download link on official site.
  3. Add .tgz package instead of plain binary.

All 4 comments

Recently tried building the latest on Mac (_10.13.6_) but got the following error
steps:

1. cmake .. -DCMAKE_CXX_COMPILER=g++-8 -DCMAKE_C_COMPILER=gcc-8
2. ninja

also tried,
cmake .. -DCMAKE_CXX_COMPILER=g++-8 -DCMAKE_C_COMPILER=gcc-8 -DENABLE_EMBEDDED_COMPILER=0 -DUSE_INTERNAL_LLVM_LIBRARY=0

[2880/3324] FAILED: dbms/src/Functions/CMakeFiles/clickhouse_functions.dir/FunctionsGeo.cpp.o /usr/local/bin/g++-8 -DBOOST_SYSTEM_NO_DEPRECATED -DLZ4_DISABLE_DEPRECATE_WARNINGS=1 -DPOCO_STATIC -DPOCO_UNBUNDLED_ZLIB -DUNALIGNED_OK -DWITH_GZFILEOP -DX86_64 -DZLIB_COMPAT -I../dbms/src -Idbms/src -I../libs/libcommon/include -Ilibs/libcommon/include -I../contrib/zlib-ng -Icontrib/zlib-ng -I../contrib/cityhash102/include -I../contrib/croaring -I../libs/consistent-hashing -I../libs/consistent-hashing-sumbur -I../contrib/libfarmhash -I../contrib/murmurhash/include -I../contrib/simdjson/include -isystem ../contrib/libdivide -isystem ../contrib/libmetrohash/src -isystem /usr/local/opt/icu4c/include -isystem ../contrib/base64/include -isystem ../contrib/lz4/lib -isystem ../contrib/hyperscan/src -isystem ../contrib/rapidjson/include -isystem ../contrib/pdqsort -isystem ../contrib/libpcg-random/include -isystem ../contrib/double-conversion -isystem ../contrib/re2 -isystem ../contrib/poco/Foundation/include -isystem ../contrib/boost -isystem ../contrib/poco/Net/include -isystem ../contrib/poco/Util/include -isystem ../contrib/poco/XML/include -isystem ../contrib/poco/JSON/include -isystem contrib/re2_st -isystem ../contrib/ssl/include -fdiagnostics-color=always -pipe -msse4.1 -msse4.2 -mpopcnt -fno-omit-frame-pointer -Wall -Wnon-virtual-dtor -Wextra -Werror -O2 -g -DNDEBUG -O3 -fno-tree-loop-distribute-patterns -g0 -std=c++17 -MD -MT dbms/src/Functions/CMakeFiles/clickhouse_functions.dir/FunctionsGeo.cpp.o -MF dbms/src/Functions/CMakeFiles/clickhouse_functions.dir/FunctionsGeo.cpp.o.d -o dbms/src/Functions/CMakeFiles/clickhouse_functions.dir/FunctionsGeo.cpp.o -c ../dbms/src/Functions/FunctionsGeo.cpp ../dbms/src/Functions/FunctionsGeo.cpp: In member function 'virtual void DB::FunctionGeohashEncode::executeImpl(DB::Block&, const ColumnNumbers&, size_t, size_t)': ../dbms/src/Functions/FunctionsGeo.cpp:339:117: error: no matching function for call to 'min(const size_t&, long long unsigned int)' arguments.size() == 3 ? block.getByPosition(arguments[2]).column->get64(0) : GEOHASH_MAX_TEXT_LENGTH); ^ In file included from /usr/local/Cellar/gcc@8/8.3.0/include/c++/8.3.0/memory:62, from ../dbms/src/Functions/IFunction.h:3, from ../dbms/src/Functions/FunctionFactory.h:3, from ../dbms/src/Functions/FunctionsGeo.cpp:1: /usr/local/Cellar/gcc@8/8.3.0/include/c++/8.3.0/bits/stl_algobase.h:195:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' min(const _Tp& __a, const _Tp& __b) ^~~ /usr/local/Cellar/gcc@8/8.3.0/include/c++/8.3.0/bits/stl_algobase.h:195:5: note: template argument deduction/substitution failed: ../dbms/src/Functions/FunctionsGeo.cpp:339:117: note: deduced conflicting types for parameter 'const _Tp' ('long unsigned int' and 'long long unsigned int') arguments.size() == 3 ? block.getByPosition(arguments[2]).column->get64(0) : GEOHASH_MAX_TEXT_LENGTH); ^ In file included from /usr/local/Cellar/gcc@8/8.3.0/include/c++/8.3.0/memory:62, from ../dbms/src/Functions/IFunction.h:3, from ../dbms/src/Functions/FunctionFactory.h:3, from ../dbms/src/Functions/FunctionsGeo.cpp:1: /usr/local/Cellar/gcc@8/8.3.0/include/c++/8.3.0/bits/stl_algobase.h:243:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' min(const _Tp& __a, const _Tp& __b, _Compare __comp) ^~~ /usr/local/Cellar/gcc@8/8.3.0/include/c++/8.3.0/bits/stl_algobase.h:243:5: note: template argument deduction/substitution failed: ../dbms/src/Functions/FunctionsGeo.cpp:339:117: note: deduced conflicting types for parameter 'const _Tp' ('long unsigned int' and 'long long unsigned int') arguments.size() == 3 ? block.getByPosition(arguments[2]).column->get64(0) : GEOHASH_MAX_TEXT_LENGTH); ^ In file included from /usr/local/Cellar/gcc@8/8.3.0/include/c++/8.3.0/algorithm:62, from ../dbms/src/Core/Field.h:4, from ../dbms/src/Functions/IFunction.h:7, from ../dbms/src/Functions/FunctionFactory.h:3, from ../dbms/src/Functions/FunctionsGeo.cpp:1: /usr/local/Cellar/gcc@8/8.3.0/include/c++/8.3.0/bits/stl_algo.h:3450:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(std::initializer_list<_Tp>)' min(initializer_list<_Tp> __l) ^~~ /usr/local/Cellar/gcc@8/8.3.0/include/c++/8.3.0/bits/stl_algo.h:3450:5: note: template argument deduction/substitution failed: ../dbms/src/Functions/FunctionsGeo.cpp:339:117: note: mismatched types 'std::initializer_list<_Tp>' and 'long unsigned int' arguments.size() == 3 ? block.getByPosition(arguments[2]).column->get64(0) : GEOHASH_MAX_TEXT_LENGTH); ^ In file included from /usr/local/Cellar/gcc@8/8.3.0/include/c++/8.3.0/algorithm:62, from ../dbms/src/Core/Field.h:4, from ../dbms/src/Functions/IFunction.h:7, from ../dbms/src/Functions/FunctionFactory.h:3, from ../dbms/src/Functions/FunctionsGeo.cpp:1: /usr/local/Cellar/gcc@8/8.3.0/include/c++/8.3.0/bits/stl_algo.h:3456:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(std::initializer_list<_Tp>, _Compare)' min(initializer_list<_Tp> __l, _Compare __comp) ^~~ /usr/local/Cellar/gcc@8/8.3.0/include/c++/8.3.0/bits/stl_algo.h:3456:5: note: template argument deduction/substitution failed: ../dbms/src/Functions/FunctionsGeo.cpp:339:117: note: mismatched types 'std::initializer_list<_Tp>' and 'long unsigned int' arguments.size() == 3 ? block.getByPosition(arguments[2]).column->get64(0) : GEOHASH_MAX_TEXT_LENGTH); ^ [216/651] Building CXX object dbms/src/Functions/CMakeFiles/clickhouse_functions.dir/FunctionsJSON.cpp.o

@pramitchoudhary Were you able to get rid of this issue

Now we have pre-built ClickHouse binary for OS X.

It does not solve the issue completely, but now we build it for every commit and every pull request in our CI with cross-compilation. This helps to ensure that native OS X build does not break after some commit. You can download the binary and use it directly as a client or server.

How to download:

There are still many things to do:

  1. It does not support SSL, ICU and readline.
  2. Publish download link on official site.
  3. Add .tgz package instead of plain binary.

Pre-built binaries are published in docs: https://clickhouse.tech/docs/en/getting-started/install/#from-binaries-non-linux

Was this page helpful?
0 / 5 - 0 ratings

Related issues

opavader picture opavader  路  3Comments

vixa2012 picture vixa2012  路  3Comments

bseng picture bseng  路  3Comments

jimmykuo picture jimmykuo  路  3Comments

healiseu picture healiseu  路  3Comments