-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
build fails with clang, python3 and numpy 1.7.1 and higher #3872
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
Comments
make ur change, run the full test suite, push to travis submit a PR and then it'll probably get merged if that passes. the first error is the one that matters here the numpy stuff is unrelated. returning a value from a void function is undefined and thus the compiler rightly fails |
although i don't get this bug...clang can sometimes be very strict with it's warnings/errors... |
oh i c. this is what happens when c macros look like functions....the pp is rewriting a return statement in there and clang is pickier than gcc... |
@selasley can u try my fix? i don't have an reasonable way to use clang i would have to recompile python plus all of the deps that require cython so that's a bit prohibitive... |
Sorry, I was away from the computer for a while. It builds with your change with python3, but I get an error trying to build with clang and python 2.7 pandas/src/ujson/python/objToJSON.c:118:5: error: non-void function 'initObjToJSON' should return a value [-Wreturn-type] I think the problem arises from this section of generate_numpy_api.py #if PY_VERSION_HEX >= 0x03000000 #define import_array() {if (_import_array() < 0) {PyErr_Print(); PyErr_SetString(PyExc_ImportError, "numpy.core.multiarray failed to import"); return NUMPY_IMPORT_ARRAY_RETVAL; } } So under python 3 import_array() returns NULL and under python 2 it returns no value. Maybe the change should be #if (PY_VERSION_HEX < 0x03000000) I was able to build pandas with clang and python 2.7 and 3.3.2 on my mac running OS X 10.8 with this change. This is my first time forking pandas and trying to use Travis following the CONTRIBUTING docs. I think it built OK - https://travis-ci.org/selasley/pandas/builds/8039302 |
return type should probably be some kind of pointer maybe |
i pushed that fix, we'll see what happens |
good catch. clang did issue a warning |
i'll leave as |
merge the PR and close this one? OK with me if Kieran is OK with the PR |
apparently 2.7 on clang is giving the same issue maybe this is a compiler issue (rather than a version issue)? anyone on mac can test? https://groups.google.com/forum/?fromgroups=#!topic/pydata/8oq0ErM8_eE |
cc @rhstanton |
no the patch i submitted is wrong crap sorry will fix |
@selasley can u test? |
u can do git remote add upstream git://github.com/pydata/pandas
git fetch upstream
git checkout upstream/pr/3936 to get the pr |
On Jun 17, 2013, at 4:06 PM, Phillip Cloud [email protected] wrote:
My access to computers is sporadic for the next several days. I was able to build the latest from github, 964516a, with clang-425.0.28 and python 3.3.2 and 2.7.4 under OS X 10.8 |
The build succeeds if I change
void initObjToJSON(void)
to
int initObjToJSON(void)
in objToJSON.c, but I don't know if there are repercussions. I haven't tested with numpy 1.7 and lower.
$ git log
commit 51cc9d9
...
$ python3 -c "import numpy;print(numpy.version)"
1.7.1
(also fails with 1.8.0.dev-f7ea474)
$ python3 setup.py build
...
pandas/src/ujson/python/objToJSON.c:118:5: error: void function 'initObjToJSON' should not return a value [-Wreturn-type]
import_array();
^~~~~~~~~~~~~~
/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/numpy/core/include/numpy/__multiarray_api.h:1693:144: note: expanded from macro 'import_array'
#define import_array() {if (_import_array() < 0) {PyErr_Print(); PyErr_SetString(PyExc_ImportError, "numpy.core.multiarray failed to import"); return NUMPY_IMPORT_ARRAY_RETVAL; } }
from generate_numpy_api.py
if PY_VERSION_HEX >= 0x03000000
define NUMPY_IMPORT_ARRAY_RETVAL NULL
else
define NUMPY_IMPORT_ARRAY_RETVAL
endif
define import_array() {if (_import_array() < 0) {PyErr_Print(); PyErr_SetString(PyExc_ImportError, "numpy.core.multiarray failed to import"); return NUMPY_IMPORT_ARRAY_RETVAL; } }
The text was updated successfully, but these errors were encountered: