Cari di Perl 
    Perl User Manual
Daftar Isi
(Sebelumnya) Perl under OS/2, DOS, Win0.3*, ...Perl version 5 on OS/400 (Berikutnya)
Platform Specific

Building and installing Perl for OS/390 and z/OS

Daftar Isi

NAME

perlos390 - building and installing Perl for OS/390 and z/OS

SYNOPSIS

This document will help you Configure, build, test and install Perlon OS/390 (aka z/OS) Unix System Services.

DESCRIPTION

This is a fully ported Perl for OS/390 Version 2 Release 3, 5, 6, 7,8, and 9. It may work on other versions or releases, but those arethe ones we've tested it on.

You may need to carry out some system configuration tasks beforerunning the Configure script for Perl.

Tools

The z/OS Unix Tools and Toys list may prove helpful and contains linksto ports of much of the software helpful for building Perl.http://www.ibm.com/servers/eserver/zseries/zos/unix/bpxa1toy.html

Unpacking Perl distribution on OS/390

If using ftp remember to transfer the distribution in binary format.

Gunzip/gzip for OS/390 is discussed at:

  1. http://www.ibm.com/servers/eserver/zseries/zos/unix/bpxa1ty1.html

to extract an ASCII tar archive on OS/390, try this:

  1. pax -o to=IBM-1047,from=ISO8859-1 -r < latest.tar

or

  1. zcat latest.tar.Z | pax -o to=IBM-1047,from=ISO8859-1 -r

If you get lots of errors of the form

  1. 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'llfirst have to remove the (now corrupt) perl directory

  1. 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 necessaryparser template files. If you have not already done so then be sure to:

  1. cp /samples/yyparse.c /etc

This may also be a good time to ensure that your /etc/protocol fileand either your /etc/resolv.conf or /etc/hosts files are in place.The IBM document that described such USS system setup issues wasSC28-1890-07 "OS/390 UNIX System Services Planning", in particularChapter 6 on customizing the OE shell.

GNU make for OS/390, which is recommended for the build of perl (aswell as building CPAN modules and extensions), is available from theTools.

Some people have reported encountering "Out of memory!" errors whiletrying to build Perl using GNU make binaries. If you encounter suchtrouble then try to download the source code kit and build GNU makefrom source to eliminate any such trouble. You might also find GNU make(as well as Perl and Apache) in the red-piece/book "Open Source Softwarefor OS/390 UNIX", SG24-5944-00 from IBM.

If instead of the recommended GNU make you would like to use the systemsupplied make program then be sure to install the default rules fileproperly via the shell command:

  1. 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 GNU make).

You might also want to have GNU groff for OS/390 installed beforerunning the "make install" step for Perl.

There is a syntax error in the /usr/include/sys/socket.h header filethat IBM supplies with USS V2R7, V2R8, and possibly V2R9. The problem withthe header file is that near the definition of the SO_REUSEPORT constantthere is a spurious extra '/' character outside of a comment like so:

  1. #define SO_REUSEPORT 0x0200 /* allow local address & port
  2. reuse */ /

You could edit that header yourself to remove that last '/', or you mightnote that Language Environment (LE) APAR PQ39997 describes the problemand PTF's UQ46272 and UQ46271 are the (R8 at least) fixes and apply them.If left unattended that syntax error will turn up as an inability for Perlto build its "Socket" extension.

For successful testing you may need to turn on the sticky bit for yourworld 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 INSTALLfor a full discussion of the Configure options). There is a "hints" filefor os390 that specifies the correct values for most things. Some thingsto watch out for include:

  • A message of the form:

    1. (I see you are using the Korn shell. Some ksh's blow up on Configure,
    2. 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 /etcbefore running Perl's Configure. This step ensures successful extractionof EBCDIC versions of parser files such as perly.c, perly.h, and x2p/a2p.c.This has to be done before running Configure the first time. If you failedto do so then the easiest way to re-Configure Perl is to delete yourmisconfigured build root and re-extract the source from the tar ball.Then you must ensure that /etc/yyparse.c is properly in place beforeattempting to re-run Configure.

  • This port will support dynamic loading, but it is not selected bydefault. If you would like to experiment with dynamic loading thenbe 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 LIBPATH environment variable in orderfor 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:

    1. CEE3501S The module libperl.dll was not found.
    2. From entry point __dllstaticinit at compile unit offset +00000194 at

    then your LIBPATH does not have the location of libperl.x and eitherlibperl.dll or libperl.so in it. Add that directory to your LIBPATH andproceed.

  • Do not turn on the compiler optimization flag "-O". There isa bug in either the optimizer or perl that causes perl tonot work correctly when the optimizer is on.

  • Some of the configuration files in /etc used by thenetworking APIs are either missing or have the wrongnames. In particular, make sure that there's eitheran /etc/resolv.conf or an /etc/hosts, so thatgethostbyname() 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 like HOSTNAME and DOMAINORIGINin the "//'SYS1.TCPPARMS(TCPDATA)'" PDS member in order toproperly set up your /etc networking files.

Build, Test, Install Perl on OS/390

Simply put:

  1. sh Configure
  2. make
  3. make test

if everything looks ok (see the next section for test/IVP diagnosis) then:

  1. make install

this last step may or may not require UID=0 privileges dependingon how you answered the questions that Configure asked and whetheror 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 fixedby re building the GNU make utility for OS/390 from a source code kit.

Another memory limiting item to check is your MAXASSIZE parameter in your'SYS1.PARMLIB(BPXPRMxx)' data set (note too that as of V2R8 address spacelimits can be set on a per user ID basis in the USS segment of a RACFprofile). People have reported successful builds of Perl with MAXASSIZEparameters as small as 503316480 (and it may be possible to build Perlwith a MAXASSIZE smaller than that).

Within USS your /etc/profile or $HOME/.profile may limit your ulimitsettings. Check that the following command returns reasonable values:

  1. ulimit -a

To conserve memory you should have your compiler modules loaded into theLink Pack Area (LPA/ELPA) rather than in a link list or step lib.

If the c89 compiler complains of syntax errors during the build of theSocket extension then be sure to fix the syntax error in the systemheader /usr/include/sys/socket.h.

Testing Anomalies with Perl on OS/390

The "make test" step runs a Perl Verification Procedure, usually beforeinstallation. You might encounter STDERR messages even during a successfulrun of "make test". Here is a guide to some of the more commonly seenanomalies:

  • A message of the form:

    1. io/openpid...........CEE5210S The signal SIGHUP was received.
    2. CEE5210S The signal SIGHUP was received.
    3. CEE5210S The signal SIGHUP was received.
    4. ok

    indicates that the t/io/openpid.t test of Perl has passed but done sowith extraneous messages on stderr from CEE.

  • A message of the form:

    1. lib/ftmp-security....File::Temp::_gettemp: Parent directory (/tmp/) is not safe
    2. (sticky bit not set when world writable?) at lib/ftmp-security.t line 100
    3. File::Temp::_gettemp: Parent directory (/tmp/) is not safe (sticky bit not
    4. set when world writable?) at lib/ftmp-security.t line 100
    5. ok

    indicates a problem with the permissions on your /tmp directory within the HFS.To correct that problem issue the command:

    1. 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 commentsabove on memory limitations it is also worth checking for _CEE_RUNOPTSin your environment. Perl now has (in miniperlmain.c) a C #pragmato set CEE run options, but the environment variable wins.

    The C code asks for:

    1. #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 heapincrement is too small then when perl (for example loading unicode/Name.pl) triesto create a "big" (400K+) string it cannot fit in a single segmentand you get "Out of Memory!" - even if there is still plenty of memoryavailable.

    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 thiscase something like:

    1. 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 OS/390. There will be fewer errorsif you have a roff utility installed. You can obtain GNU groff from theRedbook SG24-5944-00 ftp site.

Usage Hints for Perl on OS/390

When using perl on OS/390 please keep in mind that the EBCDIC and ASCIIcharacter sets are different. See perlebcdic.pod for more on such characterset issues. Perl builtin functions that may behave differently underEBCDIC are also mentioned in the perlport.pod document.

Open Edition (UNIX System Services) from V2R8 onward does support#!/path/to/perl script invocation. There is a PTF available fromIBM for V2R7 that will allow shell/kernel support for #!. USSreleases prior to V2R7 did not support the #! means of script invocation.If you are running V2R6 or earlier then see:

  1. head `whence perldoc`

for an example of how to use the "eval exec" trick to ask the shell tohave Perl run your scripts on those older releases of Unix System Services.

If you are having trouble with square brackets then consider switching yourrlogin or telnet client. Try to avoid older 3270 emulators and ISHELL forworking with Perl on USS.

Floating Point Anomalies with Perl on OS/390

There appears to be a bug in the floating point implementation on S/390systems such that calling int() on the product of a number and a smallmagnitude number is not the same as calling int() on the quotient ofthat number and a large magnitude number. For example, in the followingPerl code:

  1. my $x = 100000.0;
  2. my $y = int($x * 1e-5) * 1e5; # '0'
  3. my $z = int($x / 1e+5) * 1e5; # '100000'
  4. 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 equalto 100000 they will differ and instead will be 0 and 100000 respectively.

The problem can be further examined in a roughly equivalent C program:

  1. #include <stdio.h>
  2. #include <math.h>
  3. main()
  4. {
  5. double r1,r2;
  6. double x = 100000.0;
  7. double y = 0.0;
  8. double z = 0.0;
  9. x = 100000.0 * 1e-5;
  10. r1 = modf (x,&y);
  11. x = 100000.0 / 1e+5;
  12. r2 = modf (x,&z);
  13. printf("y is %e and z is %e\n",y*1e5,z*1e5);
  14. /* y is 0.000000e+00 and z is 1.000000e+05 (with c89) */
  15. }

Modules and Extensions for Perl on OS/390

Pure pure (that is non xs) modules may be installed via the usual:

  1. perl Makefile.PL
  2. make
  3. make test
  4. make install

If you built perl with dynamic loading capability then that would alsobe the way to build xs based extensions. However, if you built perl withthe default static linking you can still build xs based extensions for OS/390but you will need to follow the instructions in ExtUtils::MakeMaker forbuilding statically linked perl binaries. In the simplest configurationsbuilding a static perl + xs extension boils down to:

  1. perl Makefile.PL
  2. make
  3. make perl
  4. make test
  5. make install
  6. make -f Makefile.aperl inst_perl MAP_TARGET=perl

In most cases people have reported better results with GNU make ratherthan the system's /bin/make program, whether for plain modules or forxs based extensions.

If the make process encounters trouble with either compilation orlinking then try setting the _C89_CCMODE to 1. Assuming sh is yourlogin shell then run:

  1. 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 Longneckerand William Raffloer for valuable reports, LPAR and PTF feedback.Thanks to Mike MacIsaac and Egon Terwedow for SG24-5944-00.Thanks to Ignasi Roca for pointing out the floating point problems.Thanks to John Goodyear for dynamic loading help.

SEE ALSO

INSTALL, perlport, perlebcdic, ExtUtils::MakeMaker.

  1. http://www.ibm.com/servers/eserver/zseries/zos/unix/bpxa1toy.html
  2. http://www.redbooks.ibm.com/redbooks/SG245944.html
  3. http://www.ibm.com/servers/eserver/zseries/zos/unix/bpxa1ty1.html#opensrc
  4. http://www.xray.mpe.mpg.de/mailing-lists/perl-mvs/
  5. http://publibz.boulder.ibm.com:80/cgi-bin/bookmgr_OS390/BOOKS/ceea3030/
  6. http://publibz.boulder.ibm.com:80/cgi-bin/bookmgr_OS390/BOOKS/CBCUG030/

Mailing list for Perl on OS/390

If you are interested in the VM/ESA, z/OS (formerly known as OS/390)and POSIX-BC (BS2000) ports of Perl then see the perl-mvs mailing list.To subscribe, send an empty message to [email protected].

See also:

  1. http://lists.perl.org/list/perl-mvs.html

There are web archives of the mailing list at:

  1. http://www.xray.mpe.mpg.de/mailing-lists/perl-mvs/
  2. http://archive.develooper.com/[email protected]/

HISTORY

This document was originally written by David Fiander for the 5.005release 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 //'SYS1.TCPPARMS(TCPDATA)'.

 
Source : perldoc.perl.org - Official documentation for the Perl programming language
Site maintained by Jon Allen (JJ)     See the project page for more details
Documentation maintained by the Perl 5 Porters
(Sebelumnya) Perl under OS/2, DOS, Win0.3*, ...Perl version 5 on OS/400 (Berikutnya)