错误:“gcc…”在Ubuntu 12.04上安装pygsl时失败,退出状态为1

2024-04-18 14:02:20 发布

您现在位置:Python中文网/ 问答频道 /正文

当我运行“python”时设置.pybuild”,错误如下,gsl版本是gsl\ U 1.16 pygsl版本是pygsl-2.3.0

testing/src/sf/sf__data.c: At top level:

testing/src/sf/sf__data.c:3010:53: error: ‘gsl_sf_mathieu_a_e’ undeclared here (not in a function)

testing/src/sf/sf__data.c:3024:53: error: ‘gsl_sf_mathieu_b_e’ undeclared here (not in a function)

testing/src/sf/sf__data.c:3024:1: error: initializer element is not constant

testing/src/sf/sf__data.c:3024:1: error: (near initialization for ‘gsl_sf_mathieu_b_e_data[0]’)

testing/src/sf/sf__data.c:3024:1: error: initializer element is not constant

testing/src/sf/sf__data.c:3024:1: error: (near initialization for ‘gsl_sf_mathieu_b_e_data[1]’)

testing/src/sf/sf__data.c:3038:54: error: ‘gsl_sf_mathieu_ce_e’ undeclared here (not in a function)

testing/src/sf/sf__data.c:3038:1: error: initializer element is not constant

testing/src/sf/sf__data.c:3038:1: error: (near initialization for ‘gsl_sf_mathieu_ce_e_data[0]’)

testing/src/sf/sf__data.c:3038:1: error: initializer element is not constant

testing/src/sf/sf__data.c:3038:1: error: (near initialization for ‘gsl_sf_mathieu_ce_e_data[1]’)

testing/src/sf/sf__data.c:3052:54: error: ‘gsl_sf_mathieu_se_e’ undeclared here (not in a function)

testing/src/sf/sf__data.c:3052:1: error: initializer element is not constant

testing/src/sf/sf__data.c:3052:1: error: (near initialization for ‘gsl_sf_mathieu_se_e_data[0]’)

testing/src/sf/sf__data.c:3052:1: error: initializer element is not constant

testing/src/sf/sf__data.c:3052:1: error: (near initialization for ‘gsl_sf_mathieu_se_e_data[1]’)

testing/src/sf/sf__data.c:3066:54: error: ‘gsl_sf_mathieu_Mc_e’ undeclared here (not in a function)

testing/src/sf/sf__data.c:3066:1: error: initializer element is not constant

testing/src/sf/sf__data.c:3066:1: error: (near initialization for ‘gsl_sf_mathieu_Mc_e_data[0]’)

testing/src/sf/sf__data.c:3066:1: error: initializer element is not constant

testing/src/sf/sf__data.c:3066:1: error: (near initialization for ‘gsl_sf_mathieu_Mc_e_data[1]’)

testing/src/sf/sf__data.c:3080:54: error: ‘gsl_sf_mathieu_Ms_e’ undeclared here (not in a function)

testing/src/sf/sf__data.c:3080:1: error: initializer element is not constant

testing/src/sf/sf__data.c:3080:1: error: (near initialization for ‘gsl_sf_mathieu_Ms_e_data[0]’)

testing/src/sf/sf__data.c:3080:1: error: initializer element is not constant

testing/src/sf/sf__data.c:3080:1: error: (near initialization for ‘gsl_sf_mathieu_Ms_e_data[1]’)

testing/src/sf/sfmodule_testing.c: In function ‘PyGSL_sf_ufunc_qi_dd_D’:

testing/src/sf/sfmodule_testing.c:124:6: warning: variable ‘tmp’ set but not used [-Wunused-but-set-variable]

testing/src/sf/sfmodule_testing.c: In function ‘PyGSL_sf_ufunc_qi_dd_D_as_ff_F’:

testing/src/sf/sfmodule_testing.c:141:59: warning: variable ‘tmp’ set but not used [-Wunused-but-set-variable]

testing/src/sf/sfmodule_testing.c: In function ‘PyGSL_sf_ufunc_qi_D_dd’:

testing/src/sf/sfmodule_testing.c:162:6: warning: variable ‘tmp’ set but not used [-Wunused-but-set-variable]

testing/src/sf/sfmodule_testing.c: In function ‘PyGSL_sf_ufunc_qi_D_dd_as_F_ff’:

testing/src/sf/sfmodule_testing.c:184:76: warning: variable ‘tmp’ set but not used [-Wunused-but-set-variable]

testing/src/sf/sfmodule_testing.c: In function ‘_pygsl_sf_long_to_unsigned_int’:

testing/src/sf/sfmodule_testing.c:67:2: warning: format ‘%d’ expects argument of type ‘int’, but argument 6 has type ‘long unsigned int’ [-Wformat]

testing/src/sf/sfmodule_testing.c:67:2: warning: format ‘%d’ expects argument of type ‘int’, but argument 7 has type ‘long unsigned int’ [-Wformat]

testing/src/sf/sfmodule_testing.c:68:2: warning: too many arguments for format [-Wformat-extra-args]

testing/src/sf/sfmodule_testing.c:79:3: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 7 has type ‘unsigned int’ [-Wformat]
In file included from testing/src/sf/sfmodule_testing.c:104:0:

testing/src/sf/sf__data.c: At top level:

testing/src/sf/sf__data.c:3010:53: error: ‘gsl_sf_mathieu_a_e’ undeclared here (not in a function)

testing/src/sf/sf__data.c:3024:53: error: ‘gsl_sf_mathieu_b_e’ undeclared here (not in a function)

testing/src/sf/sf__data.c:3024:1: error: initializer element is not constant

testing/src/sf/sf__data.c:3024:1: error: (near initialization for ‘gsl_sf_mathieu_b_e_data[0]’)

testing/src/sf/sf__data.c:3024:1: error: initializer element is not constant

testing/src/sf/sf__data.c:3024:1: error: (near initialization for ‘gsl_sf_mathieu_b_e_data[1]’)

testing/src/sf/sf__data.c:3038:54: error: ‘gsl_sf_mathieu_ce_e’ undeclared here (not in a function)

testing/src/sf/sf__data.c:3038:1: error: initializer element is not constant

testing/src/sf/sf__data.c:3038:1: error: (near initialization for ‘gsl_sf_mathieu_ce_e_data[0]’)

testing/src/sf/sf__data.c:3038:1: error: initializer element is not constant

testing/src/sf/sf__data.c:3038:1: error: (near initialization for ‘gsl_sf_mathieu_ce_e_data[1]’)

testing/src/sf/sf__data.c:3052:54: error: ‘gsl_sf_mathieu_se_e’ undeclared here (not in a function)

testing/src/sf/sf__data.c:3052:1: error: initializer element is not constant

testing/src/sf/sf__data.c:3052:1: error: (near initialization for ‘gsl_sf_mathieu_se_e_data[0]’)

testing/src/sf/sf__data.c:3052:1: error: initializer element is not constant

testing/src/sf/sf__data.c:3052:1: error: (near initialization for ‘gsl_sf_mathieu_se_e_data[1]’)

testing/src/sf/sf__data.c:3066:54: error: ‘gsl_sf_mathieu_Mc_e’ undeclared here (not in a function)

testing/src/sf/sf__data.c:3066:1: error: initializer element is not constant

testing/src/sf/sf__data.c:3066:1: error: (near initialization for ‘gsl_sf_mathieu_Mc_e_data[0]’)

testing/src/sf/sf__data.c:3066:1: error: initializer element is not constant

testing/src/sf/sf__data.c:3066:1: error: (near initialization for ‘gsl_sf_mathieu_Mc_e_data[1]’)

testing/src/sf/sf__data.c:3080:54: error: ‘gsl_sf_mathieu_Ms_e’ undeclared here (not in a function)

testing/src/sf/sf__data.c:3080:1: error: initializer element is not constant

testing/src/sf/sf__data.c:3080:1: error: (near initialization for ‘gsl_sf_mathieu_Ms_e_data[0]’)

testing/src/sf/sf__data.c:3080:1: error: initializer element is not constant

testing/src/sf/sf__data.c:3080:1: error: (near initialization for ‘gsl_sf_mathieu_Ms_e_data[1]’)

testing/src/sf/sfmodule_testing.c: In function ‘PyGSL_sf_ufunc_qi_dd_D’:

testing/src/sf/sfmodule_testing.c:124:6: warning: variable ‘tmp’ set but not used [-Wunused-but-set-variable]

testing/src/sf/sfmodule_testing.c: In function ‘PyGSL_sf_ufunc_qi_dd_D_as_ff_F’:

testing/src/sf/sfmodule_testing.c:141:59: warning: variable ‘tmp’ set but not used [-Wunused-but-set-variable]

testing/src/sf/sfmodule_testing.c: In function ‘PyGSL_sf_ufunc_qi_D_dd’:

testing/src/sf/sfmodule_testing.c:162:6: warning: variable ‘tmp’ set but not used [-Wunused-but-set-variable]

testing/src/sf/sfmodule_testing.c: In function ‘PyGSL_sf_ufunc_qi_D_dd_as_F_ff’:

testing/src/sf/sfmodule_testing.c:184:76: warning: variable ‘tmp’ set but not used [-Wunused-but-set-variable]

error: Command "gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DSWIG_COBJECT_TYPES=1 -DDEBUG=1 -DPyGSL_SET_GSL_ERROR_HANDLER=1 -DNUMERIC=0 -UNDEBUG -I/usr/local/include -IInclude -I. -I/usr/local/lib/python2.7/dist-packages/numpy/core/include -I/usr/include/python2.7 -c testing/src/sf/sfmodule_testing.c -o build/temp.linux-x86_64-2.7/testing/src/sf/sfmodule_testing.o" failed with exit status 1

Tags: srcfordataisnotfunctionerrorelement
2条回答

我在Python2.7的基础上通过管道安装pygsl-2.1.1解决了这个问题。但是gsl版本是1.15,所以你必须改变 获取gsl-1.16的软件源。现在可以了。你知道吗

首先使用yum install gcc安装gcc,然后安装python模块

相关问题 更多 >