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

[Python] build warning in python #27199

Closed
asfimport opened this issue Jan 18, 2021 · 1 comment
Closed

[Python] build warning in python #27199

asfimport opened this issue Jan 18, 2021 · 1 comment

Comments

@asfimport
Copy link
Collaborator

Many warnings about compute kernel options when building Arrow python.
Removing below line suppresses the warnings.

virtual ~FunctionOptions() = default;

I think the reason is virtual destructor makes the structure non C compatible and cannot use offsetof macro safely.
As function options are straightforward, looks destructor is not necessary.
@bkietz

Steps to reproduce
build arrow cpp

 ~/arrow/cpp/release $ cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DARROW_COMPUTE=ON -DARROW_BUILD_TESTS=ON -DCMAKE_INSTALL_PREFIX=$(pwd)/_install -DCMAKE_INSTALL_LIBDIR=lib -DARROW_PYTHON=ON -DCMAKE_CXX_COMPILER=/usr/bin/clang++-9 -DCMAKE_C_COMPILER=/usr/bin/clang-9 ..

~/arrow/cpp/release $ ninja install

build arrow python

 ~/arrow/python $ python --version
 Python 3.6.9

~/arrow/python $ python setup.py build_ext --inplace
 ......
 [ 93%] Building CXX object CMakeFiles/_compute.dir/_compute.cpp.o [27/1691]
 In file included from /usr/include/x86_64-linux-gnu/bits/types/stack_t.h:23:0, 
 from /usr/include/signal.h:303,
 from /home/cyb/archery/lib/python3.6/site-packages/numpy/core/include/numpy/npy_interrupt.h:84,
 from /home/cyb/archery/lib/python3.6/site-packages/numpy/core/include/numpy/arrayobject.h:5,
 from /home/cyb/arrow/cpp/release/_install/include/arrow/python/numpy_interop.h:41,
 from /home/cyb/arrow/cpp/release/_install/include/arrow/python/helpers.h:27,
 from /home/cyb/arrow/cpp/release/_install/include/arrow/python/api.h:24,
 from /home/cyb/arrow/python/build/temp.linux-x86_64-3.6/_compute.cpp:696:
 /home/cyb/arrow/python/build/temp.linux-x86_64-3.6/_compute.cpp: In function ‘int __Pyx_modinit_type_init_code()’:
 /home/cyb/arrow/python/build/temp.linux-x86_64-3.6/_compute.cpp:26034:146: warning: offsetof within non-standard-layout type ‘__pyx_obj_7pyarrow_8_compute__CastOptions’ is undefined [-Winvalid-offsetof]
 x_type_7pyarrow_8_compute__CastOptions.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_8_compute__CastOptions, __pyx_base.__pyx_base.__weakref__);
 ^
 /home/cyb/arrow/python/build/temp.linux-x86_64-3.6/_compute.cpp:26066:150: warning: offsetof within non-standard-layout type ‘__pyx_obj_7pyarrow_8_compute__FilterOptions’ is undefined [-Winvalid-offsetof]
 type_7pyarrow_8_compute__FilterOptions.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_8_compute__FilterOptions, __pyx_base.__pyx_base.__weakref__);
 ^
 /home/cyb/arrow/python/build/temp.linux-x86_64-3.6/_compute.cpp:26082:146: warning: offsetof within non-standard-layout type ‘__pyx_obj_7pyarrow_8_compute__TakeOptions’ is undefined [-Winvalid-offsetof]
 x_type_7pyarrow_8_compute__TakeOptions.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_8_compute__TakeOptions, __pyx_base.__pyx_base.__weakref__);
 ^
 /home/cyb/arrow/python/build/temp.linux-x86_64-3.6/_compute.cpp:26130:150: warning: offsetof within non-standard-layout type ‘__pyx_obj_7pyarrow_8_compute__MinMaxOptions’ is undefined [-Winvalid-offsetof]
 type_7pyarrow_8_compute__MinMaxOptions.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_8_compute__MinMaxOptions, __pyx_base.__pyx_base.__weakref__);
 ^
 /home/cyb/arrow/python/build/temp.linux-x86_64-3.6/_compute.cpp:26146:148: warning: offsetof within non-standard-layout type ‘__pyx_obj_7pyarrow_8_compute__CountOptions’ is undefined [-Winvalid-offsetof]
 _type_7pyarrow_8_compute__CountOptions.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_8_compute__CountOptions, __pyx_base.__pyx_base.__weakref__);
 ^ 
 /home/cyb/arrow/python/build/temp.linux-x86_64-3.6/_compute.cpp:26162:146: warning: offsetof within non-standard-layout type ‘__pyx_obj_7pyarrow_8_compute__ModeOptions’ is undefined [-Winvalid-offsetof]
 x_type_7pyarrow_8_compute__ModeOptions.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_8_compute__ModeOptions, __pyx_base.__pyx_base.__weakref__);
 ^
 /home/cyb/arrow/python/build/temp.linux-x86_64-3.6/_compute.cpp:26210:154: warning: offsetof within non-standard-layout type ‘__pyx_obj_7pyarrow_8_compute__VarianceOptions’ is undefined [-Winvalid-offsetof]
 pe_7pyarrow_8_compute__VarianceOptions.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_8_compute__VarianceOptions, __pyx_base.__pyx_base.__weakref__);
 ^
 /home/cyb/arrow/python/build/temp.linux-x86_64-3.6/_compute.cpp:26258:156: warning: offsetof within non-standard-layout type ‘__pyx_obj_7pyarrow_8_compute__ArraySortOptions’ is undefined [-Winvalid-offsetof]
 e_7pyarrow_8_compute__ArraySortOptions.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_8_compute__ArraySortOptions, __pyx_base.__pyx_base.__weakref__);
 ^
 /home/cyb/arrow/python/build/temp.linux-x86_64-3.6/_compute.cpp:26274:146: warning: offsetof within non-standard-layout type ‘__pyx_obj_7pyarrow_8_compute__SortOptions’ is undefined [-Winvalid-offsetof]
 x_type_7pyarrow_8_compute__SortOptions.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_8_compute__SortOptions, __pyx_base.__pyx_base.__weakref__);
 ......
 

Reporter: Yibo Cai / @cyb70289
Assignee: Yibo Cai / @cyb70289

PRs and other links:

Note: This issue was originally created as ARROW-11299. Please see the migration documentation for further details.

@asfimport
Copy link
Collaborator Author

Ben Kietzman / @bkietz:
Issue resolved by pull request 9274
#9274

@asfimport asfimport added this to the 4.0.0 milestone Jan 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants