visualfabriq / bquery

A query and aggregation framework for Bcolz (W2013-01)
https://www.visualfabriq.com
BSD 3-Clause "New" or "Revised" License
56 stars 11 forks source link

build error on mac os #75

Closed rabernat closed 7 years ago

rabernat commented 8 years ago

I am trying to install bquery on my mac laptop. When I run setup.py build_ext --inplace I eventually get the following error.

bquery/ctable_ext.c:34929:30: error: use of undeclared identifier '__pyx_pybuffernd_current_buffer'; did you mean
      '__pyx_pybuffernd_out_buffer'?
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_current_buffer.rcbuffer->pybuffer);
                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                             __pyx_pybuffernd_out_buffer
bquery/ctable_ext.c:34649:21: note: '__pyx_pybuffernd_out_buffer' declared here
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out_buffer;

Python and gcc versions:

$ python --version
Python 2.7.12 :: Anaconda 2.3.0 (x86_64)

$ gcc -v
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/c++/4.2.1
Apple LLVM version 7.3.0 (clang-703.0.31)
Target: x86_64-apple-darwin15.5.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
CarstVaartjes commented 8 years ago

Hi,

can you try the following in a virtualenv:

pip install --upgrade pip
pip install --upgrade setuptools
pip install --upgrade bquery

The warning you got is not really an error as such, but a warning. The actual error is likely something else. As an example, my own build feedback:

(venv3) carst@XPS-Carst:~/PycharmProjects/bquery$ python setup.py build_ext --inplace
running build_ext
cythoning bquery/ctable_ext.pyx to bquery/ctable_ext.c
building 'bquery.ctable_ext' extension
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/home/carst/PycharmProjects/bquery/bquery -I/home/carst/venv3/lib/python3.5/site-packages/numpy/core/include -I/usr/include/python3.5m -I/home/carst/venv3/include/python3.5m -c bquery/ctable_ext.c -o build/temp.linux-x86_64-3.5/bquery/ctable_ext.o
In file included from /home/carst/venv3/lib/python3.5/site-packages/numpy/core/include/numpy/ndarraytypes.h:1777:0,
                 from /home/carst/venv3/lib/python3.5/site-packages/numpy/core/include/numpy/ndarrayobject.h:18,
                 from /home/carst/venv3/lib/python3.5/site-packages/numpy/core/include/numpy/arrayobject.h:4,
                 from bquery/ctable_ext.c:274:
/home/carst/venv3/lib/python3.5/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
 #warning "Using deprecated NumPy API, disable it by " \
  ^
In file included from /home/carst/venv3/lib/python3.5/site-packages/numpy/core/include/numpy/ndarrayobject.h:27:0,
                 from /home/carst/venv3/lib/python3.5/site-packages/numpy/core/include/numpy/arrayobject.h:4,
                 from bquery/ctable_ext.c:274:
/home/carst/venv3/lib/python3.5/site-packages/numpy/core/include/numpy/__multiarray_api.h:1448:1: warning: ‘_import_array’ defined but not used [-Wunused-function]
 _import_array(void)
 ^
bquery/ctable_ext.c: In function ‘__pyx_pw_6bquery_10ctable_ext_13apply_where_terms’:
bquery/ctable_ext.c:36965:12: warning: ‘__pyx_v_filter_val’ may be used uninitialized in this function [-Wmaybe-uninitialized]
         if (__pyx_t_19) {
            ^
bquery/ctable_ext.c:36197:7: note: ‘__pyx_v_filter_val’ was declared here
   int __pyx_v_filter_val;
       ^
bquery/ctable_ext.c: In function ‘__pyx_pw_6bquery_10ctable_ext_25__pyx_fuse_1_0aggregate’:
bquery/ctable_ext.c:1332:73: warning: ‘__pyx_pybuffernd_last_values.diminfo[0].strides’ may be used uninitialized in this function [-Wmaybe-uninitialized]
 #define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0)
                                                                         ^
bquery/ctable_ext.c:16784:21: note: ‘__pyx_pybuffernd_last_values.diminfo[0].strides’ was declared here
   __Pyx_LocalBuf_ND __pyx_pybuffernd_last_values;
                     ^
bquery/ctable_ext.c: In function ‘__pyx_pw_6bquery_10ctable_ext_19__pyx_fuse_0_0aggregate’:
bquery/ctable_ext.c:1332:73: warning: ‘__pyx_pybuffernd_last_values.diminfo[0].strides’ may be used uninitialized in this function [-Wmaybe-uninitialized]
 #define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0)
                                                                         ^
bquery/ctable_ext.c:8042:21: note: ‘__pyx_pybuffernd_last_values.diminfo[0].strides’ was declared here
   __Pyx_LocalBuf_ND __pyx_pybuffernd_last_values;
                     ^
bquery/ctable_ext.c: In function ‘__pyx_pw_6bquery_10ctable_ext_27__pyx_fuse_1_1aggregate’:
bquery/ctable_ext.c:1332:73: warning: ‘__pyx_pybuffernd_last_values.diminfo[0].strides’ may be used uninitialized in this function [-Wmaybe-uninitialized]
 #define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0)
                                                                         ^
bquery/ctable_ext.c:19698:21: note: ‘__pyx_pybuffernd_last_values.diminfo[0].strides’ was declared here
   __Pyx_LocalBuf_ND __pyx_pybuffernd_last_values;
                     ^
bquery/ctable_ext.c: In function ‘__pyx_pw_6bquery_10ctable_ext_21__pyx_fuse_0_1aggregate’:
bquery/ctable_ext.c:1332:73: warning: ‘__pyx_pybuffernd_last_values.diminfo[0].strides’ may be used uninitialized in this function [-Wmaybe-uninitialized]
 #define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0)
                                                                         ^
bquery/ctable_ext.c:10956:21: note: ‘__pyx_pybuffernd_last_values.diminfo[0].strides’ was declared here
   __Pyx_LocalBuf_ND __pyx_pybuffernd_last_values;
                     ^
bquery/ctable_ext.c: In function ‘__pyx_pw_6bquery_10ctable_ext_31__pyx_fuse_2_0aggregate’:
bquery/ctable_ext.c:1332:73: warning: ‘__pyx_pybuffernd_last_values.diminfo[0].strides’ may be used uninitialized in this function [-Wmaybe-uninitialized]
 #define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0)
                                                                         ^
bquery/ctable_ext.c:25526:21: note: ‘__pyx_pybuffernd_last_values.diminfo[0].strides’ was declared here
   __Pyx_LocalBuf_ND __pyx_pybuffernd_last_values;
                     ^
bquery/ctable_ext.c: In function ‘__pyx_pw_6bquery_10ctable_ext_33__pyx_fuse_2_1aggregate’:
bquery/ctable_ext.c:1332:73: warning: ‘__pyx_pybuffernd_last_values.diminfo[0].strides’ may be used uninitialized in this function [-Wmaybe-uninitialized]
 #define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0)
                                                                         ^
bquery/ctable_ext.c:28440:21: note: ‘__pyx_pybuffernd_last_values.diminfo[0].strides’ was declared here
   __Pyx_LocalBuf_ND __pyx_pybuffernd_last_values;
                     ^
bquery/ctable_ext.c: In function ‘__pyx_pw_6bquery_10ctable_ext_35__pyx_fuse_2_2aggregate’:
bquery/ctable_ext.c:1332:73: warning: ‘__pyx_pybuffernd_last_values.diminfo[0].strides’ may be used uninitialized in this function [-Wmaybe-uninitialized]
 #define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0)
                                                                         ^
bquery/ctable_ext.c:31354:21: note: ‘__pyx_pybuffernd_last_values.diminfo[0].strides’ was declared here
   __Pyx_LocalBuf_ND __pyx_pybuffernd_last_values;
                     ^
bquery/ctable_ext.c: In function ‘__pyx_pw_6bquery_10ctable_ext_23__pyx_fuse_0_2aggregate’:
bquery/ctable_ext.c:1332:73: warning: ‘__pyx_pybuffernd_last_values.diminfo[0].strides’ may be used uninitialized in this function [-Wmaybe-uninitialized]
 #define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0)
                                                                         ^
bquery/ctable_ext.c:13870:21: note: ‘__pyx_pybuffernd_last_values.diminfo[0].strides’ was declared here
   __Pyx_LocalBuf_ND __pyx_pybuffernd_last_values;
                     ^
bquery/ctable_ext.c: In function ‘__pyx_pw_6bquery_10ctable_ext_29__pyx_fuse_1_2aggregate’:
bquery/ctable_ext.c:1332:73: warning: ‘__pyx_pybuffernd_last_values.diminfo[0].strides’ may be used uninitialized in this function [-Wmaybe-uninitialized]
 #define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0)
                                                                         ^
bquery/ctable_ext.c:22612:21: note: ‘__pyx_pybuffernd_last_values.diminfo[0].strides’ was declared here
   __Pyx_LocalBuf_ND __pyx_pybuffernd_last_values;
                     ^
x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.5/bquery/ctable_ext.o -o build/lib.linux-x86_64-3.5/bquery/ctable_ext.cpython-35m-x86_64-linux-gnu.so
copying build/lib.linux-x86_64-3.5/bquery/ctable_ext.cpython-35m-x86_64-linux-gnu.so -> bquery
rabernat commented 8 years ago

Thanks @CarstVaartjes for the quick reply. I will attempt to try out the virtualenv approach within the next few days. Until now I have used conda exclusively for my environment / package management, so I will have to learn how to use virtualenv first.

If you could provide a conda build for bquery, it would probably accelerate its adoption. That's how I installed bcolz in the first place.

CarstVaartjes commented 8 years ago

Adding conda support is definitely a good idea; but I also have to do some revisions first to the pip part (the dependency on numpy is not handled great for example and the setup.py needs some cleaning) So a 0.21 will get out really soon (really only difference is the dependency handling) and then i will try to do a conda version

CarstVaartjes commented 8 years ago

I made a 0.2.2 (0.2.1 had a slight problem still with numpy dependencies). i've looked into creating a conda version but we have a dependency on bcolz v1.1.0. However v1.0.0 is the latest on conda (some major improvements were made after it that we rely on). I know that @FrancescAlted is extremely busy atm, so i don't know when conda will be updated... I can only test on Linux myself, but the pip install bquery really should work well now (handles dependencies etc.)

CarstVaartjes commented 8 years ago

See also: https://travis-ci.org/visualfabriq/bquery/jobs/163240192 (added OSX to the travis tests and it should work)

rabernat commented 7 years ago

Installation via pip worked this time!

CarstVaartjes commented 7 years ago

Great, happy to hear it!!