Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

ctypes for AIX

202 views
Skip to first unread message

Waddle, Jim

unread,
Jan 24, 2010, 8:54:20 AM1/24/10
to pytho...@python.org
I need to use ctypes with python running on AIX. It appears that python is being developed mostly for windows. Is there a policy concerning getting functions like ctypes working on AIX.

Jim Waddle
KIT-D
425-785-5194

Chris Rebert

unread,
Jan 24, 2010, 9:30:57 AM1/24/10
to Waddle, Jim, pytho...@python.org
On Sun, Jan 24, 2010 at 5:54 AM, Waddle, Jim <jim.w...@boeing.com> wrote:
> I need to use ctypes with python running on AIX.

According to the ctypes readme, ctypes is based on libffi, which
according to its website, supports AIX for PowerPC64.
So, perhaps you could state what the actual error or problem you're
encountering is?
It is theoretically possible the ctypes-bundled libffi is either
outdated or had the AIX-specific bits removed; I don't know, I'm not a
CPython dev.

> It appears that python is being developed mostly for windows.

No, not really; your statement is especially ironic considering one of
Python's primary areas of use is for web applications as part of a
LAMP stack.

> Is there a policy concerning getting functions like ctypes working on AIX.

No idea. Someone will probably chime in though.

Cheers,
Chris
--
http://blog.rebertia.com

Andrew MacIntyre

unread,
Jan 24, 2010, 6:43:50 PM1/24/10
to pytho...@python.org
Waddle, Jim wrote:
> Is there a policy concerning getting functions like ctypes working on AIX.

If you can get it working, post a patch on the bug tracker.

--
-------------------------------------------------------------------------
Andrew I MacIntyre "These thoughts are mine alone..."
E-mail: and...@bullseye.apana.org.au (pref) | Snail: PO Box 370
and...@pcug.org.au (alt) | Belconnen ACT 2616
Web: http://www.andymac.org/ | Australia

Waddle, Jim

unread,
Jan 25, 2010, 6:36:32 PM1/25/10
to Chris Rebert, pytho...@python.org

Chris,
Thanks for responding to my email.
I apologize for the remark about python only being developed for windows. I got the impression when I was looking at the ActivePython web site and saw that the version of python that they had available was not supported on very many unix systems. I should not make general statement based on only one web site. After reading your email I decided to see for myself what the issue was about compiling python on AIX 5.3.

This is the error I saw the first time I tried to use ctypes.

Python 2.4.3 (#1, Jul 17 2006, 20:00:23) [C] on aix5
Type "help", "copyright", "credits" or "license" for more information.
>>> import ctypes
Traceback (most recent call last):
File "<stdin>", line 1, in ?
ImportError: No module named ctypes

This version of python was downloaded and installed from ActivePython and when I checked their webpage it states that ctypes is not available on AIX.
I then figured I would get a new copy of python and install it on AIX. I downloaded python.2.5.5c2 from http://www.python.org. I did the configure and make which posted many errors in the ctypes function which I guess is the reason that is does not get include in the final make.

an example of the build error I get when doing the make is:
xlc_r -q64 -DNDEBUG -O -I. -I/s/users/cz030a/xferjunk/python/Python-2.5.5c2/./Include -Ibuild/temp.aix-5.3-2.5/libffi/inclu
de -Ibuild/temp.aix-5.3-2.5/libffi -I/s/users/cz030a/xferjunk/python/Python-2.5.5c2/Modules/_ctypes/libffi/src -I/s/users/c
z030a/xferjunk/ots/python2.5/include -I. -IInclude -I./Include -I/s/users/cz030a/xferjunk/python/Python-2.5.5c2/Include -I/
s/users/cz030a/xferjunk/python/Python-2.5.5c2 -c /s/users/cz030a/xferjunk/python/Python-2.5.5c2/Modules/_ctypes/_ctypes.c -
o build/temp.aix-5.3-2.5/s/users/cz030a/xferjunk/python/Python-2.5.5c2/Modules/_ctypes/_ctypes.o
"/s/users/cz030a/xferjunk/python/Python-2.5.5c2/Modules/_ctypes/_ctypes.c", line 2820.31: 1506-068 (W) Operation between ty
pes "void*" and "int(*)(void)" is not allowed.
"/s/users/cz030a/xferjunk/python/Python-2.5.5c2/Modules/_ctypes/_ctypes.c", line 3363.28: 1506-280 (W) Function argument as
signment between types "int(*)(void)" and "void*" is not allowed.
"/s/users/cz030a/xferjunk/python/Python-2.5.5c2/Modules/_ctypes/_ctypes.c", line 4768.67: 1506-280 (W) Function argument as
signment between types "void*" and "void*(*)(void*,const void*,unsigned long)" is not allowed.
"/s/users/cz030a/xferjunk/python/Python-2.5.5c2/Modules/_ctypes/_ctypes.c", line 4769.66: 1506-280 (W) Function argument as
signment between types "void*" and "void*(*)(void*,int,unsigned long)" is not allowed.

I do not have sufficient knowledge to know how to fix this. I would think that this error somehow is related to compiling on aix. If you have any suggestions on how to correct this problem , I would appreciate it

Jim Waddle
KIT-D
425-785-5194

-----Original Message-----
From: ch...@rebertia.com [mailto:ch...@rebertia.com] On Behalf Of Chris Rebert
Sent: Sunday, January 24, 2010 7:31 AM
To: Waddle, Jim
Cc: pytho...@python.org
Subject: Re: ctypes for AIX

On Sun, Jan 24, 2010 at 5:54 AM, Waddle, Jim <jim.w...@boeing.com> wrote:
> I need to use ctypes with python running on AIX.

According to the ctypes readme, ctypes is based on libffi, which
according to its website, supports AIX for PowerPC64.
So, perhaps you could state what the actual error or problem you're
encountering is?
It is theoretically possible the ctypes-bundled libffi is either
outdated or had the AIX-specific bits removed; I don't know, I'm not a
CPython dev.

> It appears that python is being developed mostly for windows.

No, not really; your statement is especially ironic considering one of
Python's primary areas of use is for web applications as part of a
LAMP stack.

> Is there a policy concerning getting functions like ctypes working on AIX.

No idea. Someone will probably chime in though.

nn

unread,
Jan 26, 2010, 11:07:51 AM1/26/10
to
On Jan 25, 6:36 pm, "Waddle, Jim" <jim.wad...@boeing.com> wrote:
> Chris,
> Thanks for responding to my email.
> I apologize for the remark about python only being developed for windows. I got the impression when I was looking at the ActivePython web site and saw that the version of python that they had available was not supported on very many unix systems. I should not make general statement based on only one web site. After reading your email I decided to see for myself what the issue was about compiling python on AIX 5.3.
>
> This is the error I saw the first time I tried to use ctypes.
>
> Python 2.4.3 (#1, Jul 17 2006, 20:00:23) [C] on aix5
> Type "help", "copyright", "credits" or "license" for more information.>>> import ctypes
>
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
> ImportError: No module named ctypes
>
> This version of python was downloaded and installed from ActivePython and when I checked their webpage it states that ctypes is not available on AIX.
> I then figured I would get a new copy of python and install it on AIX. I downloaded python.2.5.5c2 fromhttp://www.python.org. I did the configure and make which posted many errors in the ctypes function which I guess is the reason that is does not get include in the final make.

>
> an example of the build error I get when doing the make is:
> xlc_r -q64 -DNDEBUG -O -I. -I/s/users/cz030a/xferjunk/python/Python-2.5.5c2/./Include -Ibuild/temp.aix-5.3-2.5/libffi/inclu
> de -Ibuild/temp.aix-5.3-2.5/libffi -I/s/users/cz030a/xferjunk/python/Python-2.5.5c2/Modules/_ctypes/libffi/src -I/s/users/c
> z030a/xferjunk/ots/python2.5/include -I. -IInclude -I./Include -I/s/users/cz030a/xferjunk/python/Python-2.5.5c2/Include -I/
> s/users/cz030a/xferjunk/python/Python-2.5.5c2 -c /s/users/cz030a/xferjunk/python/Python-2.5.5c2/Modules/_ctypes/_ctypes.c -
> o build/temp.aix-5.3-2.5/s/users/cz030a/xferjunk/python/Python-2.5.5c2/Modules/_ctypes/_ctypes.o
> "/s/users/cz030a/xferjunk/python/Python-2.5.5c2/Modules/_ctypes/_ctypes.c", line 2820.31: 1506-068 (W) Operation between ty
> pes "void*" and "int(*)(void)" is not allowed.
> "/s/users/cz030a/xferjunk/python/Python-2.5.5c2/Modules/_ctypes/_ctypes.c", line 3363.28: 1506-280 (W) Function argument as
> signment between types "int(*)(void)" and "void*" is not allowed.
> "/s/users/cz030a/xferjunk/python/Python-2.5.5c2/Modules/_ctypes/_ctypes.c", line 4768.67: 1506-280 (W) Function argument as
> signment between types "void*" and "void*(*)(void*,const void*,unsigned long)" is not allowed.
> "/s/users/cz030a/xferjunk/python/Python-2.5.5c2/Modules/_ctypes/_ctypes.c", line 4769.66: 1506-280 (W) Function argument as
> signment between types "void*" and "void*(*)(void*,int,unsigned long)" is not allowed.
>
> I do not have sufficient knowledge to know how to fix this. I would think that this error somehow is related to compiling on aix. If you have any suggestions on how to correct this problem , I would appreciate it
>
> Jim Waddle
> KIT-D
> 425-785-5194
>
> -----Original Message-----
> From: ch...@rebertia.com [mailto:ch...@rebertia.com] On Behalf Of Chris Rebert
> Sent: Sunday, January 24, 2010 7:31 AM
> To: Waddle, Jim
>
> Cc: python-l...@python.org

> Subject: Re: ctypes for AIX
>
> On Sun, Jan 24, 2010 at 5:54 AM, Waddle, Jim <jim.wad...@boeing.com> wrote:
> > I need to use ctypes with python running on AIX.
>
> According to the ctypes readme, ctypes is based on libffi, which
> according to its website, supports AIX for PowerPC64.
> So, perhaps you could state what the actual error or problem you're
> encountering is?
> It is theoretically possible the ctypes-bundled libffi is either
> outdated or had the AIX-specific bits removed; I don't know, I'm not a
> CPython dev.
>
> > It appears that python is being developed mostly for windows.
>
> No, not really; your statement is especially ironic considering one of
> Python's primary areas of use is for web applications as part of a
> LAMP stack.
>
> > Is there a policy concerning getting functions like ctypes working on AIX.
>
> No idea. Someone will probably chime in though.
>
> Cheers,
> Chris
> --http://blog.rebertia.com
>
>

Look at this website:

http://pware.hvcc.edu/news.html

"8/1/2009 Python with ctypes!"

Good luck.

M.-A. Lemburg

unread,
Jan 26, 2010, 12:21:09 PM1/26/10
to Waddle, Jim, pytho...@python.org
Waddle, Jim wrote:
> I need to use ctypes with python running on AIX. It appears that python is being developed mostly for windows. Is there a policy concerning getting functions like ctypes working on AIX.

If you can provide patches to get ctypes working on AIX, we'd
consider adding those to the core.

Please file patch or bug describing the problems you are having
on AIX with the tracker:

http://bugs.python.org/

Thanks,
--
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source (#1, Jan 26 2010)
>>> Python/Zope Consulting and Support ... http://www.egenix.com/
>>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/
________________________________________________________________________

::: Try our new mxODBC.Connect Python Database Interface for free ! ::::


eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48
D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
Registered at Amtsgericht Duesseldorf: HRB 46611
http://www.egenix.com/company/contact/

Antoine Pitrou

unread,
Jan 27, 2010, 10:56:10 AM1/27/10
to pytho...@python.org

Hello,

> I then figured I would get a new copy of python and install it

> on AIX. I downloaded python.2.5.5c2 from http://www.python.org. I did


> the configure and make which posted many errors in the ctypes function
> which I guess is the reason that is does not get include in the final
> make.

I would suggest two things:
1) try with the latest Python 2.6.x, because 2.5 only receives security
fixes now. 2.6 is the stable branch which receives regular bug fixes
(which includes build problems)
2) if Python 2.6.x also fails compiling, please file a bug report on
http://bugs.python.org

Regards

Antoine.

sjw

unread,
Apr 22, 2011, 9:26:30 AM4/22/11
to
I need to!But ctypes can't work on AIX.......
Need help..........


Stefan Behnel

unread,
Apr 22, 2011, 9:40:55 AM4/22/11
to pytho...@python.org
sjw, 22.04.2011 15:26:

> I need to!But ctypes can't work on AIX.......
> Need help..........

What are you trying to do, and why do you need ctypes for it?

Stefan

Anssi Saari

unread,
Apr 22, 2011, 10:30:07 AM4/22/11
to
"Waddle, Jim" <jim.w...@boeing.com> writes:

> I do not have sufficient knowledge to know how to fix this. I would think that this error somehow is related to compiling on aix. If you have any suggestions on how to correct this problem , I would appreciate it

I'd have to guess your main problem is not using gcc to compile. From
a quick look, that's what the guys at the pware site did.

daixtr

unread,
Jul 28, 2015, 9:19:13 PM7/28/15
to
I'm facing the same issue. No 'ctypes' in python 2.6/2.7 that i'm able to succesfully install via an AIX ppc rpm package.

what's the story here?
0 new messages