fplll / g6k

The General Sieve Kernel
GNU General Public License v2.0
103 stars 31 forks source link

Encounter problem when installing G6k in SageMath(on conda) #123

Open identitymapping opened 7 months ago

identitymapping commented 7 months ago

I want to install G6k in SageMath,so I run the command 'sage --pip install g6k' but encounter a problem.The error code is as follows.How should I solve this problem?I don't know if my installation method is correct. Is there any other better way?

(sage) peter@ubuntu:~/Desktop$ sage --pip install g6k
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting g6k
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/8e/f5/d99a62c363c6167129df3a70aa11080c3ff5e48400bbedaaa4d6fb433faa/g6k-0.1.2.tar.gz (4.9 MB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [220 lines of output]
      checking build system type... x86_64-conda-linux-gnu
      checking host system type... x86_64-conda-linux-gnu
      checking whether to enable maintainer-specific portions of Makefiles... yes
      checking for a BSD-compatible install... /usr/bin/install -c
      checking whether build environment is sane... yes
      checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
      checking for gawk... no
      checking for mawk... mawk
      checking whether make sets $(MAKE)... yes
      checking whether make supports nested variables... yes
      checking whether make supports nested variables... (cached) yes
      checking how to print strings... printf
      checking whether make supports the include directive... yes (GNU style)
      checking for x86_64-conda-linux-gnu-gcc... /home/peter/miniconda3/envs/sage/bin/x86_64-conda-linux-gnu-cc
      checking whether the C compiler works... yes
      checking for C compiler default output file name... a.out
      checking for suffix of executables...
      checking whether we are cross compiling... no
      checking for suffix of object files... o
      checking whether we are using the GNU C compiler... yes
      checking whether /home/peter/miniconda3/envs/sage/bin/x86_64-conda-linux-gnu-cc accepts -g... yes
      checking for /home/peter/miniconda3/envs/sage/bin/x86_64-conda-linux-gnu-cc option to accept ISO C89... none needed
      checking whether /home/peter/miniconda3/envs/sage/bin/x86_64-conda-linux-gnu-cc understands -c and -o together... yes
      checking dependency style of /home/peter/miniconda3/envs/sage/bin/x86_64-conda-linux-gnu-cc... gcc3
      checking for a sed that does not truncate output... /home/peter/miniconda3/envs/sage/bin/sed
      checking for grep that handles long lines and -e... /usr/bin/grep
      checking for egrep... /usr/bin/grep -E
      checking for fgrep... /usr/bin/grep -F
      checking for ld used by /home/peter/miniconda3/envs/sage/bin/x86_64-conda-linux-gnu-cc... /home/peter/miniconda3/envs/sage/bin/x86_64-conda-linux-gnu-ld
      checking if the linker (/home/peter/miniconda3/envs/sage/bin/x86_64-conda-linux-gnu-ld) is GNU ld... yes
      checking for BSD- or MS-compatible name lister (nm)... /home/peter/miniconda3/envs/sage/bin/x86_64-conda-linux-gnu-nm
      checking the name lister (/home/peter/miniconda3/envs/sage/bin/x86_64-conda-linux-gnu-nm) interface... BSD nm
      checking whether ln -s works... yes
      checking the maximum length of command line arguments... 1572864
      checking how to convert x86_64-conda-linux-gnu file names to x86_64-conda-linux-gnu format... func_convert_file_noop
      checking how to convert x86_64-conda-linux-gnu file names to toolchain format... func_convert_file_noop
      checking for /home/peter/miniconda3/envs/sage/bin/x86_64-conda-linux-gnu-ld option to reload object files... -r
      checking for x86_64-conda-linux-gnu-objdump... /home/peter/miniconda3/envs/sage/bin/x86_64-conda-linux-gnu-objdump
      checking how to recognize dependent libraries... pass_all
      checking for x86_64-conda-linux-gnu-dlltool... no
      checking for dlltool... no
      checking how to associate runtime and link libraries... printf %s\n
      checking for x86_64-conda-linux-gnu-ar... /home/peter/miniconda3/envs/sage/bin/x86_64-conda-linux-gnu-ar
      checking for archiver @FILE support... @
      checking for x86_64-conda-linux-gnu-strip... /home/peter/miniconda3/envs/sage/bin/x86_64-conda-linux-gnu-strip
      checking for x86_64-conda-linux-gnu-ranlib... /home/peter/miniconda3/envs/sage/bin/x86_64-conda-linux-gnu-ranlib
      checking command to parse /home/peter/miniconda3/envs/sage/bin/x86_64-conda-linux-gnu-nm output from /home/peter/miniconda3/envs/sage/bin/x86_64-conda-linux-gnu-cc object... ok
      checking for sysroot... no
      checking for a working dd... /usr/bin/dd
      checking how to truncate binary pipes... /usr/bin/dd bs=4096 count=1
      checking for x86_64-conda-linux-gnu-mt... no
      checking for mt... mt
      checking if mt is a manifest tool... no
      checking how to run the C preprocessor... /home/peter/miniconda3/envs/sage/bin/x86_64-conda-linux-gnu-cpp
      checking for ANSI C header files... yes
      checking for sys/types.h... yes
      checking for sys/stat.h... yes
      checking for stdlib.h... yes
      checking for string.h... yes
      checking for memory.h... yes
      checking for strings.h... yes
      checking for inttypes.h... yes
      checking for stdint.h... yes
      checking for unistd.h... yes
      checking for dlfcn.h... yes
      checking for objdir... .libs
      checking if /home/peter/miniconda3/envs/sage/bin/x86_64-conda-linux-gnu-cc supports -fno-rtti -fno-exceptions... no
      checking for /home/peter/miniconda3/envs/sage/bin/x86_64-conda-linux-gnu-cc option to produce PIC... -fPIC -DPIC
      checking if /home/peter/miniconda3/envs/sage/bin/x86_64-conda-linux-gnu-cc PIC flag -fPIC -DPIC works... yes
      checking if /home/peter/miniconda3/envs/sage/bin/x86_64-conda-linux-gnu-cc static flag -static works... yes
      checking if /home/peter/miniconda3/envs/sage/bin/x86_64-conda-linux-gnu-cc supports -c -o file.o... yes
      checking if /home/peter/miniconda3/envs/sage/bin/x86_64-conda-linux-gnu-cc supports -c -o file.o... (cached) yes
      checking whether the /home/peter/miniconda3/envs/sage/bin/x86_64-conda-linux-gnu-cc linker (/home/peter/miniconda3/envs/sage/bin/x86_64-conda-linux-gnu-ld -m elf_x86_64) supports shared libraries... yes
      checking whether -lc should be explicitly linked in... no
      checking dynamic linker characteristics... GNU/Linux ld.so
      checking how to hardcode library paths into programs... immediate
      checking whether stripping libraries is possible... yes
      checking if libtool supports shared libraries... yes
      checking whether to build shared libraries... yes
      checking whether to build static libraries... yes
      checking whether we are using the GNU C++ compiler... yes
      checking whether /home/peter/miniconda3/envs/sage/bin/x86_64-conda-linux-gnu-c++ accepts -g... yes
      checking dependency style of /home/peter/miniconda3/envs/sage/bin/x86_64-conda-linux-gnu-c++... gcc3
      checking how to run the C++ preprocessor... /home/peter/miniconda3/envs/sage/bin/x86_64-conda-linux-gnu-c++ -E
      checking for ld used by /home/peter/miniconda3/envs/sage/bin/x86_64-conda-linux-gnu-c++... /home/peter/miniconda3/envs/sage/bin/x86_64-conda-linux-gnu-ld -m elf_x86_64
      checking if the linker (/home/peter/miniconda3/envs/sage/bin/x86_64-conda-linux-gnu-ld -m elf_x86_64) is GNU ld... yes
      checking whether the /home/peter/miniconda3/envs/sage/bin/x86_64-conda-linux-gnu-c++ linker (/home/peter/miniconda3/envs/sage/bin/x86_64-conda-linux-gnu-ld -m elf_x86_64) supports shared libraries... yes
      checking for /home/peter/miniconda3/envs/sage/bin/x86_64-conda-linux-gnu-c++ option to produce PIC... -fPIC -DPIC
      checking if /home/peter/miniconda3/envs/sage/bin/x86_64-conda-linux-gnu-c++ PIC flag -fPIC -DPIC works... yes
      checking if /home/peter/miniconda3/envs/sage/bin/x86_64-conda-linux-gnu-c++ static flag -static works... yes
      checking if /home/peter/miniconda3/envs/sage/bin/x86_64-conda-linux-gnu-c++ supports -c -o file.o... yes
      checking if /home/peter/miniconda3/envs/sage/bin/x86_64-conda-linux-gnu-c++ supports -c -o file.o... (cached) yes
      checking whether the /home/peter/miniconda3/envs/sage/bin/x86_64-conda-linux-gnu-c++ linker (/home/peter/miniconda3/envs/sage/bin/x86_64-conda-linux-gnu-ld -m elf_x86_64) supports shared libraries... yes
      checking dynamic linker characteristics... (cached) GNU/Linux ld.so
      checking how to hardcode library paths into programs... immediate
      checking whether /home/peter/miniconda3/envs/sage/bin/x86_64-conda-linux-gnu-c++ supports C++11 features with -std=c++11... yes
      checking whether /home/peter/miniconda3/envs/sage/bin/x86_64-conda-linux-gnu-cc is Clang... no
      checking whether pthreads work with "-pthread" and "-lpthread"... yes
      checking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE
      checking whether more special flags are required for pthreads... no
      checking for PTHREAD_PRIO_INHERIT... no
      checking whether C++ compiler accepts -march=native... yes
      checking for x86 cpuid  output... unknown
      checking for x86-AVX xgetbv  output... unknown
      checking for x86 cpuid 0x00000000 output... 10:68747541:444d4163:69746e65
      checking for x86 cpuid 0x80000000 output... 80000020:68747541:444d4163:69746e65
      checking for x86 cpuid 0x00000001 output... 860f01:2030800:fef83203:178bfbff
      checking for x86 cpuid 0x00000007 output... 0:219c01a9:400004:0
      checking for x86 cpuid 0x80000001 output... 860f01:0:4003fb:2fd3fbff
      checking for x86-AVX xgetbv 0x00000000 output... 7:0
      checking whether RDRND is supported by the processor... yes
      checking whether RDRND is supported by the processor and OS... yes
      checking whether C++ compiler accepts -mrdrnd... yes
      checking whether BMI1 is supported by the processor... yes
      checking whether BMI1 is supported by the processor and OS... yes
      checking whether C++ compiler accepts -mbmi... yes
      checking whether BMI2 is supported by the processor... yes
      checking whether BMI2 is supported by the processor and OS... yes
      checking whether C++ compiler accepts -mbmi2... yes
      checking whether ADX is supported by the processor... yes
      checking whether ADX is supported by the processor and OS... yes
      checking whether C++ compiler accepts -madx... yes
      checking whether MPX is supported by the processor... no
      checking whether PREFETCHWT1 is supported by the processor... no
      checking whether ABM is supported by the processor... yes
      checking whether ABM is supported by the processor and OS... yes
      checking whether C++ compiler accepts -mabm... yes
      checking whether MMX is supported by the processor... yes
      checking whether MMX is supported by the processor and OS... yes
      checking whether C++ compiler accepts -mmmx... yes
      checking whether SSE is supported by the processor... yes
      checking whether SSE is supported by the processor and OS... yes
      checking whether C++ compiler accepts -msse... yes
      checking whether SSE2 is supported by the processor... yes
      checking whether SSE2 is supported by the processor and OS... yes
      checking whether C++ compiler accepts -msse2... yes
      checking whether SSE3 is supported by the processor... yes
      checking whether SSE3 is supported by the processor and OS... yes
      checking whether C++ compiler accepts -msse3... yes
      checking whether SSSE3 is supported by the processor... yes
      checking whether SSSE3 is supported by the processor and OS... yes
      checking whether C++ compiler accepts -mssse3... yes
      checking whether SSE4.1 is supported by the processor... yes
      checking whether SSE4.1 is supported by the processor and OS... yes
      checking whether C++ compiler accepts -msse4.1... yes
      checking whether SSE4.2 is supported by the processor... yes
      checking whether SSE4.2 is supported by the processor and OS... yes
      checking whether C++ compiler accepts -msse4.2... yes
      checking whether SSE4a is supported by the processor... yes
      checking whether SSE4a is supported by the processor and OS... yes
      checking whether C++ compiler accepts -msse4a... yes
      checking whether SHA is supported by the processor... yes
      checking whether SHA is supported by the processor and OS... yes
      checking whether C++ compiler accepts -msha... yes
      checking whether AES is supported by the processor... yes
      checking whether AES is supported by the processor and OS... yes
      checking whether C++ compiler accepts -maes... yes
      checking whether AVX is supported by the processor... yes
      checking whether AVX is supported by the processor and OS... yes
      checking whether C++ compiler accepts -mavx... yes
      checking whether FMA3 is supported by the processor... yes
      checking whether FMA3 is supported by the processor and OS... yes
      checking whether C++ compiler accepts -mfma... yes
      checking whether FMA4 is supported by the processor... no
      checking whether XOP is supported by the processor... no
      checking whether AVX2 is supported by the processor... yes
      checking whether AVX2 is supported by the processor and OS... yes
      checking whether C++ compiler accepts -mavx2... yes
      checking whether AVX512-F is supported by the processor... no
      checking whether AVX512-CD is supported by the processor... no
      checking whether AVX512-PF is supported by the processor... no
      checking whether AVX512-ER is supported by the processor... no
      checking whether AVX512-VL is supported by the processor... no
      checking whether AVX512-BW is supported by the processor... no
      checking whether AVX512-DQ is supported by the processor... no
      checking whether AVX512-IFMA is supported by the processor... no
      checking whether AVX512-VBMI is supported by the processor... no
      checking that generated files are newer than configure... done
      configure: creating ./config.status
      config.status: creating Makefile
      config.status: creating kernel/Makefile
      config.status: creating g6k.pc
      config.status: creating kernel/g6k_config.h
      config.status: executing depfiles commands
      config.status: executing libtool commands
      warning: /home/peter/miniconda3/envs/sage/lib/python3.9/site-packages/cysignals/signals.pxd:57:56: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.

      Error compiling Cython file:
      ------------------------------------------------------------
      ...
                  if lens[i] > 0.:
                      L.append((i, lens[i], vecs[i]))
              return L

          def insert_best_lift(self, scoring=(lambda index, nlen, olen, aux: True), aux=None):
                                              ^
      ------------------------------------------------------------

      g6k/siever.pyx:1664:40: Compiler crash in ExpressionWriter

      Compiler crash traceback from this point on:
        File "Cython/Compiler/Visitor.py", line 182, in Cython.Compiler.Visitor.TreeVisitor._visit
        File "/home/peter/miniconda3/envs/sage/lib/python3.9/site-packages/Cython/CodeWriter.py", line 512, in visit_Node
          raise AssertionError("Node not handled by serializer: %r" % node)
      AssertionError: Node not handled by serializer: <Cython.Compiler.ExprNodes.LambdaNode object at 0x7fe37aec9970>
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-6c25ma20/g6k_1849bae27680411daa6f64b7ca37bcdf/setup.py", line 109, in <module>
          ext_modules=cythonize(
        File "/home/peter/miniconda3/envs/sage/lib/python3.9/site-packages/Cython/Build/Dependencies.py", line 1154, in cythonize
          cythonize_one(*args)
        File "/home/peter/miniconda3/envs/sage/lib/python3.9/site-packages/Cython/Build/Dependencies.py", line 1321, in cythonize_one
          raise CompileError(None, pyx_file)
      Cython.Compiler.Errors.CompileError: g6k/siever.pyx
      Compiling g6k/siever.pyx because it changed.
      Compiling g6k/siever_params.pyx because it changed.
      [1/2] Cythonizing g6k/siever.pyx
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
identitymapping commented 7 months ago

I solve this problem using ndrahmani's method.The link is https://github.com/fplll/g6k/issues/110#issuecomment-1694633742.