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