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