perlos390 (1)
Leading comments
Automatically generated by Pod::Man 4.09 (Pod::Simple 3.35) Standard preamble: ========================================================================
NAME
perlos390 - building and installing Perl for OS/390 and z/OSSYNOPSIS
This document will help you Configure, build, test and install Perl onThis document needs to be updated, but we don't know what it should say. Please email comments to perlbug@perl.org <mailto:perlbug@perl.org>.
DESCRIPTION
This is a fully ported Perl forYou may need to carry out some system configuration tasks before running the Configure script for Perl.
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. www.ibm.com/servers/eserver/zseries/zos/unix/bpxa1toy.htmlUnpacking Perl distribution on OS/390
If using ftp remember to transfer the distribution in binary format.
Gunzip/gzip for
www.ibm.com/servers/eserver/zseries/zos/unix/bpxa1ty1.html
to extract an
pax -o to=IBM-1047,from=ISO8859-1 -r < latest.tar
or
zcat latest.tar.Z | pax -o to=IBM-1047,from=ISO8859-1 -r
If you get lots of errors of the form
tar: FSUM7171 ...: cannot set uid/gid: EDC5139I Operation not permitted.
you didn't read the above and tried to use tar instead of pax, you'll first have to remove the (now corrupt) perl directory
rm -rf perl-...
and then use pax.
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:
cp /samples/yyparse.c /etc
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
Some people have reported encountering ``Out of memory!'' errors while trying to build Perl using
If instead of the recommended
cp /samples/startup.mk /etc
and be sure to also set the environment variable _C89_CCMODE=1 (exporting _C89_CCMODE=1 is also a good idea for users of
You might also want to have
There is a syntax error in the /usr/include/sys/socket.h header file that
#define SO_REUSEPORT 0x0200 /* allow local address & port reuse */ /
You could edit that header yourself to remove that last '/', or you might note that Language Environment (
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).
Configure Perl on OS/390
Once you've unpacked the distribution, run ``sh Configure'' (see - *
-
A message of the form:
(I see you are using the Korn shell. Some ksh's blow up on Configure, mainly on older exotic systems. If yours does, try the Bourne shell instead.)
is nothing to worry about at all.
- *
-
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 EBCDICversions 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.
- *
-
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
$archlibexp/CORE directory to your LIBPATHenvironment variable in order for perl to work. See the config.sh file for the value of $archlibexp. If in trying to use Perl you see an error message similar to:
CEE3501S The module libperl.dll was not found. From entry point __dllstaticinit at compile unit offset +00000194 at
then your
LIBPATHdoes not have the location of libperl.x and either libperl.dll or libperl.so in it. Add that directory to yourLIBPATHand proceed. - *
- Do not turn on the compiler optimization flag ``-O''. There is a bug in either the optimizer or perl that causes perl to not work correctly when the optimizer is on.
- *
-
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
gethostbyname() works, and make sure that the file
/etc/proto has been renamed to /etc/protocol (NOT/etc/protocols, as used by other Unix systems). You may have to look for things likeHOSTNAMEandDOMAINORIGINin the ``//'SYS1.TCPPARMS(TCPDATA)'''PDSmember in order to properly set up your /etc networking files.
Build, Test, Install Perl on OS/390
Simply put:
sh Configure make make test
if everything looks ok (see the next section for test/IVP diagnosis) then:
make install
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.
Build Anomalies with Perl on OS/390
``Out of memory!'' messages during the build of Perl are most often fixed
by re building the Another memory limiting item to check is your
Within
ulimit -a
To conserve memory you should have your compiler modules loaded into the Link Pack Area (
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.
Testing Anomalies with Perl on OS/390
The ``make test'' step runs a Perl Verification Procedure, usually before
installation. You might encounter - *
-
A message of the form:
io/openpid...........CEE5210S The signal SIGHUP was received. CEE5210S The signal SIGHUP was received. CEE5210S The signal SIGHUP was received. ok
indicates that the t/io/openpid.t test of Perl has passed but done so with extraneous messages on stderr from
CEE. - *
-
A message of the form:
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
indicates a problem with the permissions on your /tmp directory within the
HFS.To correct that problem issue the command:chmod a+t /tmp
from an account with write access to the directory entry for /tmp.
- *
-
Out of Memory!
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
CEErun options, but the environment variable wins.The C code asks for:
#pragma runopts(HEAP(2M,500K,ANYWHERE,KEEP,8K,4K) STACK(,,ANY,) ALL31(ON))
The important parts of that are the second argument (the increment) to
HEAP,and allowing the stack to be ``Above the (16M) line''. If the heap increment is too small then when perl (for example loading unicode/Name.pl) tries to create a ``big'' (400K+) string it cannot fit in a single segment and you get ``Out of Memory!'' - even if there is still plenty of memory available.A related issue is use with perl's malloc. Perl's malloc uses "sbrk()" to get memory, and "sbrk()" is limited to the first allocation so in this case something like:
HEAP(8M,500K,ANYWHERE,KEEP,8K,4K)
is needed to get through the test suite.
Installation Anomalies with Perl on OS/390
The installman script will try to run on Usage Hints for Perl on OS/390
When using perl on Open Edition (
head `whence perldoc`
for an example of how to use the ``eval exec'' trick to ask the shell to have Perl run your scripts on those older releases of Unix System Services.
If you are having trouble with square brackets then consider switching your rlogin or telnet client. Try to avoid older 3270 emulators and
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 int() on the product of a number and a small
magnitude number is not the same as calling int() on the quotient of
that number and a large magnitude number. For example, in the following
Perl code:
my $x = 100000.0; my $y = int($x * 1e-5) * 1e5; # '0' my $z = int($x / 1e+5) * 1e5; # '100000' print "\$y is $y and \$z is $z\n"; # $y is 0 and $z is 100000
Although one would expect the quantities $y and $z to be the same and equal to 100000 they will differ and instead will be 0 and 100000 respectively.
The problem can be further examined in a roughly equivalent C program:
#include <stdio.h> #include <math.h> 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\n",y*1e5,z*1e5); /* y is 0.000000e+00 and z is 1.000000e+05 (with c89) */ }
Modules and Extensions for Perl on OS/390
Pure pure (that is non xs) modules may be installed via the usual:
perl Makefile.PL make make test make install
If you built perl with dynamic loading capability then that would also be the way to build xs based extensions. However, if you built perl with the default static linking you can still build xs based extensions for
perl Makefile.PL make make perl make test make install make -f Makefile.aperl inst_perl MAP_TARGET=perl
In most cases people have reported better results with
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:
export _C89_CCMODE=1
If tcsh is your login shell then use the setenv command.
AUTHORS
David Fiander and Peter Prymmer with thanks to Dennis Longnecker and William Raffloer for valuable reports,SEE ALSO
www.ibm.com/servers/eserver/zseries/zos/unix/bpxa1toy.html www.redbooks.ibm.com/redbooks/SG245944.html www.ibm.com/servers/eserver/zseries/zos/unix/bpxa1ty1.html#opensrc www.xray.mpe.mpg.de/mailing-lists/perl-mvs publibz.boulder.ibm.com:80/cgi-bin/bookmgr_OS390/BOOKS/ceea3030 publibz.boulder.ibm.com:80/cgi-bin/bookmgr_OS390/BOOKS/CBCUG030
Mailing list for Perl on OS/390
If you are interested in the z/OS (formerly known as See also:
lists.perl.org/list/perl-mvs.html
There are web archives of the mailing list at:
www.xray.mpe.mpg.de/mailing-lists/perl-mvs archive.develooper.com/perl-mvs@perl.org
HISTORY
This document was originally written by David Fiander for the 5.005 release of Perl.This document was podified for the 5.005_03 release of Perl 11 March 1999.
Updated 28 November 2001 for broken URLs.
Updated 12 November 2000 for the 5.7.1 release of Perl.
Updated 15 January 2001 for the 5.7.1 release of Perl.
Updated 24 January 2001 to mention dynamic loading.
Updated 12 March 2001 to mention //'