gcc 14.2.0: error: no matching function for call to 'lower_bound(const knn::DocDist_t*&
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 updated
could you try to add
#include <algorithm>
into knnmisc.cpp ?
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
could you try to add
#include <algorithm>into
knnmisc.cpp?
Thank you, that worked. :)
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.
We don't use GCC to build Manticore
I'm using Clang 18.1.8 for native build on Fedora 40 and also facing the same issue.
could you try to add
#include
into knnmisc.cpp ?
This fix is also worked for me too.
Why this fix is not in master?
because all our pipeline works as usual but all who report this issue and could check does the fix worked or not could not create PR with proposed changes for some unknown reason and the PR passed make sure our pipeline still works as usual and the fix also worked for them.
Feel free to push the PR with the change and test it.
https://github.com/manticoresoftware/manticoresearch/pull/3187 is merged. Thanks @Azq2
I'm closing this issue.