.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "PERLOS390 1" .TH PERLOS390 1 "2021-09-24" "perl v5.32.1" "Perl Programmers Reference Guide" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" perlos390 \- building and installing Perl for OS/390 and z/OS .SH "SYNOPSIS" .IX Header "SYNOPSIS" This document will help you Configure, build, test and install Perl on \s-1OS/390\s0 (aka z/OS) Unix System Services. .PP \&\fBThis document needs to be updated, but we don't know what it should say. Please submit comments to .\fR .SH "DESCRIPTION" .IX Header "DESCRIPTION" This is a fully ported Perl for \s-1OS/390\s0 Version 2 Release 3, 5, 6, 7, 8, and 9. It may work on other versions or releases, but those are the ones we have tested it on. .PP You may need to carry out some system configuration tasks before running the Configure script for Perl. .SS "Tools" .IX Subsection "Tools" The z/OS Unix Tools and Toys list may prove helpful and contains links to ports of much of the software helpful for building Perl. .SS "Unpacking Perl distribution on \s-1OS/390\s0" .IX Subsection "Unpacking Perl distribution on OS/390" If using ftp remember to transfer the distribution in binary format. .PP Gunzip/gzip for \s-1OS/390\s0 is discussed at: .PP .Vb 1 \& http://www.ibm.com/servers/eserver/zseries/zos/unix/bpxa1ty1.html .Ve .PP to extract an \s-1ASCII\s0 tar archive on \s-1OS/390,\s0 try this: .PP .Vb 1 \& pax \-o to=IBM\-1047,from=ISO8859\-1 \-r < latest.tar .Ve .PP or .PP .Vb 1 \& zcat latest.tar.Z | pax \-o to=IBM\-1047,from=ISO8859\-1 \-r .Ve .PP If you get lots of errors of the form .PP .Vb 1 \& tar: FSUM7171 ...: cannot set uid/gid: EDC5139I Operation not permitted .Ve .PP you did not read the above and tried to use tar instead of pax, you'll first have to remove the (now corrupt) perl directory .PP .Vb 1 \& rm \-rf perl\-... .Ve .PP and then use pax. .SS "Setup and utilities for Perl on \s-1OS/390\s0" .IX Subsection "Setup and utilities for Perl on OS/390" Be sure that your yacc installation is in place including any necessary parser template files. If you have not already done so then be sure to: .PP .Vb 1 \& cp /samples/yyparse.c /etc .Ve .PP This may also be a good time to ensure that your /etc/protocol file and either your /etc/resolv.conf or /etc/hosts files are in place. The \s-1IBM\s0 document that described such \s-1USS\s0 system setup issues was \&\s-1SC28\-1890\-07 \*(L"OS/390 UNIX\s0 System Services Planning\*(R", in particular Chapter 6 on customizing the \s-1OE\s0 shell. .PP \&\s-1GNU\s0 make for \s-1OS/390,\s0 which is recommended for the build of perl (as well as building \s-1CPAN\s0 modules and extensions), is available from the \&\*(L"Tools\*(R". .PP Some people have reported encountering \*(L"Out of memory!\*(R" errors while trying to build Perl using \s-1GNU\s0 make binaries. If you encounter such trouble then try to download the source code kit and build \s-1GNU\s0 make from source to eliminate any such trouble. You might also find \s-1GNU\s0 make (as well as Perl and Apache) in the red\-piece/book \*(L"Open Source Software for \s-1OS/390 UNIX\*(R", SG24\-5944\-00\s0 from \s-1IBM.\s0 .PP If instead of the recommended \s-1GNU\s0 make you would like to use the system supplied make program then be sure to install the default rules file properly via the shell command: .PP .Vb 1 \& cp /samples/startup.mk /etc .Ve .PP and be sure to also set the environment variable _C89_CCMODE=1 (exporting _C89_CCMODE=1 is also a good idea for users of \s-1GNU\s0 make). .PP You might also want to have \s-1GNU\s0 groff for \s-1OS/390\s0 installed before running the \*(L"make install\*(R" step for Perl. .PP There is a syntax error in the /usr/include/sys/socket.h header file that \s-1IBM\s0 supplies with \s-1USS V2R7, V2R8,\s0 and possibly V2R9. The problem with the header file is that near the definition of the \s-1SO_REUSEPORT\s0 constant there is a spurious extra '/' character outside of a comment like so: .PP .Vb 2 \& #define SO_REUSEPORT 0x0200 /* allow local address & port \& reuse */ / .Ve .PP You could edit that header yourself to remove that last '/', or you might note that Language Environment (\s-1LE\s0) \s-1APAR PQ39997\s0 describes the problem and \s-1PTF\s0's \s-1UQ46272\s0 and \s-1UQ46271\s0 are the (R8 at least) fixes and apply them. If left unattended that syntax error will turn up as an inability for Perl to build its \*(L"Socket\*(R" extension. .PP For successful testing you may need to turn on the sticky bit for your world readable /tmp directory if you have not already done so (see man chmod). .SS "Configure Perl on \s-1OS/390\s0" .IX Subsection "Configure Perl on OS/390" Once you have unpacked the distribution, run \*(L"sh Configure\*(R" (see \s-1INSTALL\s0 for a full discussion of the Configure options). There is a \*(L"hints\*(R" file for os390 that specifies the correct values for most things. Some things to watch out for include: .PP \fIShell\fR .IX Subsection "Shell" .PP A message of the form: .PP .Vb 2 \& (I see you are using the Korn shell. Some ksh\*(Aqs blow up on Configure, \& mainly on older exotic systems. If yours does, try the Bourne shell instead.) .Ve .PP is nothing to worry about at all. .PP \fISamples\fR .IX Subsection "Samples" .PP Some of the parser default template files in /samples are needed in /etc. In particular be sure that you at least copy /samples/yyparse.c to /etc before running Perl's Configure. This step ensures successful extraction of \s-1EBCDIC\s0 versions of parser files such as perly.c and perly.h. This has to be done before running Configure the first time. If you failed to do so then the easiest way to re-Configure Perl is to delete your misconfigured build root and re-extract the source from the tar ball. Then you must ensure that /etc/yyparse.c is properly in place before attempting to re-run Configure. .PP \fIDynamic loading\fR .IX Subsection "Dynamic loading" .PP Dynamic loading is required if you want to use \s-1XS\s0 modules from \s-1CPAN\s0 (like \&\s-1DBI\s0 (and \s-1DBD\s0's), \s-1JSON::XS,\s0 and Text::CSV_XS) or update \s-1CORE\s0 modules from \&\s-1CPAN\s0 with newer versions (like Encode) without rebuilding all of the perl binary. .PP This port will support dynamic loading, but it is not selected by default. If you would like to experiment with dynamic loading then be sure to specify \-Dusedl in the arguments to the Configure script. See the comments in hints/os390.sh for more information on dynamic loading. If you build with dynamic loading then you will need to add the \&\f(CW$archlibexp\fR/CORE directory to your \s-1LIBPATH\s0 environment variable in order for perl to work. See the config.sh file for the value of \f(CW$archlibexp\fR. If in trying to use Perl you see an error message similar to: .PP .Vb 3 \& CEE3501S The module libperl.dll was not found. \& From entry point _\|_dllstaticinit at compile unit offset +00000194 \& at .Ve .PP then your \s-1LIBPATH\s0 does not have the location of libperl.x and either libperl.dll or libperl.so in it. Add that directory to your \s-1LIBPATH\s0 and proceed. .PP In hints/os390.sh, selecting \-Dusedl will default to *also* select \&\-Duseshrplib. Having a shared plib not only requires \s-1LIBPATH\s0 to be set to the correct location of libperl.so but also makes it close to impossible to run more than one different perl that was built this way at the same time. .PP All objects that are involved in \-Dusedl builds should be compiled for this, probably by adding to all ccflags .PP .Vb 1 \& \-qexportall \-qxplink \-qdll \-Wc,XPLINK,dll,EXPORTALL \-Wl,XPLINK,dll .Ve .PP \fIOptimizing\fR .IX Subsection "Optimizing" .PP Do not turn on the compiler optimization flag \*(L"\-O\*(R". There is a bug in either the optimizer or perl that causes perl to not work correctly when the optimizer is on. .PP \fIConfig files\fR .IX Subsection "Config files" .PP Some of the configuration files in /etc used by the networking APIs are either missing or have the wrong names. In particular, make sure that there's either an /etc/resolv.conf or an /etc/hosts, so that \&\fBgethostbyname()\fR works, and make sure that the file /etc/proto has been renamed to /etc/protocol (\s-1NOT\s0 /etc/protocols, as used by other Unix systems). You may have to look for things like \s-1HOSTNAME\s0 and \s-1DOMAINORIGIN\s0 in the \*(L"//'\s-1SYS1.TCPPARMS\s0(\s-1TCPDATA\s0)'\*(R" \s-1PDS\s0 member in order to properly set up your /etc networking files. .SS "Build, Test, Install Perl on \s-1OS/390\s0" .IX Subsection "Build, Test, Install Perl on OS/390" Simply put: .PP .Vb 3 \& sh Configure \& make \& make test .Ve .PP if everything looks ok (see the next section for test/IVP diagnosis) then: .PP .Vb 1 \& make install .Ve .PP this last step may or may not require UID=0 privileges depending on how you answered the questions that Configure asked and whether or not you have write access to the directories you specified. .SS "Build Anomalies with Perl on \s-1OS/390\s0" .IX Subsection "Build Anomalies with Perl on OS/390" \&\*(L"Out of memory!\*(R" messages during the build of Perl are most often fixed by re building the \s-1GNU\s0 make utility for \s-1OS/390\s0 from a source code kit. .PP Building debugging-enabled binaries (with \-g or \-g3) will increase the chance of getting these errors. Prevent \-g if possible. .PP Another memory limiting item to check is your \s-1MAXASSIZE\s0 parameter in your \&'\s-1SYS1.PARMLIB\s0(BPXPRMxx)' data set (note too that as of V2R8 address space limits can be set on a per user \s-1ID\s0 basis in the \s-1USS\s0 segment of a \s-1RACF\s0 profile). People have reported successful builds of Perl with \s-1MAXASSIZE\s0 parameters as small as 503316480 (and it may be possible to build Perl with a \s-1MAXASSIZE\s0 smaller than that). .PP Within \s-1USS\s0 your /etc/profile or \f(CW$HOME\fR/.profile may limit your ulimit settings. Check that the following command returns reasonable values: .PP .Vb 1 \& ulimit \-a .Ve .PP To conserve memory you should have your compiler modules loaded into the Link Pack Area (\s-1LPA/ELPA\s0) rather than in a link list or step lib. .PP If the c89 compiler complains of syntax errors during the build of the Socket extension then be sure to fix the syntax error in the system header /usr/include/sys/socket.h. .SS "Testing Anomalies with Perl on \s-1OS/390\s0" .IX Subsection "Testing Anomalies with Perl on OS/390" The \*(L"make test\*(R" step runs a Perl Verification Procedure, usually before installation. You might encounter \s-1STDERR\s0 messages even during a successful run of \*(L"make test\*(R". Here is a guide to some of the more commonly seen anomalies: .PP \fISignals\fR .IX Subsection "Signals" .PP A message of the form: .PP .Vb 4 \& io/openpid...........CEE5210S The signal SIGHUP was received. \& CEE5210S The signal SIGHUP was received. \& CEE5210S The signal SIGHUP was received. \& ok .Ve .PP indicates that the t/io/openpid.t test of Perl has passed but done so with extraneous messages on stderr from \s-1CEE.\s0 .PP \fIFile::Temp\fR .IX Subsection "File::Temp" .PP A message of the form: .PP .Vb 6 \& lib/ftmp\-security....File::Temp::_gettemp: Parent directory (/tmp/) \& is not safe (sticky bit not set when world writable?) at \& lib/ftmp\-security.t line 100 \& File::Temp::_gettemp: Parent directory (/tmp/) is not safe (sticky \& bit not set when world writable?) at lib/ftmp\-security.t line 100 \& ok .Ve .PP indicates a problem with the permissions on your /tmp directory within the \s-1HFS.\s0 To correct that problem issue the command: .PP .Vb 1 \& chmod a+t /tmp .Ve .PP from an account with write access to the directory entry for /tmp. .PP \fIOut of Memory!\fR .IX Subsection "Out of Memory!" .PP Recent perl test suite is quite memory hungry. In addition to the comments above on memory limitations it is also worth checking for _CEE_RUNOPTS in your environment. Perl now has (in miniperlmain.c) a C #pragma to set \s-1CEE\s0 run options, but the environment variable wins. .PP The C code asks for: .PP .Vb 1 \& #pragma runopts(HEAP(2M,500K,ANYWHERE,KEEP,8K,4K) STACK(,,ANY,) ALL31(ON)) .Ve .PP The important parts of that are the second argument (the increment) to \s-1HEAP,\s0 and allowing the stack to be \*(L"Above the (16M) line\*(R". If the heap increment is too small then when perl (for example loading unicode/Name.pl) tries to create a \*(L"big\*(R" (400K+) string it cannot fit in a single segment and you get \*(L"Out of Memory!\*(R" \- even if there is still plenty of memory available. .PP A related issue is use with perl's malloc. Perl's malloc uses \f(CW\*(C`sbrk()\*(C'\fR to get memory, and \f(CW\*(C`sbrk()\*(C'\fR is limited to the first allocation so in this case something like: .PP .Vb 1 \& HEAP(8M,500K,ANYWHERE,KEEP,8K,4K) .Ve .PP is needed to get through the test suite. .SS "Installation Anomalies with Perl on \s-1OS/390\s0" .IX Subsection "Installation Anomalies with Perl on OS/390" The installman script will try to run on \s-1OS/390.\s0 There will be fewer errors if you have a roff utility installed. You can obtain \s-1GNU\s0 groff from the Redbook \s-1SG24\-5944\-00\s0 ftp site. .SS "Usage Hints for Perl on \s-1OS/390\s0" .IX Subsection "Usage Hints for Perl on OS/390" When using perl on \s-1OS/390\s0 please keep in mind that the \s-1EBCDIC\s0 and \s-1ASCII\s0 character sets are different. See perlebcdic.pod for more on such character set issues. Perl builtin functions that may behave differently under \&\s-1EBCDIC\s0 are also mentioned in the perlport.pod document. .PP Open Edition (\s-1UNIX\s0 System Services) from V2R8 onward does support #!/path/to/perl script invocation. There is a \s-1PTF\s0 available from \&\s-1IBM\s0 for V2R7 that will allow shell/kernel support for #!. \s-1USS\s0 releases prior to V2R7 did not support the #! means of script invocation. If you are running V2R6 or earlier then see: .PP .Vb 1 \& head \`whence perldoc\` .Ve .PP for an example of how to use the \*(L"eval exec\*(R" trick to ask the shell to have Perl run your scripts on those older releases of Unix System Services. .PP If you are having trouble with square brackets then consider switching your rlogin or telnet client. Try to avoid older 3270 emulators and \s-1ISHELL\s0 for working with Perl on \s-1USS.\s0 .SS "Floating Point Anomalies with Perl on \s-1OS/390\s0" .IX Subsection "Floating Point Anomalies with Perl on OS/390" There appears to be a bug in the floating point implementation on S/390 systems such that calling \fBint()\fR on the product of a number and a small magnitude number is not the same as calling \fBint()\fR on the quotient of that number and a large magnitude number. For example, in the following Perl code: .PP .Vb 4 \& my $x = 100000.0; \& my $y = int($x * 1e\-5) * 1e5; # \*(Aq0\*(Aq \& my $z = int($x / 1e+5) * 1e5; # \*(Aq100000\*(Aq \& print "\e$y is $y and \e$z is $z\en"; # $y is 0 and $z is 100000 .Ve .PP Although one would expect the quantities \f(CW$y\fR and \f(CW$z\fR to be the same and equal to 100000 they will differ and instead will be 0 and 100000 respectively. .PP The problem can be further examined in a roughly equivalent C program: .PP .Vb 10 \& #include \& #include \& main() \& { \& double r1,r2; \& double x = 100000.0; \& double y = 0.0; \& double z = 0.0; \& x = 100000.0 * 1e\-5; \& r1 = modf (x,&y); \& x = 100000.0 / 1e+5; \& r2 = modf (x,&z); \& printf("y is %e and z is %e\en",y*1e5,z*1e5); \& /* y is 0.000000e+00 and z is 1.000000e+05 (with c89) */ \& } .Ve .SS "Modules and Extensions for Perl on \s-1OS/390\s0" .IX Subsection "Modules and Extensions for Perl on OS/390" Pure Perl (that is non \s-1XS\s0) modules may be installed via the usual: .PP .Vb 4 \& perl Makefile.PL \& make \& make test \& make install .Ve .PP If you built perl with dynamic loading capability then that would also be the way to build \s-1XS\s0 based extensions. However, if you built perl with the default static linking you can still build \s-1XS\s0 based extensions for \s-1OS/390\s0 but you will need to follow the instructions in ExtUtils::MakeMaker for building statically linked perl binaries. In the simplest configurations building a static perl + \s-1XS\s0 extension boils down to: .PP .Vb 6 \& perl Makefile.PL \& make \& make perl \& make test \& make install \& make \-f Makefile.aperl inst_perl MAP_TARGET=perl .Ve .PP In most cases people have reported better results with \s-1GNU\s0 make rather than the system's /bin/make program, whether for plain modules or for \&\s-1XS\s0 based extensions. .PP If the make process encounters trouble with either compilation or linking then try setting the _C89_CCMODE to 1. Assuming sh is your login shell then run: .PP .Vb 1 \& export _C89_CCMODE=1 .Ve .PP If tcsh is your login shell then use the setenv command. .SH "AUTHORS" .IX Header "AUTHORS" David Fiander and Peter Prymmer with thanks to Dennis Longnecker and William Raffloer for valuable reports, \s-1LPAR\s0 and \s-1PTF\s0 feedback. Thanks to Mike MacIsaac and Egon Terwedow for \s-1SG24\-5944\-00.\s0 Thanks to Ignasi Roca for pointing out the floating point problems. Thanks to John Goodyear for dynamic loading help. .SH "SEE ALSO" .IX Header "SEE ALSO" \&\s-1INSTALL\s0, perlport, perlebcdic, ExtUtils::MakeMaker. .PP .Vb 1 \& http://www.ibm.com/servers/eserver/zseries/zos/unix/bpxa1toy.html \& \& http://www.redbooks.ibm.com/redbooks/SG245944.html \& \& http://www.ibm.com/servers/eserver/zseries/zos/unix/bpxa1ty1.html#opensrc \& \& http://www.xray.mpe.mpg.de/mailing\-lists/perl\-mvs/ \& \& http://publibz.boulder.ibm.com:80/cgi\-bin/bookmgr_OS390/BOOKS/ceea3030/ \& \& http://publibz.boulder.ibm.com:80/cgi\-bin/bookmgr_OS390/BOOKS/CBCUG030/ .Ve .SS "Mailing list for Perl on \s-1OS/390\s0" .IX Subsection "Mailing list for Perl on OS/390" If you are interested in the z/OS (formerly known as \s-1OS/390\s0) and POSIX-BC (\s-1BS2000\s0) ports of Perl then see the perl-mvs mailing list. To subscribe, send an empty message to perl\-mvs\-subscribe@perl.org. .PP See also: .PP .Vb 1 \& https://lists.perl.org/list/perl\-mvs.html .Ve .PP There are web archives of the mailing list at: .PP .Vb 1 \& https://www.nntp.perl.org/group/perl.mvs/ .Ve .SH "HISTORY" .IX Header "HISTORY" This document was originally written by David Fiander for the 5.005 release of Perl. .PP This document was podified for the 5.005_03 release of Perl 11 March 1999. .PP Updated 12 November 2000 for the 5.7.1 release of Perl. .PP Updated 15 January 2001 for the 5.7.1 release of Perl. .PP Updated 24 January 2001 to mention dynamic loading. .PP Updated 12 March 2001 to mention //'\s-1SYS1.TCPPARMS\s0(\s-1TCPDATA\s0)'. .PP Updated 28 November 2001 for broken URLs. .PP Updated 03 October 2019 for perl\-5.32.0+