vrasneur / pyfasttext

Yet another Python binding for fastText
GNU General Public License v3.0
227 stars 31 forks source link

Package install failed in Centos7(variant not support in g++ 4.8.2 ) #9

Closed syw2014 closed 6 years ago

syw2014 commented 6 years ago

Detail errors as bellow:

Collecting pyfasttext Using cached pyfasttext-0.2.0.tar.gz Requirement already up-to-date: future in /root/anaconda2/lib/python2.7/site-packages (from pyfasttext) Requirement already up-to-date: numpy in /root/anaconda2/lib/python2.7/site-packages (from pyfasttext) Building wheels for collected packages: pyfasttext Running setup.py bdist_wheel for pyfasttext ... error Complete output from command /root/anaconda2/bin/python -u -c "import setuptools, tokenize;file='/tmp/pip-build-0RRcwq/pyfasttext/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" bdist_wheel -d /tmp/tmp7cQ0iCpip-wheel- --python-tag cp27: running bdist_wheel running build running build_ext building 'pyfasttext' extension creating build creating build/temp.linux-x86_64-2.7 creating build/temp.linux-x86_64-2.7/src creating build/temp.linux-x86_64-2.7/src/fastText creating build/temp.linux-x86_64-2.7/src/fastText/src gcc -pthread -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -iquote . -include src/custom_exit.h -fPIC -I. -I/root/anaconda2/lib/python2.7/site-packages/numpy/core/include -I/root/anaconda2/include/python2.7 -c src/pyfasttext.cpp -o build/temp.linux-x86_64-2.7/src/pyfasttext.o -std=c++0x -Wno-sign-compare cc1plus: 警告:command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ [默认启用] In file included from /root/anaconda2/include/python2.7/Python.h:8:0, from src/pyfasttext.cpp:37: /root/anaconda2/include/python2.7/pyconfig.h:1190:0: 警告:“_POSIX_C_SOURCE”重定义 [默认启用] define _POSIX_C_SOURCE 200112L ^ In file included from /usr/include/c++/4.8.2/x86_64-redhat-linux/bits/os_defines.h:39:0, from /usr/include/c++/4.8.2/x86_64-redhat-linux/bits/c++config.h:2097, from /usr/include/c++/4.8.2/cstdlib:41, from ./src/custom_exit.h:5, from <命令行>:0: /usr/include/features.h:168:0: 附注:这是先前定义的位置 ^ In file included from /root/anaconda2/include/python2.7/Python.h:8:0, from src/pyfasttext.cpp:37: /root/anaconda2/include/python2.7/pyconfig.h:1212:0: 警告:“_XOPEN_SOURCE”重定义 [默认启用] ^ In file included from /usr/include/c++/4.8.2/x86_64-redhat-linux/bits/os_defines.h:39:0, from /usr/include/c++/4.8.2/x86_64-redhat-linux/bits/c++config.h:2097, from /usr/include/c++/4.8.2/cstdlib:41, from ./src/custom_exit.h:5, from <命令行>:0: /usr/include/features.h:170:0: 附注:这是先前定义的位置 In file included from /root/anaconda2/lib/python2.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1809:0, from /root/anaconda2/lib/python2.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:18, from /root/anaconda2/lib/python2.7/site-packages/numpy/core/include/numpy/arrayobject.h:4, from src/pyfasttext.cpp:495: /root/anaconda2/lib/python2.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: 警告:warning "Using deprecated NumPy API, disable it by " "defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp] warning "Using deprecated NumPy API, disable it by " \ ^ In file included from src/fasttext_access.h:9:0, from src/pyfasttext.cpp:506: src/variant/v1.2.0/variant.hpp:267:46: 错误:missing binary operator before token "(" elif defined(has_include) && has_include() // >= libstdc++-5 ^ In file included from src/fasttext_access.h:9:0, from src/pyfasttext.cpp:506: src/variant/v1.2.0/variant.hpp:1160:66: 错误:展开样式‘mpark::detail::visitation::base::make_fmatrix_impl<F, Vs>::impl<mpark::lib::cpp14::integer_sequence<long unsigned int, Is ...>, Ls ...>{}()’不包括参数包 impl<lib::index_sequence<Is..., Js>, Ls...>{}()...)) ^ src/variant/v1.2.0/variant.hpp:779:28: 附注:in definition of macro ‘AUTO_RETURN’ -> lib::decay_t<decltype(VA_ARGS)> { return VA_ARGS; } ^ src/variant/v1.2.0/variant.hpp:1160:66: 错误:展开样式‘mpark::detail::visitation::base::make_fmatrix_impl<F, Vs>::impl<mpark::lib::cpp14::integer_sequence<long unsigned int, Is ...>, Ls ...>{}()’不包括参数包 impl<lib::index_sequence<Is..., Js>, Ls...>{}()...)) ^ src/variant/v1.2.0/variant.hpp:779:28: 附注:in definition of macro ‘AUTO_RETURN’ -> lib::decay_t<decltype(VA_ARGS)> { return VA_ARGS__; } ^ src/variant/v1.2.0/variant.hpp:779:40: 错误:模板第 1 个参数无效 -> lib::decay_t<decltype(VA_ARGS)> { return VA_ARGS; } ^ src/variant/v1.2.0/variant.hpp:1159:15: 附注:in expansion of macro ‘AUTO_RETURN’ AUTO_RETURN(make_farray( ^ src/variant/v1.2.0/variant.hpp: In instantiation of ‘class mpark::variant<bool, int, long unsigned int, double, std::basic_string<char, std::char_traits, std::allocator >, fasttext::loss_name, fasttext::model_name>’: /usr/include/c++/4.8.2/bits/stl_pair.h:102:11: required from ‘struct std::pair<std::basic_string, mpark::variant<bool, int, long unsigned int, double, std::basic_string<char, std::char_traits, std::allocator >, fasttext::loss_name, fasttext::model_name> >’ src/pyfasttext.cpp:3778:48: required from here src/variant/v1.2.0/variant.hpp:1826:5: 错误:static assertion failed: variant can not have an array type as an alternative. static_assert(lib::all<!std::is_array::value...>::value, ^ src/variant/v1.2.0/variant.hpp:1829:5: 错误:static assertion failed: variant can not have a reference type as an alternative. static_assert(lib::all<!std::is_reference::value...>::value, ^ src/variant/v1.2.0/variant.hpp:1832:5: 错误:static assertion failed: variant can not have a void type as an alternative. static_assert(lib::all<!std::is_void::value...>::value, ^ In file included from /root/anaconda2/include/python2.7/Python.h:80:0, from src/pyfasttext.cpp:37: src/pyfasttext.cpp: 在函数‘PyObject* __pyx_pf_10pyfasttext_8FastText4argsget(pyx_obj_10pyfasttext_FastText)’中: /root/anaconda2/include/python2.7/object.h:769:22: 警告:提领类型双关的指针将破坏强重叠规则 [-Wstrict-aliasing] ((PyObject)(op))->ob_refcnt++) ^ src/pyfasttext.cpp:586:28: 附注:in expansion of macro ‘Py_INCREF’ define Pyx_NewRef(obj) (Py_INCREF(obj), obj) ^ src/pyfasttext.cpp:588:41: 附注:in expansion of macro ‘Pyx_NewRef’ define Pyx_PyBool_FromLong(b) ((b) ? Pyx_NewRef(Py_True) : Pyx_NewRef(Py_False)) ^ src/pyfasttext.cpp:3971:19: 附注:in expansion of macro ‘Pyx_PyBool_FromLong’ pyx_t_1 = Pyx_PyBool_FromLong(mpark::get(pyx_v_item.second)); if (unlikely(!pyx_t_1)) PYX_ERR(0, 218, pyx_L1_error) ^ /root/anaconda2/include/python2.7/object.h:769:22: 警告:提领类型双关的指针将破坏强重叠规则 [-Wstrict-aliasing] ((PyObject*)(op))->ob_refcnt++) ^ src/pyfasttext.cpp:586:28: 附注:in expansion of macro ‘Py_INCREF’ define Pyx_NewRef(obj) (Py_INCREF(obj), obj) ^ src/pyfasttext.cpp:588:65: 附注:in expansion of macro ‘__Pyx_NewRef’ define Pyx_PyBool_FromLong(b) ((b) ? Pyx_NewRef(Py_True) : Pyx_NewRef(Py_False)) ^ src/pyfasttext.cpp:3971:19: 附注:in expansion of macro ‘Pyx_PyBool_FromLong’ pyx_t_1 = Pyx_PyBool_FromLong(mpark::get(pyx_v_item.second)); if (unlikely(!pyx_t_1)) PYX_ERR(0, 218, __pyx_L1_error) ^ In file included from src/fasttext_access.h:9:0, from src/pyfasttext.cpp:506: src/variant/v1.2.0/variant.hpp: In instantiation of ‘void mpark::detail::destructor<mpark::detail::traits<Ts ...>, (mpark::detail::Trait)1>::destroy() [with Ts = {bool, int, long unsigned int, double, std::basic_string<char, std::char_traits, std::allocator >, fasttext::loss_name, fasttext::model_name}]’: src/variant/v1.2.0/variant.hpp:1427:5: required from ‘mpark::detail::destructor<mpark::detail::traits<Ts ...>, (mpark::detail::Trait)1>::~destructor() [with Ts = {bool, int, long unsigned int, double, std::basic_string<char, std::char_traits, std::allocator >, fasttext::loss_name, fasttext::model_name}]’ src/variant/v1.2.0/variant.hpp:1449:7: required from ‘constexpr mpark::variant::variant() [with Front = bool; typename std::enable_if<std::is_default_constructible::value, int>::type = 0; Ts = {bool, int, long unsigned int, double, std::basic_string<char, std::char_traits, std::allocator >, fasttext::loss_name, fasttext::model_name}]’ /usr/include/c++/4.8.2/bits/stl_pair.h:109:25: required from ‘constexpr std::pair<_T1, _T2>::pair() [with _T1 = std::basic_string; _T2 = mpark::variant<bool, int, long unsigned int, double, std::basic_string<char, std::char_traits, std::allocator >, fasttext::loss_name, fasttext::model_name>]’ src/pyfasttext.cpp:3778:48: required from here src/variant/v1.2.0/variant.hpp:1432:54: 错误:对‘mpark::detail::visitation::base::visit_alt(mpark::detail::dtor, mpark::detail::destructor<mpark::detail::traits<bool, int, long unsigned int, double, std::basic_string<char, std::char_traits, std::allocator >, fasttext::loss_name, fasttext::model_name>, (mpark::detail::Trait)1>&)’的调用没有匹配的函数 visitation::base::visit_alt(dtor{}, this); ^ src/variant/v1.2.0/variant.hpp:1417:5: 附注:in definition of macro ‘MPARK_VARIANT_DESTRUCTOR’ destroy \ ^ src/variant/v1.2.0/variant.hpp:1432:54: 附注:备选是: visitation::base::visit_alt(dtor{}, this); ^ src/variant/v1.2.0/variant.hpp:1417:5: 附注:in definition of macro ‘MPARK_VARIANT_DESTRUCTOR’ destroy \ ^ src/variant/v1.2.0/variant.hpp:1184:47: 附注:template<class Visitor, class ... Vs> static constexpr decltype (mpark::detail::visitation::base::at(make_fmatrix<Visitor&&, decltype (as_base(forward(vs)))...>(), mpark::detail::visitation::base::visit_alt::vs.index()...)(forward(visitor), as_base((forward)(mpark::detail::visitation::base::visit_alt::vs))...)) mpark::detail::visitation::base::visit_alt(Visitor&&, Vs&& ...) inline static constexpr DECLTYPE_AUTO visit_alt(Visitor &&visitor, ^ src/variant/v1.2.0/variant.hpp:1184:47: 附注: template argument deduction/substitution failed: src/variant/v1.2.0/variant.hpp: In substitution of ‘template<class Visitor, class ... Vs> static constexpr decltype (mpark::detail::visitation::base::at(make_fmatrix<Visitor&&, decltype (as_base(forward(vs)))...>(), mpark::detail::visitation::base::visit_alt::vs.index()...)(forward(visitor), as_base((forward)(mpark::detail::visitation::base::visit_alt::vs))...)) mpark::detail::visitation::base::visit_alt(Visitor&&, Vs&& ...) [with Visitor = mpark::detail::dtor; Vs = {mpark::detail::destructor<mpark::detail::traits<bool, int, long unsigned int, double, std::basic_string<char, std::char_traits, std::allocator >, fasttext::loss_name, fasttext::model_name>, (mpark::detail::Trait)1>&}]’: src/variant/v1.2.0/variant.hpp:1427:5: required from ‘void mpark::detail::destructor<mpark::detail::traits<Ts ...>, (mpark::detail::Trait)1>::destroy() [with Ts = {bool, int, long unsigned int, double, std::basic_string<char, std::char_traits, std::allocator >, fasttext::loss_name, fasttext::model_name}]’ src/variant/v1.2.0/variant.hpp:1427:5: required from ‘mpark::detail::destructor<mpark::detail::traits<Ts ...>, (mpark::detail::Trait)1>::~destructor() [with Ts = {bool, int, long unsigned int, double, std::basic_string<char, std::char_traits, std::allocator >, fasttext::loss_name, fasttext::model_name}]’ src/variant/v1.2.0/variant.hpp:1449:7: required from ‘constexpr mpark::variant::variant() [with Front = bool; typename std::enable_if<std::is_default_constructible::value, int>::type = 0; Ts = {bool, int, long unsigned int, double, std::basic_string<char, std::char_traits, std::allocator >, fasttext::loss_name, fasttext::model_name}]’ /usr/include/c++/4.8.2/bits/stl_pair.h:109:25: required from ‘constexpr std::pair<_T1, _T2>::pair() [with _T1 = std::basic_string; _T2 = mpark::variant<bool, int, long unsigned int, double, std::basic_string<char, std::char_traits, std::allocator >, fasttext::loss_name, fasttext::model_name>]’ src/pyfasttext.cpp:3778:48: required from here src/variant/v1.2.0/variant.hpp:1188:75: 错误:对‘mpark::detail::visitation::base::make_fmatrix()’的调用没有匹配的函数 decltype(as_base(lib::forward(vs)))...>(), ^ src/variant/v1.2.0/variant.hpp:790:15: 附注:in definition of macro ‘DECLTYPE_AUTO_RETURN’

=====================

vrasneur commented 6 years ago

Hi @syw2014,

I have uploaded a new release (0.2.2) to PyPI, with a new variant library.

Can you try to install the module again ? (with pip install -U pyfasttext or pip install pyfasttext)

syw2014 commented 6 years ago

Hi @vrasneur , I had re-install it again in my environment, it can be installed successfully, I already test it and it works fine, thank you! Now I will close this issue! Thanks again!