Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When make PyArray_SHAPE error #1

Open
PierreHao opened this issue Jul 9, 2015 · 9 comments
Open

When make PyArray_SHAPE error #1

PierreHao opened this issue Jul 9, 2015 · 9 comments

Comments

@PierreHao
Copy link

After download the code, int the root folder, make, but there is an error: 'PyArray_SHAPE' was not declared in this scope. py_liblinear.cpp
Ubuntu 12.04

@alessandroferrari
Copy link
Owner

Hi Pierre, maybe you have to change the NUMPY_INCLUDE = /usr/local/lib/python$(PYTHON_VERSION)/dist-packages/numpy/core/include variable in the makefile. I have set the default dir for Ubuntu 14.04. WHat is the numpy include dir for your machine?

@PierreHao
Copy link
Author

Thank you for your reply. But i find that there isn't any problem with the numpy path in my machine.

@alessandroferrari
Copy link
Owner

It looks clearly a problem with the inclusion of the .hpp numpy header. It may be due to numpy version, even though I think it is unlikely, otherwise it may be due to the wrong path in the include.
Let me know which results give you: 'locate arrayobject.h' on your terminal.

@PierreHao
Copy link
Author

/usr/include/python2.7/bytearrayobject.h
/usr/lib/python2.7/dist-packages/numpy/core/include/numpy/arrayobject.h
/usr/lib/python2.7/dist-packages/numpy/core/include/numpy/ndarrayobject.h
/usr/local/lib/python2.7/dist-packages/numpy/core/include/numpy/arrayobject.h
/usr/local/lib/python2.7/dist-packages/numpy/core/include/numpy/ndarrayobject.h
/usr/share/pyshared/numpy/core/include/numpy/arrayobject.h
/usr/share/pyshared/numpy/core/include/numpy/ndarrayobject.h
The results after locate arrayobject.h

@alessandroferrari
Copy link
Owner

Now try those:
cd /usr/local/lib/python2.7/dist-packages/numpy/core/include/numpy/
grin PyArray_SHAPE

@PierreHao
Copy link
Author

The results:
./ndarraytypes.h:
1581 : PyArray_SHAPE(PyArrayObject *arr)
That means there is PyArray_SHAPE in numpy

@alessandroferrari
Copy link
Owner

Thus, there is either a previous error that generate this one as well, or there are 2 include dir that contains a ndarrayobject.h that make the trouble, I guess.

@PierreHao
Copy link
Author

Thank you. I will check it

@legalto
Copy link

legalto commented Aug 25, 2015

PierreHao, were you ever able to resolve this issue? I've followed your discussion. I'm using numpy 1.9.2 which has PyArray_SHAPE. Was the issue related to multiple include directories? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants