我正在尝试pygsl
在我的机器上使用 Python2.7 安装在 gsl 1.14 之上。我很清楚这些都已弃用,但我需要确保新代码的向后兼容性。
当我运行时,
python setup.py build
我得到以下一长串错误:
swig_src/gslwrap_wrap.c:3764:3: warning: unused label 'fail' [-Wunused-label]
fail:
^~~~~
swig_src/gslwrap_wrap.c:10620:17: error: implicit declaration of function 'gsl_linalg_QRPT_lssolve' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
result = (int)gsl_linalg_QRPT_lssolve((gsl_matrix const *)arg1,(gsl_vector const *)arg2,(struct gsl_permutation_struct const *)arg3,(gsl_vector const *)arg4,arg5,arg6);
^
swig_src/gslwrap_wrap.c:10778:17: error: implicit declaration of function 'gsl_linalg_QRPT_lssolve2' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
result = (int)gsl_linalg_QRPT_lssolve2((gsl_matrix const *)arg1,(gsl_vector const *)arg2,(struct gsl_permutation_struct const *)arg3,(gsl_vector const *)arg4,arg5,arg6,arg7);
^
swig_src/gslwrap_wrap.c:11430:20: error: implicit declaration of function 'gsl_linalg_QRPT_rank' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
result = (size_t)gsl_linalg_QRPT_rank((gsl_matrix const *)arg1,arg2);
^
swig_src/gslwrap_wrap.c:11494:17: error: implicit declaration of function 'gsl_linalg_QRPT_rcond' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
result = (int)gsl_linalg_QRPT_rcond((gsl_matrix const *)arg1,arg2,arg3);
^
swig_src/gslwrap_wrap.c:11494:17: note: did you mean 'gsl_linalg_QRPT_decomp'?
/usr/local/include/gsl/gsl_linalg.h:299:5: note: 'gsl_linalg_QRPT_decomp' declared here
int gsl_linalg_QRPT_decomp (gsl_matrix * A,
^
swig_src/gslwrap_wrap.c:11607:17: error: implicit declaration of function 'gsl_linalg_COD_decomp' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
result = (int)gsl_linalg_COD_decomp(arg1,arg2,arg3,arg4,arg5,arg6);
^
swig_src/gslwrap_wrap.c:11749:17: error: implicit declaration of function 'gsl_linalg_COD_decomp_e' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
result = (int)gsl_linalg_COD_decomp_e(arg1,arg2,arg3,arg4,arg5,arg6,arg7);
^
swig_src/gslwrap_wrap.c:11912:17: error: implicit declaration of function 'gsl_linalg_COD_lssolve' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
result = (int)gsl_linalg_COD_lssolve((gsl_matrix const *)arg1,(gsl_vector const *)arg2,(gsl_vector const *)arg3,(struct gsl_permutation_struct const *)arg4,arg5,(gsl_vector const *)arg6,arg7,arg8);
^
swig_src/gslwrap_wrap.c:11912:17: note: did you mean 'gsl_linalg_QR_lssolve'?
/usr/local/include/gsl/gsl_linalg.h:248:5: note: 'gsl_linalg_QR_lssolve' declared here
int gsl_linalg_QR_lssolve (const gsl_matrix * QR,
^
swig_src/gslwrap_wrap.c:12133:17: error: implicit declaration of function 'gsl_linalg_COD_lssolve2' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
result = (int)gsl_linalg_COD_lssolve2(arg1,(gsl_matrix const *)arg2,(gsl_vector const *)arg3,(gsl_vector const *)arg4,(struct gsl_permutation_struct const *)arg5,arg6,(gsl_vector const *)arg7,arg8,arg9,arg10,arg11);
^
swig_src/gslwrap_wrap.c:12133:17: note: did you mean 'gsl_linalg_QR_lssolve'?
/usr/local/include/gsl/gsl_linalg.h:248:5: note: 'gsl_linalg_QR_lssolve' declared here
int gsl_linalg_QR_lssolve (const gsl_matrix * QR,
^
swig_src/gslwrap_wrap.c:12324:17: error: implicit declaration of function 'gsl_linalg_COD_unpack' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
result = (int)gsl_linalg_COD_unpack((gsl_matrix const *)arg1,(gsl_vector const *)arg2,(gsl_vector const *)arg3,arg4,arg5,arg6,arg7);
^
swig_src/gslwrap_wrap.c:12467:17: error: implicit declaration of function 'gsl_linalg_COD_matZ' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
result = (int)gsl_linalg_COD_matZ((gsl_matrix const *)arg1,(gsl_vector const *)arg2,arg3,arg4,arg5);
^
swig_src/gslwrap_wrap.c:14670:17: error: implicit declaration of function 'gsl_linalg_cholesky_decomp1' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
result = (int)gsl_linalg_cholesky_decomp1(arg1);
^
swig_src/gslwrap_wrap.c:14670:17: note: did you mean 'gsl_linalg_cholesky_decomp'?
/usr/local/include/gsl/gsl_linalg.h:423:5: note: 'gsl_linalg_cholesky_decomp' declared here
int gsl_linalg_cholesky_decomp (gsl_matrix * A);
^
swig_src/gslwrap_wrap.c:15003:17: error: implicit declaration of function 'gsl_linalg_cholesky_scale' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
result = (int)gsl_linalg_cholesky_scale((gsl_matrix const *)arg1,arg2);
^
swig_src/gslwrap_wrap.c:15003:17: note: did you mean 'gsl_linalg_cholesky_solve'?
/usr/local/include/gsl/gsl_linalg.h:425:5: note: 'gsl_linalg_cholesky_solve' declared here
int gsl_linalg_cholesky_solve (const gsl_matrix * cholesky,
^
swig_src/gslwrap_wrap.c:15068:17: error: implicit declaration of function 'gsl_linalg_cholesky_scale_apply' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
result = (int)gsl_linalg_cholesky_scale_apply(arg1,(gsl_vector const *)arg2);
^
swig_src/gslwrap_wrap.c:15068:17: note: did you mean '_wrap_gsl_linalg_cholesky_scale_apply'?
swig_src/gslwrap_wrap.c:15031:22: note: '_wrap_gsl_linalg_cholesky_scale_apply' declared here
SWIGINTERN PyObject *_wrap_gsl_linalg_cholesky_scale_apply(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
^
swig_src/gslwrap_wrap.c:15133:17: error: implicit declaration of function 'gsl_linalg_cholesky_decomp2' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
result = (int)gsl_linalg_cholesky_decomp2(arg1,arg2);
^
swig_src/gslwrap_wrap.c:15133:17: note: did you mean 'gsl_linalg_cholesky_decomp'?
/usr/local/include/gsl/gsl_linalg.h:423:5: note: 'gsl_linalg_cholesky_decomp' declared here
int gsl_linalg_cholesky_decomp (gsl_matrix * A);
^
swig_src/gslwrap_wrap.c:15213:17: error: implicit declaration of function 'gsl_linalg_cholesky_svx2' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
result = (int)gsl_linalg_cholesky_svx2((gsl_matrix const *)arg1,(gsl_vector const *)arg2,arg3);
^
swig_src/gslwrap_wrap.c:15213:17: note: did you mean 'gsl_linalg_cholesky_svx'?
/usr/local/include/gsl/gsl_linalg.h:429:5: note: 'gsl_linalg_cholesky_svx' declared here
int gsl_linalg_cholesky_svx (const gsl_matrix * cholesky,
^
swig_src/gslwrap_wrap.c:15318:17: error: implicit declaration of function 'gsl_linalg_cholesky_solve2' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
result = (int)gsl_linalg_cholesky_solve2((gsl_matrix const *)arg1,(gsl_vector const *)arg2,(gsl_vector const *)arg3,arg4);
^
swig_src/gslwrap_wrap.c:15318:17: note: did you mean 'gsl_linalg_cholesky_solve'?
/usr/local/include/gsl/gsl_linalg.h:425:5: note: 'gsl_linalg_cholesky_solve' declared here
int gsl_linalg_cholesky_solve (const gsl_matrix * cholesky,
^
swig_src/gslwrap_wrap.c:15412:17: error: implicit declaration of function 'gsl_linalg_cholesky_rcond' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
result = (int)gsl_linalg_cholesky_rcond((gsl_matrix const *)arg1,arg2,arg3);
^
swig_src/gslwrap_wrap.c:15412:17: note: did you mean 'gsl_linalg_cholesky_decomp'?
/usr/local/include/gsl/gsl_linalg.h:423:5: note: 'gsl_linalg_cholesky_decomp' declared here
int gsl_linalg_cholesky_decomp (gsl_matrix * A);
^
swig_src/gslwrap_wrap.c:15636:17: error: implicit declaration of function 'gsl_linalg_pcholesky_decomp' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
result = (int)gsl_linalg_pcholesky_decomp(arg1,arg2);
^
swig_src/gslwrap_wrap.c:15636:17: note: did you mean 'gsl_linalg_cholesky_decomp'?
/usr/local/include/gsl/gsl_linalg.h:423:5: note: 'gsl_linalg_cholesky_decomp' declared here
int gsl_linalg_cholesky_decomp (gsl_matrix * A);
^
swig_src/gslwrap_wrap.c:15715:17: error: implicit declaration of function 'gsl_linalg_pcholesky_solve' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
result = (int)gsl_linalg_pcholesky_solve((gsl_matrix const *)arg1,(struct gsl_permutation_struct const *)arg2,(gsl_vector const *)arg3,arg4);
^
swig_src/gslwrap_wrap.c:15715:17: note: did you mean 'gsl_linalg_cholesky_solve'?
/usr/local/include/gsl/gsl_linalg.h:425:5: note: 'gsl_linalg_cholesky_solve' declared here
int gsl_linalg_cholesky_solve (const gsl_matrix * cholesky,
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
2 warnings and 20 errors generated.
error: Command "cc -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -iwithsysroot /usr/local/libressl/include -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -pipe -DSWIG_COBJECT_TYPES=1 -DDEBUG=1 -DPyGSL_SET_GSL_ERROR_HANDLER=1 -DNUMERIC=0 -UNDEBUG -I/usr/local/include -IInclude -I. -I/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/core/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c swig_src/gslwrap_wrap.c -o build/temp.macosx-12.1-x86_64-2.7/swig_src/gslwrap_wrap.o" failed with exit status 1
我该如何解决这个问题?我安装了 swig 模块:
swig -version
SWIG Version 4.0.2
Compiled with clang++ [x86_64-apple-darwin21.1.0]
Configured options: +pcre
提前致谢!