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