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