This documentation tries to help people who intend to use Python onAIX.There used to be many issues with Python on AIX, but the major oneshave been corrected for version 3.2, so that Python should now workrather well on this platform. The remaining known issues are listed inthis document.======================================================================Compiling Python----------------------------------------------------------------------You can compile Python with gcc or the native AIX compiler. The nativecompiler used to give better performances on this system with olderversions of Python. With Python 3.2 it may not be the case anymore,as this compiler does not allow compiling Python with computed gotos.Some benchmarks need to be done.Compiling with gcc:cd Python-3.2CC=gcc OPT="-O2" ./configure --enable-sharedmakeThere are various aliases for the native compiler. The recommendedalias for compiling Python is 'xlc_r', which provides a better level ofcompatibility and handles thread initialization properly.It is a good idea to add the '-qmaxmem=70000' option, otherwise thecompiler considers various files too complex to optimize.Compiling with xlc:cd Python-3.2CC=xlc_r OPT="-O2 -qmaxmem=70000" ./configure --without-computed-gotos --enable-sharedmakeNote:On AIX 5.3 and earlier, you will also need to specify the"--disable-ipv6" flag to configure. This has been corrected in AIX6.1.======================================================================Memory Limitations----------------------------------------------------------------------Note: this section may not apply when compiling Python as a 64 bitapplication.By default on AIX each program gets one segment register for its datasegment. As each segment register covers 256 MiB, a Python program thatwould use more than 256 MiB will raise a MemoryError. The standardPython test suite is one such application.To allocate more segment registers to Python, you must use the linkeroption -bmaxdata or the ldedit tool to specify the number of bytes youneed in the data segment.For example, if you want to allow 512 MiB of memory for Python (this isenough for the test suite to run without MemoryErrors), you should runthe following command at the end of compilation:ldedit -b maxdata:0x20000000 ./pythonYou can allow up to 2 GiB of memory for Python by using the value0x80000000 for maxdata.It is also possible to go beyond 2 GiB of memory by activating LargePage Use. You should consult the IBM documentation if you need to usethis option. You can also follow the discussion of this problemin issue 11212 at bugs.python.org.http://publib.boulder.ibm.com/infocenter/aix/v6r1/index.jsp?topic=/com.ibm.aix.cmds/doc/aixcmds3/ldedit.htm======================================================================Known issues----------------------------------------------------------------------Those issues are currently affecting Python on AIX:* Python has not been fully tested on AIX when compiled as a 64 bitapplication.* issue 3526: the memory used by a Python process will never bereleased to the system. If you have a Python application on AIX thatuses a lot of memory, you should read this issue and you mayconsider using the provided patch that implements a custom mallocimplementation* issue 11192: test_socket fails* issue 11190: test_locale fails* issue 11193: test_subprocess fails* issue 9920: minor arithmetic issues in cmath* issue 11215: test_fileio fails======================================================================Implementation details for developers----------------------------------------------------------------------Python and python modules can now be built as shared libraries on AIXas usual.AIX shared libraries require that an "export" and "import" file beprovided at compile time to list all extern symbols which may beshared between modules. The "export" file (named python.exp) for themodules and the libraries that belong to the Python core is created bythe "makexp_aix" script before performing the link of the pythonbinary. It lists all global symbols (exported during the link) of themodules and the libraries that make up the python executable.When shared library modules (.so files) are made, a second shellscript is invoked. This script is named "ld_so_aix" and is alsoprovided with the distribution in the Modules subdirectory. Thisscript acts as an "ld" wrapper which hides the explicit management of"export" and "import" files; it adds the appropriate arguments (in theappropriate order) to the link command that creates the shared module.Among other things, it specifies that the "python.exp" file is an"import" file for the shared module.This mechanism should be transparent.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。