[issue38628] Issue with ctypes in AIX
Ayappan added the comment: Any update on this ? -- ___ Python tracker <https://bugs.python.org/issue38628> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue38628] Issue with ctypes in AIX
New submission from Ayappan : There seems to be a behavioral issue with ctypes in AIX. The specific symptom is that passing structures containing arrays to a C function by value appears to be broken. Consider the below program., #!/usr/bin/env python3 from ctypes import * libc = CDLL('libc.a(shr_64.o)') class MemchrArgsHack(Structure): _fields_ = [("s", c_char_p), ("c", c_ulong), ("n", c_ulong)] memchr_args_hack = MemchrArgsHack() memchr_args_hack.s = b"abcdef" memchr_args_hack.c = ord('d') memchr_args_hack.n = 7 class MemchrArgsHack2(Structure): _fields_ = [("s", c_char_p), ("c_n", c_ulong * 2)] memchr_args_hack2 = MemchrArgsHack2() memchr_args_hack2.s = b"abcdef" memchr_args_hack2.c_n[0] = ord('d') memchr_args_hack2.c_n[1] = 7 print( CFUNCTYPE(c_char_p, c_char_p, c_uint, c_ulong, c_void_p)(('memchr', libc))(b"abcdef", c_uint(ord('d')), c_ulong(7), None)) print( CFUNCTYPE(c_char_p, MemchrArgsHack, c_void_p)(('memchr', libc))(memchr_args_hack, None)) print( CFUNCTYPE(c_char_p, MemchrArgsHack2, c_void_p)(('memchr', libc))(memchr_args_hack2, None)) This one uses memchr from the C library and passing it structures that would map to the registers that correspond to the arguments of memchr. This works for the first structure type in the reproducer; however, using the second structure type (which should be treated the same way) does not work. In the failing case, the last register that should be used for the structure is not populated from the structure. The reproducer passes an extra argument so that the register is instead populated from that argument for the failing case (instead of working because the register still contains the correct value from a previous call). The output should be the same for all three calls, but we get: b'def' b'def' None The last line is None, because memchr got 0 (the None passed on the call) for its length argument. -- components: ctypes messages: 355632 nosy: Ayappan priority: normal severity: normal status: open title: Issue with ctypes in AIX type: behavior versions: Python 3.7 ___ Python tracker <https://bugs.python.org/issue38628> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue35198] Build issue while compiling cpp files in AIX
Ayappan added the comment: Not sure what went wrong here. I used gcc & g++ and didn't hit this issue. -- ___ Python tracker <https://bugs.python.org/issue35198> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue35198] Build issue while compiling cpp files in AIX
Ayappan added the comment: The PR 10437 worked !!!. Now i am able to compile pandas-0.23.4 Michael Felt, About the re-declaration issues you are facing, that is because of the "#define _LARGE_FILES 1" in pyconfig-ppc64.h file. For 64bit build we actually don't need it. For 32bit build, we need it and also we have to pass the flag "-D_LARGE_FILES" through the _sysconfigdata_m_aix6_.py , otherwise one will get this re-declaration error. -- ___ Python tracker <https://bugs.python.org/issue35198> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue35198] Build issue while compiling cpp files in AIX
New submission from Ayappan : I am trying to build pandas-0.23.4 using python3 in AIX. Everything goes fine till it encounters a cpp file. Below is the compile error output. building 'pandas._libs.window' extension gcc -fPIC -maix64 -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -I/usr/include -I/opt/freeware/include -I/opt/freeware/include/ncurses -DAIX_GENUINE_CPLUSCPLUS -D_LINUX_SOURCE_COMPAT -Wl,-brtl -O2 -I/usr/include -I/opt/freeware/include -I/opt/freeware/include/ncurses -DAIX_GENUINE_CPLUSCPLUS -D_LINUX_SOURCE_COMPAT -Wl,-brtl -O2 -Ipandas/_libs/src/klib -Ipandas/_libs/src -I/opt/freeware/lib64/python3.6/site-packages/numpy/core/include -I/opt/freeware/include/python3.6m -c pandas/_libs/window.cpp -o build/temp.aix-7.2-3.6/pandas/_libs/window.o -Wno-unused-function In file included from /opt/freeware/lib64/python3.6/site-packages/numpy/core/include/numpy/ndarraytypes.h:1821, from /opt/freeware/lib64/python3.6/site-packages/numpy/core/include/numpy/ndarrayobject.h:18, from /opt/freeware/lib64/python3.6/site-packages/numpy/core/include/numpy/arrayobject.h:4, from pandas/_libs/window.cpp:587: /opt/freeware/lib64/python3.6/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 " \ ^~~ g++ gcc -maix64 -pthread -bI:/opt/freeware/lib/python3.6/config-3.6m/python.exp -L. -L/usr/include -L/opt/freeware/include -L/usr/lib/threads -L/opt/freeware/lib64 -L/opt/freeware/lib -L/usr/lib64 -L/usr/lib -L. -L/usr/include -L/opt/freeware/include -L/usr/lib/threads -L/opt/freeware/lib64 -L/opt/freeware/lib -L/usr/lib64 -L/usr/lib build/temp.aix-7.2-3.6/pandas/_libs/window.o -L/opt/freeware/lib64 -o build/lib.aix-7.2-3.6/pandas/_libs/window.so g++: error: gcc: No such file or directory g++: error: unrecognized command line option '-bI:/opt/freeware/lib/python3.6/config-3.6m/python.exp' error: command 'g++' failed with exit status 1 Seems like somewhere setting up the proper compile options for compiling cpp files is not proper. Any hint will be really useful. -- components: Build messages: 329522 nosy: Ayappan priority: normal severity: normal status: open title: Build issue while compiling cpp files in AIX type: compile error versions: Python 3.7 ___ Python tracker <https://bugs.python.org/issue35198> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com