Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build from source without Boost? #456

Closed
benwills opened this issue Nov 24, 2020 · 3 comments
Closed

Build from source without Boost? #456

benwills opened this issue Nov 24, 2020 · 3 comments

Comments

@benwills
Copy link

benwills commented Nov 24, 2020

Operating System: Ubuntu 20.04
Source Code URL: https://github.com/manticoresoftware/manticoresearch/archive/3.5.2.tar.gz

The documentation references Boost needing to be used by Galera: https://manual.manticoresearch.com/Installation/Compiling_from_sources#Available-features-and-their-dependencies

I'm trying to build a fairly minimal install from source and don't need replication. For build options, I've referenced the documentation for building from source, https://github.com/manticoresoftware/manticoresearch/blob/master/config/config_cmake.h.in, and grepped "USE_" and "WITH_" across the all source code.

This is how I'm running cmake:
cmake \ -DUSE_BISON=0 \ -DUSE_FLEX=0 \ -DUSE_GALERA=0 \ -DUSE_ICU=0 \ -DUSE_LIBEXPAT=0 \ -DUSE_LIBICONV=0 \ -DUSE_LIBSTEMMER=0 \ -DUSE_MYSQL=0 \ -DUSE_ODBC=0 \ -DUSE_PGSQL=0 \ -DUSE_RE2=0 \ -DUSE_SSL=0 \ -DUSE_SYSLOG=1 \ -DUSE_ZLIB=1 \ -DWITH_EXPAT=0 \ -DWITH_GALERA=0 \ -DWITH_ICONV=0 \ -DWITH_ICU=0 \ -DWITH_MYSQL=0 \ -DWITH_ODBC=0 \ -DWITH_PGSQL=0 \ -DWITH_RE2=0 \ -DWITH_STEMMER=0 \ -DWITH_SYSTEMD=1 \ -DWITH_SYSTEMD=1 \ -DWITH_ZLIB=1 \ -DCMAKE_BUILD_TYPE=RelWithDebInfo

cmake outputs a line saying "-- Could NOT find Boost (missing: Boost_INCLUDE_DIR context) (Required is at least version "1.61.0")", which is then followed by downloading Boost.

Is there a way to build from source without including Boost and/or creating a fairly minimal install? Or is Boost now required?

Thanks.

@sanikolaev
Copy link
Collaborator

Is there a way to build from source without including Boost

Try -DWITH_BOOST=OFF

and/or creating a fairly minimal install?

Try -DBUILD_TESTING=OFF -DDL_EXPAT=OFF -DDL_MYSQL=OFF -DDL_UNIXODBC=OFF -DSTRICT_BUILD_FLAGS=OFF -DSYSTEM_ASIO=OFF -DUSE_GALERA=OFF -DUSE_SSL=OFF -DWITH_BOOST=OFF -DWITH_EXPAT=OFF -DWITH_ICU=OFF -DWITH_ICU_FORCE_STATIC=OFF -DWITH_MYSQL=OFF -DWITH_ODBC=OFF -DWITH_STEMMER=OFF -DSTATIC_BINARY=ON -DHAVE_GETADDRINFO_A=OFF

@sanikolaev sanikolaev added the waiting Waiting for the original poster (in most cases) or something else label Nov 24, 2020
@benwills
Copy link
Author

I tried both of your suggestions, including with -DWITH_BOOST=0, and all of them proceeded to download Boost. Each attempt was also made with a freshly-unzipped source directory.

@sanikolaev sanikolaev removed the waiting Waiting for the original poster (in most cases) or something else label Nov 24, 2020
@klirichek
Copy link
Contributor

No, no easy way.
Boost.context is essential part and can't be avoided to build with.
If you need to build from sources you can either install boost on build host, either (which is essentially the same) use docker image with boost installed (you can find bunch of them in dist/build_dockers folder).

kind of 'minimal' build would be to extract boost.context from the whole boost and used, but it is also not an easy task by itself. Final version of boost.context we link with is a static library from couple of sources, taking just 4-20Kb (depends from debug symbols attached), but building from sources invokes many parts of not very important but still necessary stuff from other parts of boost.

Theoretically the only lib may be subsetted and patched to be standalone, but don't think it is a good idea in general as with such customization we have then support this code, and not just refer to upstream boost for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants