我在使用GCC 4.2在Mac OS X上编译Pygsl时遇到问题。我运行了以下内容:
sudo python setup.py install
得到了这个错误:
In file included from testing/src/sf/sfmodule_testing.c:49:
testing/src/sf/sf__data.c:779: error: ‘gsl_sf_exprel_n_CF_e’ undeclared here (not in a function)
testing/src/sf/sf__data.c:806: error: ‘gsl_sf_expint_En_e’ undeclared here (not in a function)
testing/src/sf/sf__data.c:806: error: initializer element is not constant
testing/src/sf/sf__data.c:806: error: (near initialization for ‘sf_expint_En_e_data[0]’)
testing/src/sf/sf__data.c:806: error: initializer element is not constant
testing/src/sf/sf__data.c:806: error: (near initialization for ‘sf_expint_En_e_data[1]’)
testing/src/sf/sf__data.c:809: error: ‘gsl_sf_expint_En’ undeclared here (not in a function)
testing/src/sf/sf__data.c:809: error: initializer element is not constant
testing/src/sf/sf__data.c:809: error: (near initialization for ‘sf_expint_En_data[0]’)
testing/src/sf/sf__data.c:809: error: initializer element is not constant
testing/src/sf/sf__data.c:809: error: (near initialization for ‘sf_expint_En_data[1]’)
testing/src/sf/sf__data.c:824: error: ‘gsl_sf_expint_En_scaled_e’ undeclared here (not in a function)
testing/src/sf/sf__data.c:824: error: initializer element is not constant
testing/src/sf/sf__data.c:824: error: (near initialization for ‘sf_expint_En_scaled_e_data[0]’)
testing/src/sf/sf__data.c:824: error: initializer element is not constant
testing/src/sf/sf__data.c:824: error: (near initialization for ‘sf_expint_En_scaled_e_data[1]’)
testing/src/sf/sf__data.c:827: error: ‘gsl_sf_expint_En_scaled’ undeclared here (not in a function)
testing/src/sf/sf__data.c:827: error: initializer element is not constant
testing/src/sf/sf__data.c:827: error: (near initialization for ‘sf_expint_En_scaled_data[0]’)
testing/src/sf/sf__data.c:827: error: initializer element is not constant
testing/src/sf/sf__data.c:827: error: (near initialization for ‘sf_expint_En_scaled_data[1]’)
testing/src/sf/sfmodule_testing.c:102: warning: initialization from incompatible pointer type
testing/src/sf/sfmodule_testing.c:102: warning: initialization from incompatible pointer type
testing/src/sf/sfmodule_testing.c:145: warning: initialization from incompatible pointer type
testing/src/sf/sfmodule_testing.c:145: warning: initialization from incompatible pointer type
error: Command "gcc -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -O3 -arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk -I/Library/Frameworks/Python.framework/Versions/6.2/include -DSWIG_COBJECT_TYPES=1 -DGSL_RANGE_CHECK=1 -DDEBUG=1 -DNUMERIC=0 -DPYGSL_GSL_MAJOR_VERSION=1 -DPYGSL_GSL_MINOR_VERSION=9 -UNDEBUG -I/usr/local/include -IInclude -I. -I/Library/Frameworks/Python.framework/Versions/6.2/lib/python2.6/site-packages/numpy/core/include -I/Library/Frameworks/Python.framework/Versions/6.2/include/python2.6 -c testing/src/sf/sfmodule_testing.c -o build/temp.macosx-10.5-i386-2.6/testing/src/sf/sfmodule_testing.o" failed with exit status 1
GSL库编译得很好,只有PyGSL才能编译。知道是什么原因引起的吗?谢谢你的帮助。
我的GCC版本是:
$ gcc --version
i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5659)
Copyright (C) 2007 Free Software Foundation, Inc.