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