Commit | Line | Data |
---|---|---|
20d11268 MB |
1 | If you read this file _as_is_, just ignore the funny characters you see. |
2 | It is written in the POD format (see pod/perlpod.pod) which is specially | |
3 | designed to be readable as is. | |
4 | ||
5 | =head1 NAME | |
6 | ||
7 | README.aix - Perl version 5 on IBM Unix (AIX) systems | |
8 | ||
9 | =head1 DESCRIPTION | |
10 | ||
a318903f MB |
11 | This document describes various features of IBM's Unix operating |
12 | system (AIX) that will affect how Perl version 5 (hereafter just Perl) | |
13 | is compiled and/or runs. | |
20d11268 MB |
14 | |
15 | =head2 Compiling Perl 5 on AIX | |
16 | ||
d5d9880c | 17 | When compiling Perl, you must use an ANSI C compiler. AIX does not ship |
20d11268 MB |
18 | an ANSI compliant C-compiler with AIX by default, but binary builds of |
19 | gcc for AIX are widely available. | |
20 | ||
21 | At the moment of writing, AIX supports two different native C compilers, | |
4951a6f9 | 22 | for which you have to pay: B<xlC> and B<vac>. If you decide to use either |
20d11268 MB |
23 | of these two (which is quite a lot easier than using gcc), be sure to |
24 | upgrade to the latest available patch level. Currently: | |
25 | ||
64cb7701 MB |
26 | xlC.C 3.1.4.10 or 3.6.6.0 or 5.0.2.6 |
27 | vac.C 4.4.0.3 or 5.0.2.4 | |
20d11268 | 28 | |
a318903f MB |
29 | Perl can be compiled with either IBM's ANSI C compiler or with gcc. |
30 | The former is recommended, as not only can it compile Perl with no | |
20d11268 MB |
31 | difficulty, but also can take advantage of features listed later that |
32 | require the use of IBM compiler-specific command-line flags. | |
33 | ||
12f54d27 JH |
34 | The IBM's compiler patch levels 5.0.0.0 and 5.0.1.0 have compiler |
35 | optimization bugs that affect compiling perl.c and regcomp.c, | |
36 | respectively. If Perl's configuration detects those compiler patch | |
37 | levels, optimization is turned off for the said source code files. | |
38 | Upgrading to at least 5.0.2.0 is recommended. | |
39 | ||
20d11268 MB |
40 | If you decide to use gcc, make sure your installation is recent and |
41 | complete, and be sure to read the Perl README file for more gcc-specific | |
60ecc970 MB |
42 | details. Please report any hoops you had to jump through to the development |
43 | team. | |
20d11268 MB |
44 | |
45 | =head2 OS level | |
46 | ||
47 | Before installing the patches to the IBM C-compiler you need to know the | |
48 | level of patching for the Operating System. IBM's command 'oslevel' will | |
64cb7701 MB |
49 | show the base, but is not always complete (in this example oslevel shows |
50 | 4.3.NULL, whereas the system might run most of 4.3.THREE): | |
1a3e4d88 | 51 | |
20d11268 MB |
52 | # oslevel |
53 | 4.3.0.0 | |
54 | # lslpp -l | grep 'bos.rte ' | |
e41d30bc MB |
55 | bos.rte 4.3.3.75 COMMITTED Base Operating System Runtime |
56 | bos.rte 4.3.2.0 COMMITTED Base Operating System Runtime | |
57 | # | |
58 | ||
64cb7701 MB |
59 | The same might happen to AIX 5.1 or other OS levels. As a side note, perl |
60 | cannot be built without bos.adt.syscalls and bos.adt.libm installed | |
1a3e4d88 JP |
61 | |
62 | # lslpp -l | egrep "syscalls|libm" | |
63 | bos.adt.libm 5.1.0.25 COMMITTED Base Application Development | |
64 | bos.adt.syscalls 5.1.0.25 COMMITTED System Calls Application | |
64cb7701 | 65 | # |
20d11268 MB |
66 | |
67 | =head2 Building Dynamic Extensions on AIX | |
68 | ||
8218ea5d JH |
69 | AIX supports dynamically loadable objects as well as shared libraries. |
70 | Shared libraries by convention end with the suffix .a, which is a bit | |
71 | misleading, as an archive can contain static as well as dynamic members. | |
72 | For perl dynamically loaded objects we use the .so suffix also used on | |
73 | many other platforms. | |
74 | ||
75 | Note that starting from Perl 5.7.2 (and consequently 5.8.0) and AIX 4.3 | |
76 | or newer Perl uses the AIX native dynamic loading interface in the so | |
77 | called runtime linking mode instead of the emulated interface that was | |
78 | used in Perl releases 5.6.1 and earlier or, for AIX releases 4.2 and | |
79 | earlier. This change does break backward compatibility with compiled | |
80 | modules from earlier perl releases. The change was made to make Perl | |
efc3b6b5 | 81 | more compliant with other applications like Apache/mod_perl which are |
8218ea5d JH |
82 | using the AIX native interface. This change also enables the use of C++ |
83 | code with static constructors and destructors in perl extensions, which | |
84 | was not possible using the emulated interface. | |
12f54d27 | 85 | |
20d11268 MB |
86 | =head2 The IBM ANSI C Compiler |
87 | ||
88 | All defaults for Configure can be used. | |
89 | ||
90 | If you've chosen to use vac 4, be sure to run 4.4.0.3. Older versions | |
4951a6f9 | 91 | will turn up nasty later on. For vac 5 be sure to run at least 5.0.1.0, |
64cb7701 MB |
92 | but vac 5.0.2.3 or up is highly recommended. Note that since IBM has |
93 | removed vac 5.0.2.1 and 5.0.2.2 from the software depot, these versions | |
94 | should be considered obsolete. | |
20d11268 | 95 | |
a318903f MB |
96 | Here's a brief lead of how to upgrade the compiler to the latest |
97 | level. Of course this is subject to changes. You can only upgrade | |
98 | versions from ftp-available updates if the first three digit groups | |
99 | are the same (in where you can skip intermediate unlike the patches | |
100 | in the developer snapshots of perl), or to one version up where the | |
101 | `base' is available. In other words, the AIX compiler patches are | |
102 | cumulative. | |
103 | ||
104 | vac.C.4.4.0.1 => vac.C.4.4.0.3 is OK (vac.C.4.4.0.2 not needed) | |
105 | xlC.C.3.1.3.3 => xlC.C.3.1.4.10 is NOT OK (xlC.C.3.1.4.0 is not available) | |
106 | ||
107 | # ftp ftp.software.ibm.com | |
108 | Connected to service.boulder.ibm.com. | |
109 | : welcome message ... | |
110 | Name (ftp.software.ibm.com:merijn): anonymous | |
111 | 331 Guest login ok, send your complete e-mail address as password. | |
112 | Password: | |
113 | ... accepted login stuff | |
114 | ftp> cd /aix/fixes/v4/ | |
115 | ftp> dir other other.ll | |
116 | output to local-file: other.ll? y | |
117 | 200 PORT command successful. | |
118 | 150 Opening ASCII mode data connection for /bin/ls. | |
119 | 226 Transfer complete. | |
120 | ftp> dir xlc xlc.ll | |
121 | output to local-file: xlc.ll? y | |
122 | 200 PORT command successful. | |
123 | 150 Opening ASCII mode data connection for /bin/ls. | |
124 | 226 Transfer complete. | |
125 | ftp> bye | |
126 | ... goodbye messages | |
127 | # ls -l *.ll | |
128 | -rw-rw-rw- 1 merijn system 1169432 Nov 2 17:29 other.ll | |
129 | -rw-rw-rw- 1 merijn system 29170 Nov 2 17:29 xlc.ll | |
130 | ||
131 | On AIX 4.2 using xlC, we continue: | |
132 | ||
133 | # lslpp -l | fgrep 'xlC.C ' | |
134 | xlC.C 3.1.4.9 COMMITTED C for AIX Compiler | |
135 | xlC.C 3.1.4.0 COMMITTED C for AIX Compiler | |
136 | # grep 'xlC.C.3.1.4.*.bff' xlc.ll | |
137 | -rw-r--r-- 1 45776101 1 6286336 Jul 22 1996 xlC.C.3.1.4.1.bff | |
138 | -rw-rw-r-- 1 45776101 1 6173696 Aug 24 1998 xlC.C.3.1.4.10.bff | |
139 | -rw-r--r-- 1 45776101 1 6319104 Aug 14 1996 xlC.C.3.1.4.2.bff | |
140 | -rw-r--r-- 1 45776101 1 6316032 Oct 21 1996 xlC.C.3.1.4.3.bff | |
141 | -rw-r--r-- 1 45776101 1 6315008 Dec 20 1996 xlC.C.3.1.4.4.bff | |
142 | -rw-rw-r-- 1 45776101 1 6178816 Mar 28 1997 xlC.C.3.1.4.5.bff | |
143 | -rw-rw-r-- 1 45776101 1 6188032 May 22 1997 xlC.C.3.1.4.6.bff | |
144 | -rw-rw-r-- 1 45776101 1 6191104 Sep 5 1997 xlC.C.3.1.4.7.bff | |
145 | -rw-rw-r-- 1 45776101 1 6185984 Jan 13 1998 xlC.C.3.1.4.8.bff | |
146 | -rw-rw-r-- 1 45776101 1 6169600 May 27 1998 xlC.C.3.1.4.9.bff | |
147 | # wget ftp://ftp.software.ibm.com/aix/fixes/v4/xlc/xlC.C.3.1.4.10.bff | |
148 | # | |
149 | ||
150 | On AIX 4.3 using vac, we continue: | |
151 | ||
64cb7701 MB |
152 | # lslpp -l | grep 'vac.C ' |
153 | vac.C 5.0.2.2 COMMITTED C for AIX Compiler | |
154 | vac.C 5.0.2.0 COMMITTED C for AIX Compiler | |
155 | # grep 'vac.C.5.0.2.*.bff' other.ll | |
156 | -rw-rw-r-- 1 45776101 1 13592576 Apr 16 2001 vac.C.5.0.2.0.bff | |
157 | -rw-rw-r-- 1 45776101 1 14133248 Apr 9 2002 vac.C.5.0.2.3.bff | |
158 | -rw-rw-r-- 1 45776101 1 14173184 May 20 2002 vac.C.5.0.2.4.bff | |
159 | # wget ftp://ftp.software.ibm.com/aix/fixes/v4/other/vac.C.5.0.2.4.bff | |
a318903f MB |
160 | # |
161 | ||
64cb7701 MB |
162 | Likewise on all other OS levels. Then execute the following command, and |
163 | fill in its choices | |
a318903f MB |
164 | |
165 | # smit install_update | |
166 | -> Install and Update from LATEST Available Software | |
64cb7701 | 167 | * INPUT device / directory for software [ vac.C.5.0.2.4.bff ] |
a318903f MB |
168 | [ OK ] |
169 | [ OK ] | |
170 | ||
171 | Follow the messages ... and you're done. | |
172 | ||
20d11268 MB |
173 | =head2 Using GNU's gcc for building perl |
174 | ||
4238f5a6 JP |
175 | Using gcc-3.0 (tested with 3.0.4) now works out of the box, as do |
176 | recent gcc-2.9 builds available directly from IBM as part of their Linux | |
177 | compatibility packages, available here: | |
818c4caa | 178 | |
4238f5a6 | 179 | http://www.ibm.com/servers/aix/products/aixos/linux/ |
20d11268 | 180 | |
20d11268 MB |
181 | =head2 Using Large Files with Perl |
182 | ||
60ecc970 | 183 | Should yield no problems. |
20d11268 MB |
184 | |
185 | =head2 Threaded Perl | |
186 | ||
60ecc970 MB |
187 | Threads seem to work OK, though at the moment not all tests pass when |
188 | threads are used in combination with 64bit configurations. | |
20d11268 MB |
189 | |
190 | =head2 64-bit Perl | |
191 | ||
60ecc970 | 192 | If your AIX is installed with 64-bit support, you can expect 64bit |
12f54d27 JH |
193 | configurations to work. In combination with threads some tests might |
194 | still fail. | |
20d11268 | 195 | |
12f54d27 | 196 | =head2 AIX 4.2 and extensions using C++ with statics |
20d11268 | 197 | |
12f54d27 JH |
198 | In AIX 4.2 Perl extensions that use C++ functions that use statics |
199 | may have problems in that the statics are not getting initialized. | |
200 | In newer AIX releases this has been solved by linking Perl with | |
201 | the libC_r library, but unfortunately in AIX 4.2 the said library | |
202 | has an obscure bug where the various functions related to time | |
203 | (such as time() and gettimeofday()) return broken values, and | |
204 | therefore in AIX 4.2 Perl is not linked against the libC_r. | |
20d11268 MB |
205 | |
206 | =head1 AUTHOR | |
207 | ||
208 | H.Merijn Brand <h.m.brand@hccnet.nl> | |
209 | ||
20d11268 MB |
210 | =head1 DATE |
211 | ||
64cb7701 | 212 | Version 0.0.5: 22 May 2002 |
20d11268 MB |
213 | |
214 | =cut |