简体   繁体   English

Numpy 构建错误:gcc: build/src.linux-x86_64-3.10/numpy/core/src/umath/loops.c

[英]Numpy building error: gcc: build/src.linux-x86_64-3.10/numpy/core/src/umath/loops.c

I'm trying to install Numpy v1.22.4 via pip , next via compiling source code.我正在尝试通过pip安装 Numpy v1.22.4,接下来通过编译源代码。
I encountered below error when I executed $ python setup.py build .执行$ python setup.py build时遇到以下错误。

error: Command "gcc -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DNPY_INTERNAL_BUILD=1 -DHAVE_NPY_CONFIG_H=1 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1 -D_LARGEFILE64_SOURCE=1 -DHAVE_CBLAS -DNO_ATLAS_INFO=-1 -Ibuild/src.linux-x86_64-3.10/numpy/core/src/common -Ibuild/src.linux-x86_64-3.10/numpy/core/src/umath -Inumpy/core/include -Ibuild/src.linux-x86_64-3.10/numpy/core/include/numpy -Ibuild/src.linux-x86_64-3.10/numpy/distutils/include -Inumpy/core/src/common -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/src/npysort -Inumpy/core/src/_simd -I/var/www/project/my-product/.venv/include -I/usr/local/include/python3.10 -Ibuild/src.linux-x86_64-3.10/numpy/core/src/common -Ibuild/src.linux-x86_64-3.10/numpy/core/src/npymath -c build/src.linux-x86_64-3.10/numpy/core/src/umath/loops.c -o build/temp.linux-x86_64-cpython-310/build/src.linux-x86_64-3.10/numpy/core/src/umath/loops.o -MMD -MF build/temp.linux-x86_64-cpython-310/build/src.linux-x86_64-3.10/numpy/core/src/umath/loops.o.d -msse -msse2 -msse3" failed with exit status 1

Below is the things I tried:以下是我尝试过的事情:

  • Installing Python 3.10.4 on CentOS 6.在 CentOS 6 上安装 Python 3.10.4。
    *Because it seems that Python 3.10.3 cannot be run on CentOS 6. *因为似乎 Python 3.10.3 无法在 CentOS 6 上运行。
  • Installing gcc v9.5.0, plus v11.3.0.安装 gcc v9.5.0,加上 v11.3.0。
    *Separately from default gcc (v4.4.7). *与默认 gcc (v4.4.7) 分开。
    *I used contrib/download_prerequisites when I installed gcc v11.3.0. *我在安装 gcc v11.3.0 时使用了contrib/download_prerequisites
  • Updating libstdc++ from gcc v11.3.0.从 gcc v11.3.0 更新 libstdc++。

*I describe more details later. *我稍后会描述更多细节。

Could you please tell me how to solve this error?你能告诉我如何解决这个错误吗?

My development environment information我的开发环境资料

(.venv) [vagrant@localhost ~]$ cat /etc/redhat-release 
CentOS release 6.10 (Final)

(.venv) [vagrant@localhost ~]$ which python
/var/www/project/my-product/.venv/bin/python
(.venv) [vagrant@localhost ~]$ python -V
Python 3.10.4

(.venv) [vagrant@localhost ~]$ which pip
/var/www/project/my-product/.venv/bin/pip
(.venv) [vagrant@localhost ~]$ pip -V
pip 22.1.1 from /var/www/project/my-product/.venv/lib/python3.10/site-packages/pip (python 3.10)
(.venv) [vagrant@localhost ~]$ pip list
Package    Version
---------- -------
Cython     0.29.30
pip        22.1.1
setuptools 62.3.2
WARNING: There was an error checking the latest version of pip.
(.venv) [vagrant@localhost ~]$ python -m cython --version
Cython version 0.29.30

(.venv) [vagrant@localhost ~]$ which gcc
/usr/local/bin/gcc
(.venv) [vagrant@localhost ~]$ gcc --version
gcc (GCC) 11.3.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

(.venv) [vagrant@localhost ~]$ which g++
/usr/local/bin/g++
(.venv) [vagrant@localhost ~]$ g++ --version
g++ (GCC) 11.3.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

(.venv) [vagrant@localhost ~]$ strings /usr/lib64/libstdc++.so.6 | grep GLIBCXX
GLIBCXX_3.4
GLIBCXX_3.4.1
GLIBCXX_3.4.2
GLIBCXX_3.4.3
GLIBCXX_3.4.4
GLIBCXX_3.4.5
GLIBCXX_3.4.6
GLIBCXX_3.4.7
GLIBCXX_3.4.8
GLIBCXX_3.4.9
GLIBCXX_3.4.10
GLIBCXX_3.4.11
GLIBCXX_3.4.12
GLIBCXX_3.4.13
GLIBCXX_3.4.14
GLIBCXX_3.4.15
GLIBCXX_3.4.16
GLIBCXX_3.4.17
GLIBCXX_3.4.18
GLIBCXX_3.4.19
GLIBCXX_3.4.20
GLIBCXX_3.4.21
GLIBCXX_3.4.22
GLIBCXX_3.4.23
GLIBCXX_3.4.24
GLIBCXX_3.4.25
GLIBCXX_3.4.26
GLIBCXX_3.4.27
GLIBCXX_3.4.28
GLIBCXX_FORCE_NEW
GLIBCXX_DEBUG_MESSAGE_LENGTH

(.venv) [vagrant@localhost ~]$ sudo yum list installed | grep -e "atlas" -e "lapack" -e "blas" -e "gfortran" -e "gmp" -e "mpfr" -e "mpc" -e "python-devel" -e "python34-devel" -e "Cython"
atlas.x86_64                        3.8.4-2.el6                      @base      
atlas-devel.x86_64                  3.8.4-2.el6                      @base      
blas.x86_64                         3.2.1-5.el6                      @base      
blas-devel.x86_64                   3.2.1-5.el6                      @base      
gcc-gfortran.x86_64                 4.4.7-23.el6                     @base      
gmp.x86_64                          4.3.1-13.el6                     @base      
gmp-devel.x86_64                    4.3.1-13.el6                     @base      
lapack.x86_64                       3.2.1-5.el6                      @base      
lapack-devel.x86_64                 3.2.1-5.el6                      @base      
libgfortran.x86_64                  4.4.7-23.el6                     @base      
libmpc.x86_64                       0.8-3.el6                        @epel      
libmpc-devel.x86_64                 0.8-3.el6                        @epel      
mpfr.x86_64                         2.4.1-6.el6                      @base      
mpfr-devel.x86_64                   2.4.1-6.el6                      @base      
openblas.x86_64                     0.3.3-2.el6                      @epel      
python-devel.x86_64                 2.6.6-68.el6_10                  @updates   
python34-devel.x86_64               3.4.10-4.el6                     @epel  

Commands I executed我执行的命令

(.venv) [vagrant@localhost src]$ pwd
/home/vagrant/src
(.venv) [vagrant@localhost src]$ git clone https://github.com/numpy/numpy.git
(.venv) [vagrant@localhost src]$ cd numpy
(.venv) [vagrant@localhost numpy]$ git checkout refs/tags/v1.22.4
(.venv) [vagrant@localhost numpy]$ git submodule update --init
(.venv) [vagrant@localhost numpy]$ python setup.py build 2>&1 | tee build_log.txt

... *Omitting

INFO: compile options: '-DNPY_INTERNAL_BUILD=1 -DHAVE_NPY_CONFIG_H=1 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1 -D_LARGEFILE64_SOURCE=1 -DHAVE_CBLAS -DNO_ATLAS_INFO=-1 -Ibuild/src.linux-x86_64-3.10/numpy/core/src/common -Ibuild/src.linux-x86_64-3.10/numpy/core/src/umath -Inumpy/core/include -Ibuild/src.linux-x86_64-3.10/numpy/core/include/numpy -Ibuild/src.linux-x86_64-3.10/numpy/distutils/include -Inumpy/core/src/common -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/src/npysort -Inumpy/core/src/_simd -I/var/www/project/my-product/.venv/include -I/usr/local/include/python3.10 -Ibuild/src.linux-x86_64-3.10/numpy/core/src/common -Ibuild/src.linux-x86_64-3.10/numpy/core/src/npymath -c'
extra options: '-O3 -msse -msse2 -msse3'
INFO: compiling C sources
INFO: C compiler: gcc -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC

INFO: compile options: '-DNPY_INTERNAL_BUILD=1 -DHAVE_NPY_CONFIG_H=1 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1 -D_LARGEFILE64_SOURCE=1 -DHAVE_CBLAS -DNO_ATLAS_INFO=-1 -Ibuild/src.linux-x86_64-3.10/numpy/core/src/common -Ibuild/src.linux-x86_64-3.10/numpy/core/src/umath -Inumpy/core/include -Ibuild/src.linux-x86_64-3.10/numpy/core/include/numpy -Ibuild/src.linux-x86_64-3.10/numpy/distutils/include -Inumpy/core/src/common -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/src/npysort -Inumpy/core/src/_simd -I/var/www/project/my-product/.venv/include -I/usr/local/include/python3.10 -Ibuild/src.linux-x86_64-3.10/numpy/core/src/common -Ibuild/src.linux-x86_64-3.10/numpy/core/src/npymath -c'
extra options: '-msse -msse2 -msse3'
INFO: gcc: build/src.linux-x86_64-3.10/numpy/core/src/umath/loops.c
/tmp/ccuh177O.s: Assembler messages:
/tmp/ccuh177O.s:36: Error: no such instruction: `vpbroadcastd %edx,%zmm1'
/tmp/ccuh177O.s:37: Error: bad register name `%zmm1'
/tmp/ccuh177O.s:63: Error: bad register name `%zmm2'
/tmp/ccuh177O.s:69: Error: no such instruction: `kxnorw %k1,%k1,%k1'

... *Omitting

/tmp/ccuh177O.s:18728: Error: no such instruction: `kmovw %ecx,%k1'
/tmp/ccuh177O.s:18741: Error: invalid character '{' in operand 2
/tmp/ccuh177O.s:18754: Error: invalid character '{' in operand 2
/tmp/ccuh177O.s:18777: Error: bad register name `%zmm1'
/tmp/ccuh177O.s:18792: Error: bad register name `%zmm0'
/tmp/ccuh177O.s:18801: Error: bad register name `%zmm1'
/tmp/ccuh177O.s:18810: Error: bad register name `%zmm0'
error: Command "gcc -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DNPY_INTERNAL_BUILD=1 -DHAVE_NPY_CONFIG_H=1 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1 -D_LARGEFILE64_SOURCE=1 -DHAVE_CBLAS -DNO_ATLAS_INFO=-1 -Ibuild/src.linux-x86_64-3.10/numpy/core/src/common -Ibuild/src.linux-x86_64-3.10/numpy/core/src/umath -Inumpy/core/include -Ibuild/src.linux-x86_64-3.10/numpy/core/include/numpy -Ibuild/src.linux-x86_64-3.10/numpy/distutils/include -Inumpy/core/src/common -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/src/npysort -Inumpy/core/src/_simd -I/var/www/project/my-product/.venv/include -I/usr/local/include/python3.10 -Ibuild/src.linux-x86_64-3.10/numpy/core/src/common -Ibuild/src.linux-x86_64-3.10/numpy/core/src/npymath -c build/src.linux-x86_64-3.10/numpy/core/src/umath/loops.c -o build/temp.linux-x86_64-cpython-310/build/src.linux-x86_64-3.10/numpy/core/src/umath/loops.o -MMD -MF build/temp.linux-x86_64-cpython-310/build/src.linux-x86_64-3.10/numpy/core/src/umath/loops.o.d -msse -msse2 -msse3" failed with exit status 1
INFO: 
########### EXT COMPILER OPTIMIZATION ###########
INFO: Platform      : 
  Architecture: x64
  Compiler    : gcc

CPU baseline  : 
  Requested   : 'min'
  Enabled     : SSE SSE2 SSE3
  Flags       : -msse -msse2 -msse3
  Extra checks: none

CPU dispatch  : 
  Requested   : 'max -xop -fma4'
  Enabled     : SSSE3 SSE41 POPCNT SSE42 AVX F16C FMA3
  Generated   : 
              : 
  SSE41       : SSE SSE2 SSE3 SSSE3
  Flags       : -msse -msse2 -msse3 -mssse3 -msse4.1
  Extra checks: none
  Detect      : SSE SSE2 SSE3 SSSE3 SSE41
              : build/src.linux-x86_64-3.10/numpy/core/src/umath/loops_arithmetic.dispatch.c
              : build/src.linux-x86_64-3.10/numpy/core/src/umath/loops_unary_fp.dispatch.c
INFO: CCompilerOpt.cache_flush[825] : write cache to path -> /home/vagrant/src/numpy/build/temp.linux-x86_64-cpython-310/ccompiler_opt_cache_ext.py
INFO: 
########### CLIB COMPILER OPTIMIZATION ###########
INFO: Platform      : 
  Architecture: x64
  Compiler    : gcc

CPU baseline  : 
  Requested   : 'min'
  Enabled     : SSE SSE2 SSE3
  Flags       : -msse -msse2 -msse3
  Extra checks: none

CPU dispatch  : 
  Requested   : 'max -xop -fma4'
  Enabled     : SSSE3 SSE41 POPCNT SSE42 AVX F16C FMA3
  Generated   : none
INFO: CCompilerOpt.cache_flush[825] : write cache to path -> /home/vagrant/src/numpy/build/temp.linux-x86_64-cpython-310/ccompiler_opt_cache_clib.py

It seems that I need at least gcc 11.2 , for -O3, then I upgraded GNU assembler through Binutils 2.38 package.看来我至少需要 gcc 11.2 ,对于 -O3,然后我通过 Binutils 2.38 包升级了 GNU 汇编程序。 I could solve my problem by the upgrading.我可以通过升级解决我的问题。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在python3中导入keras时出现numpy.core.umath错误 - numpy.core.umath error when importing keras in python3 错误:命令“x86_64-linux-gnu-gcc”失败,退出状态为 1,错误:mysqlclient 构建轮失败 - error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 and ERROR: Failed building wheel for mysqlclient 弃用警告:numpy.core.umath_tests - DeprecationWarning: numpy.core.umath_tests TypeError:src不是一个numpy数组 - TypeError: src is not a numpy array 调试报错“gcc: error: x86_64-linux-gnu-gcc: No such file or directory” - Debugging the error "gcc: error: x86_64-linux-gnu-gcc: No such file or directory" GDAL 安装错误“错误:命令‘x86_64-linux-gnu-gcc’失败,退出状态为 1” - GDAL installation error "error: command 'x86_64-linux-gnu-gcc' failed with exit status 1" 错误:命令“x86_64-linux-gnu-gcc”在安装 pygsr、pyaudio 时失败,退出状态为 1 - error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 while installing pygsr,pyaudio lxml:错误:命令'x86_64-linux-gnu-gcc'失败,退出状态为1 - lxml: error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 使用pip3安装软件包时出现“ x86_64-linux-gnu-gcc”错误 - 'x86_64-linux-gnu-gcc' error in installing apackage using pip3 pip 安装 reportlab 错误:命令 'x86_64-linux-gnu-gcc' 失败,退出状态为 1 - pip install reportlab error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM