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

1.8.0 fails to build: test_ivf_index.cpp: error: no matching function for call to 'find(std::set<long unsigned int>::iterator, std::set<long unsigned int>::iterator, long unsigned int&)' #3877

Open
2 of 4 tasks
barracuda156 opened this issue Sep 20, 2024 · 7 comments

Comments

@barracuda156
Copy link

Summary

Platform

OS: 10.6

Faiss version: 1.8.0

Installed from: MacPorts

Faiss compilation options:

--->  Configuring libfaiss
        (using ccache)
Executing:  cd "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_libfaiss/libfaiss/work/build" && /opt/local/bin/cmake -G "CodeBlocks - Unix Makefiles" -DCMAKE_BUILD_TYPE=MacPorts -DCMAKE_INSTALL_PREFIX="/opt/local" -DCMAKE_INSTALL_NAME_DIR="/opt/local/lib" -DCMAKE_SYSTEM_PREFIX_PATH="/opt/local;/usr" -DCMAKE_C_COMPILER_LAUNCHER=/opt/local/bin/ccache -DCMAKE_CXX_COMPILER_LAUNCHER=/opt/local/bin/ccache -DCMAKE_Fortran_COMPILER_LAUNCHER=/opt/local/bin/ccache -DCMAKE_OBJC_COMPILER_LAUNCHER=/opt/local/bin/ccache -DCMAKE_OBJCXX_COMPILER_LAUNCHER=/opt/local/bin/ccache -DCMAKE_ISPC_COMPILER_LAUNCHER=/opt/local/bin/ccache -DCMAKE_C_COMPILER="$CC" -DCMAKE_CXX_COMPILER="$CXX" -DCMAKE_OBJC_COMPILER="$CC" -DCMAKE_OBJCXX_COMPILER="$CXX" -DCMAKE_POLICY_DEFAULT_CMP0025=NEW -DCMAKE_POLICY_DEFAULT_CMP0060=NEW -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_COLOR_MAKEFILE=ON -DCMAKE_FIND_FRAMEWORK=LAST -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_MAKE_PROGRAM=/usr/bin/make -DCMAKE_MODULE_PATH="/opt/local/share/cmake/Modules" -DCMAKE_PREFIX_PATH="/opt/local/share/cmake/Modules" -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=ON -DCMAKE_INSTALL_RPATH="/opt/local/lib" -Wno-dev -DFAISS_ENABLE_GPU:BOOL=OFF -DFAISS_ENABLE_PYTHON:BOOL=OFF -DCMAKE_OSX_ARCHITECTURES="ppc" -DCMAKE_OSX_DEPLOYMENT_TARGET="10.6" -DCMAKE_OSX_SYSROOT="/" /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_libfaiss/libfaiss/work/faiss-1.8.0 
-- The CXX compiler identification is GNU 14.2.0
-- Checking whether CXX compiler has -isysroot
-- Checking whether CXX compiler has -isysroot - yes
-- Checking whether CXX compiler supports OSX deployment target flag
-- Checking whether CXX compiler supports OSX deployment target flag - yes
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /opt/local/bin/g++-mp-14 - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found OpenMP_CXX: -fopenmp (found version "4.5")
-- Found OpenMP: TRUE (found version "4.5")
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Could NOT find MKL (missing: MKL_LIBRARIES) 
-- Looking for sgemm_
-- Looking for sgemm_ - not found
-- Looking for sgemm_
-- Looking for sgemm_ - found
-- Found BLAS: /opt/local/lib/libopenblas.dylib
-- Looking for cheev_
-- Looking for cheev_ - found
-- Found LAPACK: /opt/local/lib/libopenblas.dylib;-lm;-ldl
-- The C compiler identification is GNU 14.2.0
-- Checking whether C compiler has -isysroot
-- Checking whether C compiler has -isysroot - yes
-- Checking whether C compiler supports OSX deployment target flag
-- Checking whether C compiler supports OSX deployment target flag - yes
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /opt/local/bin/gcc-mp-14 - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Found Python: /opt/local/bin/python3.12 (found version "3.12.6") found components: Interpreter
-- Configuring done (28.5s)
-- Generating done (1.7s)

Running on:

  • CPU
  • GPU

Interface:

  • C++
  • Python

Reproduction instructions

Run the build with gcc 14.2.0

:info:build [ 83%] Building CXX object tests/CMakeFiles/faiss_test.dir/test_merge.cpp.o
:info:build cd /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_libfaiss/libfaiss/work/build/tests && /opt/local/bin/ccache /opt/local/bin/g++-mp-14  -I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_libfaiss/libfaiss/work/faiss-1.8.0 -isystem /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_libfaiss/libfaiss/work/build/_deps/googletest-src/googletest/include -isystem /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_libfaiss/libfaiss/work/build/_deps/googletest-src/googletest -pipe -Os -DNDEBUG -I/opt/local/include -D_GLIBCXX_USE_CXX11_ABI=0 -arch ppc -mmacosx-version-min=10.6 -fopenmp -MD -MT tests/CMakeFiles/faiss_test.dir/test_merge.cpp.o -MF CMakeFiles/faiss_test.dir/test_merge.cpp.o.d -o CMakeFiles/faiss_test.dir/test_merge.cpp.o -c /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_libfaiss/libfaiss/work/faiss-1.8.0/tests/test_merge.cpp
:info:build In file included from /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_libfaiss/libfaiss/work/build/_deps/googletest-src/googletest/include/gtest/gtest-printers.h:114,
:info:build                  from /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_libfaiss/libfaiss/work/build/_deps/googletest-src/googletest/include/gtest/gtest-matchers.h:48,
:info:build                  from /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_libfaiss/libfaiss/work/build/_deps/googletest-src/googletest/include/gtest/internal/gtest-death-test-internal.h:46,
:info:build                  from /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_libfaiss/libfaiss/work/build/_deps/googletest-src/googletest/include/gtest/gtest-death-test.h:43,
:info:build                  from /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_libfaiss/libfaiss/work/build/_deps/googletest-src/googletest/include/gtest/gtest.h:60,
:info:build                  from /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_libfaiss/libfaiss/work/faiss-1.8.0/tests/test_ivf_index.cpp:16:
:info:build /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_libfaiss/libfaiss/work/faiss-1.8.0/tests/test_ivf_index.cpp: In member function 'virtual void IVF_list_context_Test::TestBody()':
:info:build /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_libfaiss/libfaiss/work/faiss-1.8.0/tests/test_ivf_index.cpp:232:26: error: no matching function for call to 'find(std::set<long unsigned int>::iterator, std::set<long unsigned int>::iterator, long unsigned int&)'
:info:build   232 |                 std::find(
:info:build       |                 ~~~~~~~~~^
:info:build   233 |                         lists_probed.cbegin(),
:info:build       |                         ~~~~~~~~~~~~~~~~~~~~~~
:info:build   234 |                         lists_probed.cend(),
:info:build       |                         ~~~~~~~~~~~~~~~~~~~~
:info:build   235 |                         query_vector_listno) != lists_probed.cend())
:info:build       |                         ~~~~~~~~~~~~~~~~~~~~
:info:build In file included from /opt/local/include/gcc14/c++/bits/locale_facets.h:48,
:info:build                  from /opt/local/include/gcc14/c++/bits/basic_ios.h:37,
:info:build                  from /opt/local/include/gcc14/c++/ios:46,
:info:build                  from /opt/local/include/gcc14/c++/ostream:40,
:info:build                  from /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_libfaiss/libfaiss/work/build/_deps/googletest-src/googletest/include/gtest/gtest.h:55:
:info:build /opt/local/include/gcc14/c++/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT, std::char_traits<_CharT> > >::__type std::find(istreambuf_iterator<_CharT, char_traits<_CharT> >, istreambuf_iterator<_CharT, char_traits<_CharT> >, const _CharT2&)'
:info:build   435 |     find(istreambuf_iterator<_CharT> __first,
:info:build       |     ^~~~
:info:build /opt/local/include/gcc14/c++/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
:info:build /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_libfaiss/libfaiss/work/faiss-1.8.0/tests/test_ivf_index.cpp:232:26: note:   'std::_Rb_tree_const_iterator<long unsigned int>' is not derived from 'std::istreambuf_iterator<_CharT, std::char_traits<_CharT> >'
:info:build   232 |                 std::find(
:info:build       |                 ~~~~~~~~~^
:info:build   233 |                         lists_probed.cbegin(),
:info:build       |                         ~~~~~~~~~~~~~~~~~~~~~~
:info:build   234 |                         lists_probed.cend(),
:info:build       |                         ~~~~~~~~~~~~~~~~~~~~
:info:build   235 |                         query_vector_listno) != lists_probed.cend())
:info:build       |                         ~~~~~~~~~~~~~~~~~~~~
:info:build /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_libfaiss/libfaiss/work/faiss-1.8.0/tests/test_ivf_index.cpp:238:26: error: no matching function for call to 'find(std::vector<long long int>::const_iterator, std::vector<long long int>::const_iterator, const faiss::idx_t&)'
:info:build   238 |                 std::find(labels.cbegin(), labels.cend(), query_vector_id) !=
:info:build       |                 ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:info:build /opt/local/include/gcc14/c++/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT, std::char_traits<_CharT> > >::__type std::find(istreambuf_iterator<_CharT, char_traits<_CharT> >, istreambuf_iterator<_CharT, char_traits<_CharT> >, const _CharT2&)'
:info:build   435 |     find(istreambuf_iterator<_CharT> __first,
:info:build       |     ^~~~
:info:build /opt/local/include/gcc14/c++/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
:info:build /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_libfaiss/libfaiss/work/faiss-1.8.0/tests/test_ivf_index.cpp:238:26: note:   '__gnu_cxx::__normal_iterator<const long long int*, std::vector<long long int> >' is not derived from 'std::istreambuf_iterator<_CharT, std::char_traits<_CharT> >'
:info:build   238 |                 std::find(labels.cbegin(), labels.cend(), query_vector_id) !=
:info:build       |                 ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:info:build make[2]: *** [tests/CMakeFiles/faiss_test.dir/test_ivf_index.cpp.o] Error 1
:info:build make[2]: *** Waiting for unfinished jobs....
:info:build make[2]: Leaving directory `/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_libfaiss/libfaiss/work/build'
:info:build make[1]: *** [tests/CMakeFiles/faiss_test.dir/all] Error 2
:info:build make[1]: Leaving directory `/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_libfaiss/libfaiss/work/build'
:info:build make: *** [all] Error 2

1.7.3 installed fine on the same system (after adding three missing #include <cstdint> to make gcc14 happy).

@junjieqi
Copy link
Contributor

junjieqi commented Oct 2, 2024

@barracuda156 would you like to try to install from Conda and see if the issue is still there?

@junjieqi
Copy link
Contributor

junjieqi commented Oct 2, 2024

here is some instruction you could try

#3865 (comment)

@barracuda156
Copy link
Author

@junjieqi Thank you for responding.
I wanted to update libfaiss in MacPorts, and for that I need it to compile on supported systems.
Switching to another package manager does not address that.

@junjieqi
Copy link
Contributor

junjieqi commented Oct 4, 2024

@barracuda156 could you provide the command you were using step-by-step ? Try to see how we could reproduce it. In addition, MacPorts is not supported installation method for faiss so it may has some problems. I still suggest that if you want to install faiss, you should try to install from conda. Or if you want to compile the faiss from source, you could try this wiki https://github.com/facebookresearch/faiss/blob/main/INSTALL.md#building-from-source

@barracuda156
Copy link
Author

@junjieqi Ok, I went through commit history, and this looks like this bug #3532 which was apparently fixed in db251e2 but that fix is missing in the released version of libfaiss.

In addition, MacPorts is not supported installation method for faiss so it may has some problems.

MacPorts does not use some exclusive proprietary tools to build stuff. It uses tcl to set up the build, but the build itself uses the same standard tools like CMake etc. I.e. there is no need to support “MacPorts installation method”.
Portfile is here: https://github.com/macports/macports-ports/blob/9a023e433850e66c888cf32cfede0cd63b8b3a0a/math/libfaiss/Portfile

I cannot test the patch from the commit I referenced above at the moment (away from my testing hardware), but from looks of things, it is the same bug.

@asadoughi
Copy link
Contributor

db251e2 should be in the latest release v1.9.0 that was cut this week.

@barracuda156
Copy link
Author

@asadoughi Thank you, I will try that, once I am back.

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

No branches or pull requests

4 participants