Mercurial > cpython-lru_cache-weakref
annotate Misc/AIX-NOTES @ 54294:dba767bc3155 legacy-trunk
remove mention of old ctypes version
| author | Benjamin Peterson <benjamin@python.org> |
|---|---|
| date | Sat, 23 May 2009 20:59:09 +0000 |
| parents | 74c0a78114ae |
| children |
| rev | line source |
|---|---|
|
5952
b2e018fb2ba9
New version of Vladimir Marangozov's AIX hacks -- simpler etc.
Guido van Rossum <guido@python.org>
parents:
5592
diff
changeset
|
1 Subject: AIX - Misc/AIX-NOTES |
|
b2e018fb2ba9
New version of Vladimir Marangozov's AIX hacks -- simpler etc.
Guido van Rossum <guido@python.org>
parents:
5592
diff
changeset
|
2 From: Vladimir Marangozov <Vladimir.Marangozov@imag.fr> |
|
b2e018fb2ba9
New version of Vladimir Marangozov's AIX hacks -- simpler etc.
Guido van Rossum <guido@python.org>
parents:
5592
diff
changeset
|
3 To: guido@CNRI.Reston.Va.US (Guido van Rossum) |
|
b2e018fb2ba9
New version of Vladimir Marangozov's AIX hacks -- simpler etc.
Guido van Rossum <guido@python.org>
parents:
5592
diff
changeset
|
4 Date: Wed, 6 Aug 1997 11:41:00 +0200 (EET) |
| 3982 | 5 |
| 6 ============================================================================== | |
| 7 COMPILER INFORMATION | |
| 8 ------------------------------------------------------------------------------ | |
| 9 | |
| 10 (1) A problem has been reported with "make test" failing because of "weird | |
| 11 indentation." Searching the comp.lang.python newsgroup reveals several | |
| 12 threads on this subject, and it seems to be a compiler bug in an old | |
| 13 version of the AIX CC compiler. However, the compiler/OS combination | |
| 14 which has this problem is not identified. In preparation for the 1.4 | |
| 15 release, Vladimir Marangozov (Vladimir.Marangozov@imag.fr) and Manus Hand | |
| 16 (mhand@csn.net) reported no such troubles for the following compilers and | |
| 17 operating system versions: | |
| 18 AIX C compiler version 3.1.2 on AIX 4.1.3 and AIX 4.1.4 | |
| 19 AIX C compiler version 1.3.0 on AIX 3.2.5 | |
| 20 If you have this problem, please report the compiler/OS version. | |
| 21 | |
| 22 (2) Stefan Esser (se@MI.Uni-Koeln.DE), in work done to compile Python | |
| 23 1.0.0 on AIX 3.2.4, reports that AIX compilers don't like the LANG | |
| 24 environment varaiable set to European locales. This makes the compiler | |
|
55049
74c0a78114ae
Merged revisions 69846 via svnmerge from
Jesus Cea <jcea@jcea.es>
parents:
29380
diff
changeset
|
25 generate floating point constants using "," as the decimal separator, |
| 3982 | 26 which the assembler doesn't understand (or perhaps it is the other way |
| 27 around, with the assembler expecting, but not getting "," in float | |
| 28 numbers). "LANG=C; export LANG" solves the problem, as does | |
| 29 "LANG=C $(MAKE) ..." in the master Makefile. | |
| 30 | |
| 31 (3) The cc (or xlc) compiler considers "Python/ceval.c" too complex to | |
| 32 optimize, except when invoked with "-qmaxmem=4000" | |
| 33 | |
| 34 (4) Some problems (due to _AIX not being #defined) when python 1.0.0 was | |
| 35 compiled using 'gcc -ansi' were reported by Stefan Esser, but were not | |
| 36 investigated. | |
| 37 | |
| 38 (5) The cc compiler has internal variables named "__abs" and "__div". These | |
| 39 names are reserved and may not be used as program variables in compiled | |
| 40 source. (As an anecdote in support of this, the implementation of | |
| 41 Python/operator.c had this problem in the 1.4 beta releases, and the | |
| 42 solution was to re#define some core-source variables having these names, | |
| 43 to give these python variables different names if the build is being done | |
| 44 on AIX.) | |
| 45 | |
| 46 (6) As mentioned in the README, builds done immediately after previous builds | |
| 47 (without "make clean" or "make clobber") sometimes fail for mysterious | |
| 48 reasons. There are some unpredictable results when the configuration | |
| 49 is changed (that is, if you "configure" with different parameters) or if | |
| 50 intermediate changes are made to some files. Performing "make clean" or | |
| 51 "make clobber" resolves the problems. | |
| 52 | |
| 53 ============================================================================== | |
| 54 THREAD SUPPORT | |
| 55 ------------------------------------------------------------------------------ | |
| 56 | |
|
5952
b2e018fb2ba9
New version of Vladimir Marangozov's AIX hacks -- simpler etc.
Guido van Rossum <guido@python.org>
parents:
5592
diff
changeset
|
57 As of AIX version 4, there are two (incompatible) types of pthreads on AIX: |
| 3982 | 58 a) AIX DCE pthreads (on AIX 3.2.5) |
| 59 b) AIX 4 pthreads (on AIX 4.1 and up) | |
| 60 Support has been added to Python to handle the distinction. | |
| 61 | |
| 62 The cc and gcc compilers do not initialize pthreads properly. The only | |
| 63 compilers that can initialize pthreads properly are IBM *_r* compilers, | |
| 64 which use the crt0_r.o module, and which invoke ld with the reentrant | |
| 65 version of libc (libc_r). | |
| 66 | |
| 67 In order to enable thread support, follow these steps: | |
| 68 1. Uncomment the thread module in Modules/Setup | |
| 69 2. configure --without-gcc --with-thread ... | |
| 70 3. make CC="cc_r" OPT="-O -qmaxmem=4000" | |
| 71 | |
| 72 For example, to make with both threads and readline, use: | |
| 73 ./configure --without-gcc --with-thread --with-readline=/usr/local/lib | |
| 74 make CC=cc_r OPT="-O2 -qmaxmem=4000" | |
| 75 | |
| 76 If the "make" which is used ignores the "CC=cc_r" directive, one could alias | |
| 77 the cc command to cc_r (for example, in C-shell, perform an "alias cc cc_r"). | |
| 78 | |
| 79 Vladimir Marangozov (Vladimir.Marangozov@imag.fr) provided this information, | |
| 80 and he reports that a cc_r build initializes threads properly and that all | |
| 81 demos on threads run okay with cc_r. | |
| 82 | |
| 83 ============================================================================== | |
| 84 SHARED LIBRARY SUPPORT | |
| 85 ------------------------------------------------------------------------------ | |
| 86 | |
| 87 AIX shared library support was added to Python in the 1.4 release by Manus | |
| 88 Hand (mhand@csn.net) and Vladimir Marangozov (Vladimir.Marangozov@imag.fr). | |
| 89 | |
|
4455
7eeefd3267d4
New version for 1.4 from Manus.
Guido van Rossum <guido@python.org>
parents:
4080
diff
changeset
|
90 Python modules may now be built as shared libraries on AIX using the normal |
|
15342
cb11fa5b11f4
Rename Setup.in to Setup.dist, and assume that configure will create
Fred Drake <fdrake@acm.org>
parents:
5952
diff
changeset
|
91 process of uncommenting the "*shared*" line in Modules/Setup before the |
|
5952
b2e018fb2ba9
New version of Vladimir Marangozov's AIX hacks -- simpler etc.
Guido van Rossum <guido@python.org>
parents:
5592
diff
changeset
|
92 build. |
| 3982 | 93 |
| 94 AIX shared libraries require that an "export" and "import" file be provided | |
| 95 at compile time to list all extern symbols which may be shared between | |
|
5952
b2e018fb2ba9
New version of Vladimir Marangozov's AIX hacks -- simpler etc.
Guido van Rossum <guido@python.org>
parents:
5592
diff
changeset
|
96 modules. The "export" file (named python.exp) for the modules and the |
|
b2e018fb2ba9
New version of Vladimir Marangozov's AIX hacks -- simpler etc.
Guido van Rossum <guido@python.org>
parents:
5592
diff
changeset
|
97 libraries that belong to the Python core is created by the "makexp_aix" |
|
b2e018fb2ba9
New version of Vladimir Marangozov's AIX hacks -- simpler etc.
Guido van Rossum <guido@python.org>
parents:
5592
diff
changeset
|
98 script before performing the link of the python binary. It lists all global |
|
b2e018fb2ba9
New version of Vladimir Marangozov's AIX hacks -- simpler etc.
Guido van Rossum <guido@python.org>
parents:
5592
diff
changeset
|
99 symbols (exported during the link) of the modules and the libraries that |
|
b2e018fb2ba9
New version of Vladimir Marangozov's AIX hacks -- simpler etc.
Guido van Rossum <guido@python.org>
parents:
5592
diff
changeset
|
100 make up the python executable. |
| 3982 | 101 |
| 102 When shared library modules (.so files) are made, a second shell script | |
| 103 is invoked. This script is named "ld_so_aix" and is also provided with | |
| 104 the distribution in the Modules subdirectory. This script acts as an "ld" | |
| 105 wrapper which hides the explicit management of "export" and "import" files; | |
| 106 it adds the appropriate arguments (in the appropriate order) to the link | |
| 107 command that creates the shared module. Among other things, it specifies | |
| 108 that the "python.exp" file is an "import" file for the shared module. | |
| 109 | |
| 110 At the time of this writing, neither the python.exp file nor the makexp_aix | |
| 111 or ld_so_aix scripts are installed by the make procedure, so you should | |
| 112 remember to keep these and/or copy them to a different location for | |
| 113 safekeeping if you wish to use them to add shared extension modules to | |
| 114 python. However, if the make process has been updated since this writing, | |
| 115 these files MAY have been installed for you during the make by the | |
| 116 LIBAINSTALL rule, in which case the need to make safe copies is obviated. | |
| 117 | |
| 118 If you wish to add a shared extension module to the language, you would follow | |
| 119 the steps given in the example below (the example adds the shared extension | |
| 120 module "spam" to python): | |
| 121 1. Make sure that "ld_so_aix" and "makexp_aix" are in your path. | |
| 122 2. The "python.exp" file should be in the current directory. | |
| 123 3. Issue the following commands or include them in your Makefile: | |
| 124 cc -c spammodule.c | |
| 125 ld_so_aix cc spammodule.o -o spammodule.so | |
| 126 | |
| 127 For more detailed information on the shared library support, examine the | |
| 128 contents of the "ld_so_aix" and "makexp_aix" scripts or refer to the AIX | |
| 129 documentation. | |
| 130 | |
|
4455
7eeefd3267d4
New version for 1.4 from Manus.
Guido van Rossum <guido@python.org>
parents:
4080
diff
changeset
|
131 NOTE: If the extension module is written in C++ and contains templates, |
|
7eeefd3267d4
New version for 1.4 from Manus.
Guido van Rossum <guido@python.org>
parents:
4080
diff
changeset
|
132 an alternative to "ld_so_aix" is the /usr/lpp/xlC/bin/makeC++SharedLib |
|
7eeefd3267d4
New version for 1.4 from Manus.
Guido van Rossum <guido@python.org>
parents:
4080
diff
changeset
|
133 script. Chris Myers (myers@TC.Cornell.EDU) reports that ld_so_aix |
|
7eeefd3267d4
New version for 1.4 from Manus.
Guido van Rossum <guido@python.org>
parents:
4080
diff
changeset
|
134 works well for some C++ (including the C++ that is generated |
|
7eeefd3267d4
New version for 1.4 from Manus.
Guido van Rossum <guido@python.org>
parents:
4080
diff
changeset
|
135 automatically by the Python SWIG package [SWIG can be found at |
|
7eeefd3267d4
New version for 1.4 from Manus.
Guido van Rossum <guido@python.org>
parents:
4080
diff
changeset
|
136 http://www.cs.utah.edu/~beazley/SWIG/swig.html]). However, it is not |
|
7eeefd3267d4
New version for 1.4 from Manus.
Guido van Rossum <guido@python.org>
parents:
4080
diff
changeset
|
137 known whether makeC++SharedLib can be used as a complete substitute |
|
7eeefd3267d4
New version for 1.4 from Manus.
Guido van Rossum <guido@python.org>
parents:
4080
diff
changeset
|
138 for ld_so_aix. |
|
7eeefd3267d4
New version for 1.4 from Manus.
Guido van Rossum <guido@python.org>
parents:
4080
diff
changeset
|
139 |
|
27595
915d327a214a
Add some notes that got python to work on the snake farm
Neal Norwitz <nnorwitz@gmail.com>
parents:
15342
diff
changeset
|
140 According to Gary Hook from IBM, the format of the export file changed |
|
915d327a214a
Add some notes that got python to work on the snake farm
Neal Norwitz <nnorwitz@gmail.com>
parents:
15342
diff
changeset
|
141 in AIX 4.2. For AIX 4.2 and later, a period "." is required on the |
|
915d327a214a
Add some notes that got python to work on the snake farm
Neal Norwitz <nnorwitz@gmail.com>
parents:
15342
diff
changeset
|
142 first line after "#!". If python crashes while importing a shared |
|
915d327a214a
Add some notes that got python to work on the snake farm
Neal Norwitz <nnorwitz@gmail.com>
parents:
15342
diff
changeset
|
143 library, you can try modifying the LINKCC variable in the Makefile. |
|
915d327a214a
Add some notes that got python to work on the snake farm
Neal Norwitz <nnorwitz@gmail.com>
parents:
15342
diff
changeset
|
144 It probably looks like this: |
|
915d327a214a
Add some notes that got python to work on the snake farm
Neal Norwitz <nnorwitz@gmail.com>
parents:
15342
diff
changeset
|
145 |
|
915d327a214a
Add some notes that got python to work on the snake farm
Neal Norwitz <nnorwitz@gmail.com>
parents:
15342
diff
changeset
|
146 LINKCC= $(srcdir)/Modules/makexp_aix Modules/python.exp \"\" $(LIBRARY); $(PURIFY) $(CXX) |
|
915d327a214a
Add some notes that got python to work on the snake farm
Neal Norwitz <nnorwitz@gmail.com>
parents:
15342
diff
changeset
|
147 |
|
915d327a214a
Add some notes that got python to work on the snake farm
Neal Norwitz <nnorwitz@gmail.com>
parents:
15342
diff
changeset
|
148 You should modify the \"\" to be a period: |
|
915d327a214a
Add some notes that got python to work on the snake farm
Neal Norwitz <nnorwitz@gmail.com>
parents:
15342
diff
changeset
|
149 |
|
915d327a214a
Add some notes that got python to work on the snake farm
Neal Norwitz <nnorwitz@gmail.com>
parents:
15342
diff
changeset
|
150 LINKCC= $(srcdir)/Modules/makexp_aix Modules/python.exp . $(LIBRARY); $(PURIFY) $(CXX) |
|
915d327a214a
Add some notes that got python to work on the snake farm
Neal Norwitz <nnorwitz@gmail.com>
parents:
15342
diff
changeset
|
151 |
|
915d327a214a
Add some notes that got python to work on the snake farm
Neal Norwitz <nnorwitz@gmail.com>
parents:
15342
diff
changeset
|
152 Using a period fixed the problem in the snake farm. YMMV. |
|
29380
24fff32ed065
The fix to use . was incorporated
Neal Norwitz <nnorwitz@gmail.com>
parents:
27595
diff
changeset
|
153 This fix has been incorporated into Python 2.3. |
|
27595
915d327a214a
Add some notes that got python to work on the snake farm
Neal Norwitz <nnorwitz@gmail.com>
parents:
15342
diff
changeset
|
154 |
| 3982 | 155 ============================================================================== |
