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

error on pip installing: spinsort,block_indirect_sort, not a member of boost sort #245

Closed
YSaxon opened this issue Mar 2, 2022 · 2 comments
Labels

Comments

@YSaxon
Copy link

YSaxon commented Mar 2, 2022

So I did manage to solve this myself, but just wanted to post in case anyone runs into the same problem.

I was trying to pip install keyvi but kept getting

    In file included from /tmp/pip-build-tzs1qyas/keyvi/src/cpp/keyvi/include/keyvi/dictionary/dictionary_types.h:28:0,
                     from _core_p.cpp:652:
    /tmp/pip-build-tzs1qyas/keyvi/src/cpp/keyvi/include/keyvi/dictionary/dictionary_compiler.h: In member function ‘void keyvi::dictionary::DictionaryCompiler<ValueStoreType>::Sort()’:
    /tmp/pip-build-tzs1qyas/keyvi/src/cpp/keyvi/include/keyvi/dictionary/dictionary_compiler.h:184:20: error: ‘block_indirect_sort’ is not a member of ‘boost::sort’
           boost::sort::block_indirect_sort(key_values_.begin(), key_values_.end());
                        ^~~~~~~~~~~~~~~~~~~
    In file included from /tmp/pip-build-tzs1qyas/keyvi/src/cpp/keyvi/include/keyvi/dictionary/dictionary_types.h:29:0,
                     from _core_p.cpp:652:
    /tmp/pip-build-tzs1qyas/keyvi/src/cpp/keyvi/include/keyvi/dictionary/dictionary_index_compiler.h: In member function ‘void keyvi::dictionary::DictionaryIndexCompiler<ValueStoreType>::Sort()’:
    /tmp/pip-build-tzs1qyas/keyvi/src/cpp/keyvi/include/keyvi/dictionary/dictionary_index_compiler.h:215:20: error: ‘spinsort’ is not a member of ‘boost::sort’
           boost::sort::spinsort(key_values_.begin(), key_values_.end());

I had just apt installed libboost-all-dev (1.65.1.0ubuntu1), so that wasn't the problem.
I gave up and downloaded the git repo, and ran pip3 install -r requirements.txt, only to run into a problem with the cryptography lib.

            =============================DEBUG ASSISTANCE==========================
            If you are seeing an error here please try the following to
            successfully install cryptography:

            Upgrade to the latest pip and try again. This will fix errors for most
            users. See: https://pip.pypa.io/en/stable/installing/#upgrading-pip
            =============================DEBUG ASSISTANCE==========================

So I did pip3 install pip, then reran pip3 install -r requirements.txt, and then found that pip install keyvi worked just fine afterwards!

I'm can't be 100% positive whether it was upgrading pip or installing the requirements manually that did it (and I can't easily go back and check), but I assume the former.

You might consider putting such a DEBUG ASSISTANCE message into the keyvi library if you believe that's the ultimate cause.

@YSaxon YSaxon added the bug label Mar 2, 2022
@YSaxon YSaxon closed this as completed Mar 2, 2022
@hendrikmuhs
Copy link
Contributor

thanks for the report.

I am surprised about the install from source, we provide pre-compiled packages on pip.

libboost-all-dev (1.65.1.0ubuntu1),

That version of boost is too old, it lacks the sort implementation that we use. The compiler errors you pasted are about missing classes. If I remember correctly at least boost 1.68 is required.

I think that by upgrading pip you basically made your pip aware of the pre-compiled packages. When you called pip install keyvi again, it downloaded and installed the precompiled packages instead of trying to install from source again.

For completeness, what's your ubuntu version?

@YSaxon
Copy link
Author

YSaxon commented Mar 2, 2022

Ubuntu 18.04.6 LTS
5.4.0-1066-aws #69~18.04.1-Ubuntu SMP Wed Feb 9 15:36:54 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

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

No branches or pull requests

2 participants