fplll / fpylll

A Python interface for https://github.com/fplll/fplll
GNU General Public License v2.0
118 stars 60 forks source link

Errors Building `fpylll.fplll.gso` Extension #238

Closed AntonKueltz closed 1 year ago

AntonKueltz commented 1 year ago

Hi there! I'm seeing some errors installing the fpylll package via pip. Some information on my system -

─➤  python -V
Python 3.8.14

─➤  arch
arm64

─➤  brew info gmp mpfr qd fplll   # additional install formation output removed below
==> gmp: stable 6.2.1 (bottled), HEAD

==> mpfr: stable 4.1.0-p13 (bottled), HEAD

==> qd: stable 2.3.23 (bottled)

==> fplll: stable 5.4.2 (bottled)

─➤  pip list
Package    Version
---------- -------
cysignals  1.11.2
Cython     0.29.32
pip        22.3.1
setuptools 56.0.0
wheel      0.38.4

This is the full error output that I see when running pip install fpylll. The issues seem to be that the from_canonical, to_canonical and babai members cannot be found or do not exist. I would also note that some extensions like fpylll.fplll.integer_matrix seem to build fine as part of the install, so it seems something particular to this extension or its dependencies is causing the build to have trouble.

building 'fpylll.fplll.gso' extension
      clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/opt/homebrew/include -Isrc/fpylll/fplll -I/<PROJECT DIR>/venv/lib/python3.8/site-packages/cysignals -I/<redacted>/venv/include -I/<PROJECT DIR>/venv/include -I/<HOME>/.pyenv/versions/3.8.14/include/python3.8 -c build/src/fpylll/fplll/gso.cpp -o build/temp.macosx-12.3-arm64-3.8/build/src/fpylll/fplll/gso.o -std=c++11
      build/src/fpylll/fplll/gso.cpp:18673:121: error: no member named 'from_canonical' in 'fplll::MatGSO<fplll::Z_NR<>, fplll::FP_NR<double>>'
          ((fplll::MatGSO<fplll::Z_NR<mpz_t> ,fplll::FP_NR<__pyx_t_6fpylll_5fplll_4decl_d_t> >  *)__pyx_v_self->_core.mpz_d)->from_canonical(__pyx_v_cv.d, __pyx_v_cw.d, __pyx_v_start, __pyx_v_dimension);
          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ^
      build/src/fpylll/fplll/gso.cpp:18733:123: error: no member named 'from_canonical' in 'fplll::MatGSO<fplll::Z_NR<>, fplll::FP_NR<long double>>'
          ((fplll::MatGSO<fplll::Z_NR<mpz_t> ,fplll::FP_NR<__pyx_t_6fpylll_5fplll_4decl_ld_t> >  *)__pyx_v_self->_core.mpz_ld)->from_canonical(__pyx_v_cv.ld, __pyx_v_cw.ld, __pyx_v_start, __pyx_v_dimension);
          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ^
      build/src/fpylll/fplll/gso.cpp:18793:98: error: no member named 'from_canonical' in 'fplll::MatGSO<fplll::Z_NR<>, fplll::FP_NR<>>'
          ((fplll::MatGSO<fplll::Z_NR<mpz_t> ,fplll::FP_NR<mpfr_t> >  *)__pyx_v_self->_core.mpz_mpfr)->from_canonical(__pyx_v_cv.mpfr, __pyx_v_cw.mpfr, __pyx_v_start, __pyx_v_dimension);
          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ^
      build/src/fpylll/fplll/gso.cpp:18853:121: error: no member named 'from_canonical' in 'fplll::MatGSO<fplll::Z_NR<long>, fplll::FP_NR<double>>'
          ((fplll::MatGSO<fplll::Z_NR<long> ,fplll::FP_NR<__pyx_t_6fpylll_5fplll_4decl_d_t> >  *)__pyx_v_self->_core.long_d)->from_canonical(__pyx_v_cv.d, __pyx_v_cw.d, __pyx_v_start, __pyx_v_dimension);
          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ^
      build/src/fpylll/fplll/gso.cpp:18913:123: error: no member named 'from_canonical' in 'fplll::MatGSO<fplll::Z_NR<long>, fplll::FP_NR<long double>>'
          ((fplll::MatGSO<fplll::Z_NR<long> ,fplll::FP_NR<__pyx_t_6fpylll_5fplll_4decl_ld_t> >  *)__pyx_v_self->_core.long_ld)->from_canonical(__pyx_v_cv.ld, __pyx_v_cw.ld, __pyx_v_start, __pyx_v_dimension);
          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ^
      build/src/fpylll/fplll/gso.cpp:19139:121: error: no member named 'to_canonical' in 'fplll::MatGSO<fplll::Z_NR<>, fplll::FP_NR<double>>'
          ((fplll::MatGSO<fplll::Z_NR<mpz_t> ,fplll::FP_NR<__pyx_t_6fpylll_5fplll_4decl_d_t> >  *)__pyx_v_self->_core.mpz_d)->to_canonical(__pyx_v_cw.d, __pyx_v_cv.d, __pyx_v_start);
          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ^
      build/src/fpylll/fplll/gso.cpp:19199:123: error: no member named 'to_canonical' in 'fplll::MatGSO<fplll::Z_NR<>, fplll::FP_NR<long double>>'
          ((fplll::MatGSO<fplll::Z_NR<mpz_t> ,fplll::FP_NR<__pyx_t_6fpylll_5fplll_4decl_ld_t> >  *)__pyx_v_self->_core.mpz_ld)->to_canonical(__pyx_v_cw.ld, __pyx_v_cv.ld, __pyx_v_start);
          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ^
      build/src/fpylll/fplll/gso.cpp:19259:98: error: no member named 'to_canonical' in 'fplll::MatGSO<fplll::Z_NR<>, fplll::FP_NR<>>'
          ((fplll::MatGSO<fplll::Z_NR<mpz_t> ,fplll::FP_NR<mpfr_t> >  *)__pyx_v_self->_core.mpz_mpfr)->to_canonical(__pyx_v_cw.mpfr, __pyx_v_cv.mpfr, __pyx_v_start);
          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ^
      build/src/fpylll/fplll/gso.cpp:19319:121: error: no member named 'to_canonical' in 'fplll::MatGSO<fplll::Z_NR<long>, fplll::FP_NR<double>>'
          ((fplll::MatGSO<fplll::Z_NR<long> ,fplll::FP_NR<__pyx_t_6fpylll_5fplll_4decl_d_t> >  *)__pyx_v_self->_core.long_d)->to_canonical(__pyx_v_cw.d, __pyx_v_cv.d, __pyx_v_start);
          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ^
      build/src/fpylll/fplll/gso.cpp:19379:123: error: no member named 'to_canonical' in 'fplll::MatGSO<fplll::Z_NR<long>, fplll::FP_NR<long double>>'
          ((fplll::MatGSO<fplll::Z_NR<long> ,fplll::FP_NR<__pyx_t_6fpylll_5fplll_4decl_ld_t> >  *)__pyx_v_self->_core.long_ld)->to_canonical(__pyx_v_cw.ld, __pyx_v_cv.ld, __pyx_v_start);
          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ^
      build/src/fpylll/fplll/gso.cpp:19698:130: error: no member named 'babai' in 'fplll::MatGSO<fplll::Z_NR<>, fplll::FP_NR<double>>'
            (void)(((fplll::MatGSO<fplll::Z_NR<mpz_t> ,fplll::FP_NR<__pyx_t_6fpylll_5fplll_4decl_d_t> >  *)__pyx_v_self->_core.mpz_d)->babai(__pyx_v_cw.mpz, __pyx_v_cv.d, __pyx_v_start, __pyx_v_dimension, __pyx_t_8));
                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ^
      build/src/fpylll/fplll/gso.cpp:19759:132: error: no member named 'babai' in 'fplll::MatGSO<fplll::Z_NR<>, fplll::FP_NR<long double>>'
            (void)(((fplll::MatGSO<fplll::Z_NR<mpz_t> ,fplll::FP_NR<__pyx_t_6fpylll_5fplll_4decl_ld_t> >  *)__pyx_v_self->_core.mpz_ld)->babai(__pyx_v_cw.mpz, __pyx_v_cv.ld, __pyx_v_start, __pyx_v_dimension, __pyx_t_8));
                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ^
      build/src/fpylll/fplll/gso.cpp:19820:107: error: no member named 'babai' in 'fplll::MatGSO<fplll::Z_NR<>, fplll::FP_NR<>>'
            (void)(((fplll::MatGSO<fplll::Z_NR<mpz_t> ,fplll::FP_NR<mpfr_t> >  *)__pyx_v_self->_core.mpz_mpfr)->babai(__pyx_v_cw.mpz, __pyx_v_cv.mpfr, __pyx_v_start, __pyx_v_dimension, __pyx_t_8));
                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ^
      build/src/fpylll/fplll/gso.cpp:19881:130: error: no member named 'babai' in 'fplll::MatGSO<fplll::Z_NR<long>, fplll::FP_NR<double>>'
            (void)(((fplll::MatGSO<fplll::Z_NR<long> ,fplll::FP_NR<__pyx_t_6fpylll_5fplll_4decl_d_t> >  *)__pyx_v_self->_core.long_d)->babai(__pyx_v_cw.__pyx_long, __pyx_v_cv.d, __pyx_v_start, __pyx_v_dimension, __pyx_t_8));
                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ^
      build/src/fpylll/fplll/gso.cpp:19942:132: error: no member named 'babai' in 'fplll::MatGSO<fplll::Z_NR<long>, fplll::FP_NR<long double>>'
            (void)(((fplll::MatGSO<fplll::Z_NR<long> ,fplll::FP_NR<__pyx_t_6fpylll_5fplll_4decl_ld_t> >  *)__pyx_v_self->_core.long_ld)->babai(__pyx_v_cw.__pyx_long, __pyx_v_cv.ld, __pyx_v_start, __pyx_v_dimension, __pyx_t_8));
                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ^
      build/src/fpylll/fplll/gso.cpp:20041:41: error: no member named 'babai' in 'fplll::MatGSOInterface<fplll::Z_NR<>, fplll::FP_NR<double>>'
            (void)(__pyx_v_self->_core.mpz_d->babai(__pyx_v_cw.mpz, __pyx_v_cv.d, __pyx_v_start, __pyx_v_dimension));
                   ~~~~~~~~~~~~~~~~~~~~~~~~~  ^
      build/src/fpylll/fplll/gso.cpp:20101:42: error: no member named 'babai' in 'fplll::MatGSOInterface<fplll::Z_NR<>, fplll::FP_NR<long double>>'
            (void)(__pyx_v_self->_core.mpz_ld->babai(__pyx_v_cw.mpz, __pyx_v_cv.ld, __pyx_v_start, __pyx_v_dimension));
                   ~~~~~~~~~~~~~~~~~~~~~~~~~~  ^
      build/src/fpylll/fplll/gso.cpp:20161:43: error: no member named 'babai' in 'fplll::MatGSOInterface<fplll::Z_NR<>, fplll::FP_NR<dpe_struct [1]>>'
            (void)(__pyx_v_self->_core.mpz_dpe->babai(__pyx_v_cw.mpz, __pyx_v_cv.dpe, __pyx_v_start, __pyx_v_dimension));
                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~  ^
      build/src/fpylll/fplll/gso.cpp:20221:44: error: no member named 'babai' in 'fplll::MatGSOInterface<fplll::Z_NR<>, fplll::FP_NR<>>'
            (void)(__pyx_v_self->_core.mpz_mpfr->babai(__pyx_v_cw.mpz, __pyx_v_cv.mpfr, __pyx_v_start, __pyx_v_dimension));
                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ^
      fatal error: too many errors emitted, stopping now [-ferror-limit=]
      20 errors generated.
      error: command 'clang' failed with exit status 1
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> fpylll

I'm not sure how to proceed here, this seems to be an error somewhere at the Cython layer, which is outside my area of expertise. Are there any recommendations for how to further debug or fix this?

Thanks, Anton

malb commented 1 year ago

You'll need fplll-5.4.3 (or install the previous version of fpylll)

AntonKueltz commented 1 year ago

Ah, installing fpylll==0.5.7 did the trick, thanks Martin! Looks like unlucky timing on my part where pip has the latest version of fpylll but the corresponding necessary version of fplll hasn't made it to brew yet.