This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
fix emacs/ptags for PL_* changes
[perl5.git] / README.vms
1 Last Revised 21-July-1998 by Dan Sugalski <sugalskd@ous.edu>
2 Originally by Charles Bailey <bailey@newman.upenn.edu>
3
4 * Important safety tip
5
6 The build and install procedures have changed significantly from the 5.004
7 releases! Make sure you read the "Building Perl" and "Installing Perl"
8 sections before you build or install.
9
10 Also note that, as of 5.005, an ANSI C compliant compiler is required to
11 build Perl. Vax C is *not* ANSI compliant, as it died a natural death some
12 time before the standard was set. Therefore Vax C will not compile perl
13 5.005. Sorry about that.
14
15 If you're stuck without Dec C (the Vax C license should be good for Dec C,
16 but the media charges might prohibit an upgrade), consider getting Gnu C
17 instead.
18
19 * Intro
20
21 The VMS port of Perl is as functionally complete as any other Perl port
22 (and as complete as the ports on some Unix systems). The Perl binaries
23 provide all the Perl system calls that are either available under VMS or
24 reasonably emulated. There are some incompatibilites in process handling
25 (e.g the fork/exec model for creating subprocesses doesn't do what you
26 might expect under Unix), mainly because VMS and Unix handle processes and
27 sub-processes very differently.
28
29 There are still some unimplemented system functions, and of coursse we
30 could use modules implementing useful VMS system services, so if you'd like
31 to lend a hand we'd love to have you. Join the Perl Porting Team Now!
32
33 The current sources and build procedures have been tested on a VAX using
34 VaxC and Dec C, and on an AXP using Dec C. If you run into problems with
35 other compilers, please let us know.
36
37 There are issues with varions versions of Dec C, so if you're not running a
38 relatively modern version, check the Dec C issues section later on in this
39 document.
40
41 * Other required software
42
43 In addition to VMS, you'll need:
44         1) A C compiler. Dec C for AXP, or Dec C, or gcc for the VAX.
45         2) A make tool. Dec's MMS (v2.6 or later), or MadGoat's free MMS
46            analog MMK (available from ftp.madgoat.com/madgoat) both work
47            just fine. Gnu Make might work, but it's been so long since
48            anyone's tested it that we're not sure. MMK's free, though, so
49            go ahead and use that.
50
51
52 If you want to include socket support, you'll need a TCP stack and either
53 Dec C, or socket libraries. See the Socket Support topic for more details.
54
55 * Building Perl
56
57 Building perl has two steps, configuration and compilation.
58
59 To configure perl (a necessary first step), issue the command
60
61 @CONFIGURE
62
63 from the top of an unpacked perl directory. You'll be asked a series of
64 questions, and the answers to them (along with the capabilities of your C
65 compiler and network stack) will determine how perl's built.
66
67 If you've got multiple C compilers installed, you'll have your choice of
68 which one to use. Various older versions of Dec C had some gotchas, so if
69 you're using a version older than 5.2, check the Dec C Issues section.
70
71 The configuration script will print out, at the very end, the MMS or MMK
72 command you need to compile perl. Issue it (exactly as printed) to start
73 the build.
74
75 Once you issue your MMS command, sit back and wait. Perl should build and
76 link without a problem. If it doesn't, check the Gotchas to watch out for
77 section. If that doesn't help, send some mail to the VMSPERL mailing list.
78 Instructions are in the Mailing Lists section.
79
80 As a handy shortcut, the command:
81
82 @CONFIGURE "-des"
83
84 (note the quotes and case) will choose reasonable defaults. (It takes Dec C
85 over Gnu C, Dec C sockets over SOCKETSHR sockets, and either over no sockets)
86
87 * Testing Perl
88
89 Once Perl has built cleanly, you need to test it to make sure things work.
90 This step is very important--there are always things that can go wrong
91 somehow and get you a dysfunctional Perl.
92
93 Testing is very easy, though, as there's a full test suite in the perl
94 distribution. To run the tests, enter the *exact* MMS line you used to
95 compile Perl and add the word "test" to the end, like this:
96
97 Compile Command:
98
99 $MMS/Macro=("__AXP__=1","decc=1","DECCRTL_SOCKETS=1")
100
101 Test Command:
102
103 $MMS/Macro=("__AXP__=1","decc=1","DECCRTL_SOCKETS=1") test
104
105 MMS will run all the tests. This may take some time, as there are a lot of
106 tests. If any tests fail, there will be a note made on-screen. At the end
107 of all the tests, a summary of the tests, the number passed and failed, and
108 the time taken will be displayed.
109
110 If any tests fail, it means something's wrong with Perl. If the test suite
111 hangs (some tests can take upwards of two or three minutes, or more if
112 you're on an especially slow machine, depending on you machine speed, so
113 don't be hasty), then the test *after* the last one displayed failed. Don't
114 install Perl unless you're confident that you're OK. Regardless of how
115 confident you are, make a bug report to the VMSPerl mailing list.
116
117 If one or more tests fail, you can get more info on the failure by issuing
118 this command sequence:
119
120 $ @[.VMS]TEST .typ "-v" [.subdir]test.T
121
122 where ".typ" is the file type of the Perl images you just built (if you
123 didn't do anything special, use .EXE), and "[.subdir]test.T" is the test
124 that failed. For example, with a normal Perl build, if the test indicated
125 that [.op]time failed, then you'd do this:
126
127 $ @[.VMS]TEST .EXE "-v" [.OP]TIME.T
128
129 When you send in a bug report for failed tests, please include the output
130 from this command, which is run from the main source directory:
131
132 MCR []MINIPERL "-V"
133
134 Note that "-V" really is a capital V in double quotes. This will dump out a
135 couple of screens worth of config info, and can help us diagnose the problem.
136
137 * Cleaning up and starting fresh
138
139 If you need to recompile from scratch, you have to make sure you clean up
140 first. There's a procedure to do it--enter the *exact* MMS line you used to
141 compile and add "realclean" at the end, like this:
142
143 Compile Command:
144
145 $MMS/Macro=("__AXP__=1","decc=1","DECCRTL_SOCKETS=1")
146
147 Cleanup Command:
148
149 $MMS/Macro=("__AXP__=1","decc=1","DECCRTL_SOCKETS=1") realclean
150
151 If you don't do this, things may behave erratically. They might not, too,
152 so it's best to be sure and do it.
153
154 * Installing Perl
155
156 There are several steps you need to take to get Perl installed and
157 running.
158
159 1) Create a directory somewhere and define the concealed logical PERL_ROOT
160 to point to it. For example, DEFINE/TRANS=(CONC,TERM) PERL_ROOT dka200:[perl.]
161
162 2) Run the install script via:
163
164 MMS install
165
166 or
167
168 MMK install
169
170 If for some reason it complains about target INSTALL being up to date,
171 throw a /FORCE switch on the MMS or MMK command.
172
173 3) Either define the symbol PERL somewhere, such as
174 SYS$MANAGER:SYLOGIN.COM, to be "PERL :== $PERL_ROOT:[000000]PERL.EXE", or
175 install Perl into DCLTABLES.EXE (Check out the section "Installing Perl
176 into DCLTABLES" for more info), or put the image in a directory that's in
177 your DCL$PATH (if you're using VMS 6.2 or higher).
178
179 4) Optionally define the command PERLDOC as 
180 PERLDOC :== $PERL_ROOT:[000000]PERL PERL_ROOT:[LIB.POD]PERLDOC.COM -T
181 Note that if you wish to use most as a pager please see
182 ftp://space.mit.edu/pub/davis/ for both most and slang.
183
184 5) Optionally define the command PERLBUG (the Perl bug report generator) as
185 PERLBUG :== $PERL_ROOT:[000000]PERL PERL_ROOT:[LIB]PERLBUG.COM"
186
187 6) Optionally define the command POD2MAN (Converts POD files to nroff
188 source suitable for converting to man pages. Also quiets complaints during
189 module builds) as
190
191 DEFINE/NOLOG POD2MAN PERL_ROOT:[LIB.POD]POD2MAN.COM
192 POD2MAN :== $PERL_ROOT:[000000]PERL POD2MAN
193
194 * Installing Perl into DCLTABLES
195
196 Execute the following command file to define PERL as a DCL command.
197 You'll need CMKRNL priv to install the new dcltables.exe.
198
199 $ create perl.cld
200 !
201 ! modify to reflect location of your perl.exe
202 !
203 define verb perl
204   image perl_root:[000000]perl.exe
205   cliflags (foreign)
206 $!
207 $ set command perl /table=sys$common:[syslib]dcltables.exe -
208  /output=sys$common:[syslib]dcltables.exe
209 $ install replace sys$common:[syslib]dcltables.exe
210 $ exit
211
212 * Changing compile-time things
213
214 Most of the user-definable features of Perl are enabled or disabled in
215 [.VMS]CONFIG.VMS. There's code in there to Do The Right Thing, but that may
216 end up being the wrong thing for you. Make sure you understand what you're
217 doing, since changes here can get you a busted perl.
218
219 Odds are that there's nothing here to change, unless you're on a version of
220 VMS later than 6.2 and Dec C later than 5.6. Even if you are, the correct
221 values will still be chosen, most likely. Poking around here should be
222 unnecessary.
223
224 The one exception is the various *DIR install locations. Changing those
225 requires changes in genconfig.pl as well. Be really careful if you need to
226 change these,a s they can cause some fairly subtle problems.
227
228 * Extra things in the Perl distribution
229
230 In addition to the standard stuff that gets installed, there are two
231 optional extensions, DCLSYM and STDIO, that are handy. Instructions for
232 these two modules are in [.VMS.EXT.DCLSYM] and [.VMS.EXT.STDIO],
233 respectively.
234
235 * Socket Support
236
237 Perl includes a number of functions for IP sockets, which are available if
238 you choose to compile Perl with socket support. (See the section Compiling
239 Perl for more info on selecting a socket stack) Since IP networking is an
240 optional addition to VMS, there are several different IP stacks
241 available. How well integrated they are into the system depends on the
242 stack, your version of VMS, and the version of your C compiler.
243
244 The most portable solution uses the SOCKETSHR library. In combination with
245 either UCX or NetLib, this supports all the major TCP stacks (Multinet,
246 Pathways, TCPWare, UCX, and CMU) on all versions of VMS Perl runs on, with
247 all the compilers on both VAX and Alpha. The socket interface is also
248 consistent across versions of VMS and C compilers. It has a problem with
249 UDP sockets when used with Multinet, though, so you should be aware of
250 that.
251
252 The other solution available is to use the socket routines built into Dec
253 C. Which routines are available depend on the version of VMS you're
254 running, and require proper UCX emulation by your TCP/IP vendor.
255 Relatively current versions of Multinet, TCPWare, Pathway, and UCX all
256 provide the required libraries--check your manuals or release notes to see
257 if your version is new enough.
258
259 * Reporting Bugs
260
261 If you come across what you think might be a bug in Perl, please report
262 it. There's a script in PERL_ROOT:[UTILS], perlbug, that walks you through
263 the process of creating a bug report. This script includes details of your
264 installation, and is very handy. Completed bug reports should go to
265 PERLBUG@PERL.COM.
266
267 * Gotchas to watch out for
268
269 Probably the single biggest gotcha in compiling Perl is giving the wrong
270 switches to MMS/MMK when you build. Use *exactly* what the configure script
271 prints!
272
273 The next big gotcha is directory depth. Perl can create directories four
274 and five levels deep during the build, so you don't have to be too deep to
275 start to hit the RMS 8 level point. It's best to do a
276 $DEFINE/TRANS=(CONC,TERM) PERLSRC disk:[dir.dir.dir.perldir.]"  (note the
277 trailing period) and $SET DEFAULT PERLSRC:[000000] before building. Perl
278 modules can be just as bad (or worse), so watch out for them, too. The
279 configuration script will warn if it thinks you're too deep.
280
281 Finally, the third thing that bites people is leftover pieces from a failed
282 build. If things go wrong, make sure you do a "(MMK|MMS|make) realclean"
283 before you rebuild.
284
285 * Dec C issues
286
287 Note to DECC users: Some early versions (pre-5.2, some pre-4. If you're Dec
288 C 5.x or higher, with current patches if anym you're fine) of the DECCRTL
289 contained a few bugs which affect Perl performance:
290     - Newlines are lost on I/O through pipes, causing lines to run together.
291       This shows up as RMS RTB errors when reading from a pipe.  You can
292       work around this by having one process write data to a file, and
293       then having the other read the file, instead of the pipe.  This is
294       fixed in version 4 of DECC.
295     - The modf() routine returns a non-integral value for some values above
296       INT_MAX; the Perl "int" operator will return a non-integral value in
297       these cases.  This is fixed in version 4 of DECC.
298     - On the AXP, if SYSNAM privilege is enabled, the CRTL chdir() routine
299       changes the process default device and directory permanently, even
300       though the call specified that the change should not persist after
301       Perl exited.  This is fixed by DEC CSC patch AXPACRT04_061.
302
303 * Mailing Lists
304
305 There are several mailing lists available to the Perl porter. For VMS
306 specific issues (including both Perl questions and installation problems)
307 there is the VMSPERL mailing list. It's usually a low-volume (10-12
308 messages a week) mailing list.
309
310 The subscription address is VMSPERL-REQUEST@NEWMAN.UPENN.EDU. Send a mail
311 message with just the words SUBSCRIBE VMSPERL in the body of the message.
312
313 The VMSPERL mailing list address is VMSPERL@NEWMAN.UPENN.EDU. Any mail
314 sent there gets echoed to all subscribers of the list.
315
316 The Perl5-Porters list is for anyone involved in porting Perl to a
317 platform. This includes you, if you want to participate. It's a high-volume
318 list (60-100 messages a day during active development times), so be sure
319 you want to be there. The subscription address is
320 Perl5-Porters-request@perl.org. Send a message with just the word SUBSCRIBE
321 in the body. The posting address is Perl5-Porters@perl.org.
322
323 * Acknowledgements
324
325 A real big thanks needs to go to Charles Bailey
326 <bailey@newman.upenn.edu>, who is ultimately responsible for Perl 5.004
327 running on VMS. Without him, nothing the rest of us have done would be at
328 all important.
329
330 There are, of course, far too many people involved in the porting and testing
331 of Perl to mention everyone who deserves it, so please forgive us if we've
332 missed someone.  That said, special thanks are due to the following:
333   Tim Adye <T.J.Adye@rl.ac.uk>
334      for the VMS emulations of getpw*()
335   David Denholm <denholm@conmat.phys.soton.ac.uk>
336      for extensive testing and provision of pipe and SocketShr code,
337   Mark Pizzolato <mark@infocomm.com>
338      for the getredirection() code
339   Rich Salz <rsalz@bbn.com>
340      for readdir() and related routines
341   Peter Prymmer <pvhp@lns62.lns.cornell.edu)
342      for extensive testing, as well as development work on
343      configuration and documentation for VMS Perl,
344   Dan Sugalski <sugalsd@stargate.lbcc.cc.or.us>
345      for extensive contributions to recent version support,
346      development of VMS-specific extensions, and dissemination
347      of information about VMS Perl,
348   the Stanford Synchrotron Radiation Laboratory and the
349      Laboratory of Nuclear Studies at Cornell University for
350      the the opportunity to test and develop for the AXP,
351 and to the entire VMSperl group for useful advice and suggestions.  In
352 addition the perl5-porters deserve credit for their creativity and
353 willingness to work with the VMS newcomers.  Finally, the greatest debt of
354 gratitude is due to Larry Wall <larry@wall.org>, for having the ideas which
355 have made our sleepless nights possible.
356
357 Thanks,
358 The VMSperl group