manticoresoftware / manticoresearch

Easy to use open source fast database for search | Good alternative to Elasticsearch now | Drop-in replacement for E in the ELK soon
https://manticoresearch.com
GNU General Public License v3.0
9.1k stars 509 forks source link

gcc 14.2.0: error: no matching function for call to 'lower_bound(const knn::DocDist_t*& #2644

Open Thermi opened 1 month ago

Thermi commented 1 month ago

Bug Description:

manticore 6.3.6 fails to compile using gcc 14.2.0 because of this error:

/builds/Thermi/aports/testing/manticore/src/manticoresearch-6.3.6/src/knnmisc.cpp:74:64: error: no matching function for call to 'lower_bound(const knn::DocDist_t*&, const knn::DocDist_t*&, const RowID_t&, Expr_KNNDist_c::Eval(const CSphMatch&) const::<lambda(auto:28&, RowID_t)>)'
   74 |                 const knn::DocDist_t * pPtr = std::lower_bound ( m_pStart, pEnd, tMatch.m_tRowID, []( auto & tEntry, RowID_t tValue ){ return tEntry.m_tRowID < tValue; } );
      |                                               ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error can be seen here: https://gitlab.alpinelinux.org/Thermi/aports/-/jobs/1558099#L1648

Alpine Linux build files for manticore 6.3.6 can be found in this MR: https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/70417

Build command:

    cmake -B build -G Ninja \
        -DCMAKE_INSTALL_PREFIX=/usr \
        -DCMAKE_INSTALL_SYSCONFDIR=/etc \
        -DCMAKE_INSTALL_LIBDIR=lib \
        -DCMAKE_INSTALL_LOCALSTATEDIR=/var \
        -DCMAKE_INSTALL_FULL_LOCALSTATEDIR=/var \
        -DCMAKE_BUILD_TYPE=MinSizeRel \
        -DLOCALDATADIR=/var/lib/manticore \
        -DWITH_ICU=1 \
        -DWITH_ICU_FORCE_STATIC=0 \
        -DWITH_RE2=1 \
        -DWITH_RE2_FORCE_STATIC=0 \
        -DWITH_STEMMER=1 \
        -DWITH_STEMMER_FORCE_STATIC=0 \
        -DWITH_GALERA=0
    cmake --build build

Manticore Search Version:

6.3.6

Operating System Version:

Alpine Linux Edge

Have you tried the latest development version?

No

Internal Checklist:

To be completed by the assignee. Check off tasks that have been completed or are not applicable.

- [ ] Implementation completed - [ ] Tests developed - [ ] Documentation updated - [ ] Documentation reviewed - [ ] [Changelog](https://docs.google.com/spreadsheets/d/1mz_3dRWKs86FjRF7EIZUziUDK_2Hvhd97G0pLpxo05s/edit?pli=1&gid=1102439133) updated
tomatolog commented 1 month ago

could you try to add

#include <algorithm>

into knnmisc.cpp ?

sanikolaev commented 1 month ago

We don't use GCC to build Manticore. As mentioned in this issue https://github.com/manticoresoftware/manticoresearch/issues/2343#issuecomment-2203047391, it's better to use our custom Docker image, which is also used by our CI to build the official packages. We’d be happy to help with integrate Alpine Linux support into it (we use CMake and its cross-compiling features, so each OS needs a specific sysroot). You can find more details here: https://github.com/manticoresoftware/manticoresearch/tree/master/dist/build_dockers/cross/sysroots

Thermi commented 1 month ago

could you try to add

#include <algorithm>

into knnmisc.cpp ?

Thank you, that worked. :)

Thermi commented 1 month ago

We don't use GCC to build Manticore. As mentioned in this issue #2343 (comment), it's better to use our custom Docker image, which is also used by our CI to build the official packages. We’d be happy to help with integrate Alpine Linux support into it (we use CMake and its cross-compiling features, so each OS needs a specific sysroot). You can find more details here: https://github.com/manticoresoftware/manticoresearch/tree/master/dist/build_dockers/cross/sysroots

That's just not an option here. It's for native installation on Alpine Linux (it uses musl libc) via the package manager so it has to be built using Alpine Linux too. It has to be buildable by the standard CI setup used by the Alpine Linux project and that uses a docker image built on Alpine Linux.