When building Sherpa 4.7 from sources on Ubuntu 12.04 with the system's Python and numpy, one gets the following error:
building 'sherpa.estmethods._est_funcs' extension
compiling C++ sources
C compiler: g++ -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -fPIC
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/sherpa
creating build/temp.linux-x86_64-2.7/sherpa/estmethods
creating build/temp.linux-x86_64-2.7/sherpa/estmethods/src
compile options: '-Isherpa/include -Isherpa/utils/src -Isherpa/utils/src/gsl -I/usr/lib/python2.7/dist-packages/numpy/core/include -I/usr/include/python2.7 -c'
g++: sherpa/estmethods/src/estwrappers.cc
In file included from sherpa/include/sherpa/extension.hh:23:0,
from sherpa/estmethods/src/estwrappers.cc:20:
sherpa/include/sherpa/array.hh: In member function ‘int sherpa::Array<CType, ArrayType>::create(int, const npy_intp*, CType*)’:
sherpa/include/sherpa/array.hh:53:21: error: ‘NPY_ARRAY_CARRAY’ was not declared in this scope
sherpa/include/sherpa/array.hh: In member function ‘int sherpa::Array<CType, ArrayType>::from_obj(PyObject*, bool)’:
sherpa/include/sherpa/array.hh:138:9: error: ‘NPY_ARRAY_CARRAY’ was not declared in this scope
sherpa/include/sherpa/array.hh:138:9: error: ‘NPY_ARRAY_BEHAVED’ was not declared in this scope
sherpa/estmethods/src/estwrappers.cc: In function ‘PyObject* _wrap_info_matrix(PyObject*, PyObject*)’:
sherpa/estmethods/src/estwrappers.cc:346:34: error: ‘NPY_ARRAY_CARRAY’ was not declared in this scope
sherpa/include/sherpa/array.hh: In member function ‘int sherpa::Array<CType, ArrayType>::create(int, const npy_intp*, CType*) [with CType = double, int ArrayType = 12, npy_intp = long int]’:
sherpa/include/sherpa/array.hh:54:5: warning: control reaches end of non-void function [-Wreturn-type]
sherpa/include/sherpa/array.hh: In member function ‘int sherpa::Array<CType, ArrayType>::create(int, const npy_intp*, CType*) [with CType = int, int ArrayType = 5, npy_intp = long int]’:
sherpa/include/sherpa/array.hh:54:5: warning: control reaches end of non-void function [-Wreturn-type]
sherpa/estmethods/src/estutils.hh: At global scope:
sherpa/estmethods/src/estutils.hh:48:15: warning: ‘double get_stat(double*, double*, int, const double*, const double*, const double*, int, double (*)(double*, int))’ declared ‘static’ but never defined [-Wunused-function]
In file included from sherpa/include/sherpa/extension.hh:23:0,
from sherpa/estmethods/src/estwrappers.cc:20:
sherpa/include/sherpa/array.hh: In member function ‘int sherpa::Array<CType, ArrayType>::create(int, const npy_intp*, CType*)’:
sherpa/include/sherpa/array.hh:53:21: error: ‘NPY_ARRAY_CARRAY’ was not declared in this scope
sherpa/include/sherpa/array.hh: In member function ‘int sherpa::Array<CType, ArrayType>::from_obj(PyObject*, bool)’:
sherpa/include/sherpa/array.hh:138:9: error: ‘NPY_ARRAY_CARRAY’ was not declared in this scope
sherpa/include/sherpa/array.hh:138:9: error: ‘NPY_ARRAY_BEHAVED’ was not declared in this scope
sherpa/estmethods/src/estwrappers.cc: In function ‘PyObject* _wrap_info_matrix(PyObject*, PyObject*)’:
sherpa/estmethods/src/estwrappers.cc:346:34: error: ‘NPY_ARRAY_CARRAY’ was not declared in this scope
sherpa/include/sherpa/array.hh: In member function ‘int sherpa::Array<CType, ArrayType>::create(int, const npy_intp*, CType*) [with CType = double, int ArrayType = 12, npy_intp = long int]’:
sherpa/include/sherpa/array.hh:54:5: warning: control reaches end of non-void function [-Wreturn-type]
sherpa/include/sherpa/array.hh: In member function ‘int sherpa::Array<CType, ArrayType>::create(int, const npy_intp*, CType*) [with CType = int, int ArrayType = 5, npy_intp = long int]’:
sherpa/include/sherpa/array.hh:54:5: warning: control reaches end of non-void function [-Wreturn-type]
sherpa/estmethods/src/estutils.hh: At global scope:
sherpa/estmethods/src/estutils.hh:48:15: warning: ‘double get_stat(double*, double*, int, const double*, const double*, const double*, int, double (*)(double*, int))’ declared ‘static’ but never defined [-Wunused-function]
region_util.c: In function ‘regComposeAllocShape’:
region_util.c:514:7: warning: format not a string literal and no format arguments [-Wformat-security]
region_util.c: In function ‘regPrintShape’:
region_util.c:651:7: warning: format not a string literal and no format arguments [-Wformat-security]
stack.c: In function 'stk_test':
stack.c:1116:9: warning: ignoring return value of 'fscanf', declared with attribute warn_unused_result [-Wunused-result]
stack.c: In function 'fgets_trim':
stack.c:997:7: warning: ignoring return value of 'fgets', declared with attribute warn_unused_result [-Wunused-result]
stack.c: In function 'stk_test':
stack.c:1116:9: warning: ignoring return value of 'fscanf', declared with attribute warn_unused_result [-Wunused-result]
stack.c: In function 'fgets_trim':
stack.c:997:7: warning: ignoring return value of 'fgets', declared with attribute warn_unused_result [-Wunused-result]
pystk.c: In function '_stk_build':
pystk.c:88:7: warning: ignoring return value of 'pipe', declared with attribute warn_unused_result [-Wunused-result]
wcssubs-3.8.7/imhfile.c: In function 'irafwhead':
wcssubs-3.8.7/imhfile.c:913:5: warning: ignoring return value of 'ftruncate', declared with attribute warn_unused_result [-Wunused-result]
In file included from /usr/include/string.h:642:0,
from wcssubs-3.8.7/imhfile.c:83:
In function 'strncat',
inlined from 'same_path' at wcssubs-3.8.7/imhfile.c:1078:2:
/usr/include/x86_64-linux-gnu/bits/string3.h:152:3: warning: call to __builtin___strncat_chk might overflow destination buffer [enabled by default]
wcssubs-3.8.7/fileutil.c: In function 'first_token':
wcssubs-3.8.7/fileutil.c:346:6: warning: ignoring return value of 'fgets', declared with attribute warn_unused_result [-Wunused-result]
rmbadname1: Replacing "max" with "max_bn".
rmbadname1: Replacing "max" with "max_bn".
error: Command "g++ -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -fPIC -Isherpa/include -Isherpa/utils/src -Isherpa/utils/src/gsl -I/usr/lib/python2.7/dist-packages/numpy/core/include -I/usr/include/python2.7 -c sherpa/estmethods/src/estwrappers.cc -o build/temp.linux-x86_64-2.7/sherpa/estmethods/src/estwrappers.o" failed with exit status 1
Most likely this has to do with the version of Numpy.
By the way, Numpy 1.6 was never supported by CIAO. We went from 1.5 (CIAO 4.5) to 1.7 (CIAO 4.6).
We should confirm that the Numpy version is the cause of the build failure, and then decide whether we want to support older versions of Numpy, or we want to explicitly mention what versions of Numpy are supported. Maybe our code should check the Numpy version and fail if it is not supported. And we should probably update our Travis CI configuration to build and test Sherpa with the Numpy versions we support.
We should probably keep this issue open until we confirm the cause of the failure and we decide how to proceed. Then maybe we should open different issues/pull requests with whatever actions we decide to take.