Python-Mvs : Z/OS Python ports  


Downloads and OS390/Zos install :

My port has been done on a MP3000 IBM's computer running OS390 V2R10 , and Z/OS 1.3 on two separate LPARs . I have checked the portability of the port on both versions . The only prerequisite is the IBM's C/C++ compiler.

Python 2.4 modified tarball is provided either in pax source form  here, or in full (binary+source) tar zipped form  here use the following command to untar them on OS 390 or Z/OS platform :

gunzip python241.os390.src.V001.pax.gz

pax -o to=IBM-1047 -rvf python241.os390.src.V001.pax


gunzip python241.os390.full.V001.tar.gz

tar -xvf python241.os390.full.V001.tar

My complete python 2.2 modified tarball is provided here,use the following command to untar them on OS 390 or Z/OS platform :

gunzip python22.os390port.V001.tar.gz
pax -o to=IBM-1047 -rvf python22.os390port.tar

The version number may vary as time goes on ... I'll try to maintain this port , and their still some work to be done : for instance some few packages may still have EBCDIC compliancy problems. I started the port with an original python 2.2 sources from the python site and I did very minor changes inside the code essentially to support EBCDIC + some compiler's idiosynchrasies around Posix compliancies .

More important changes inside the autoconf stuff( , were necessary to support IBM mainframe C++ compiler idiosynchrasies . I also wanted to have the capability of generating either with STATIC linking or MVS DLLs which implies complementary changes.

Support of DLL and dynamic loading of modules make me provide and integrate an MVS python DLL loader dynload_mvs.c and integrate this module in the Python source tree

Anyway the resulting tarball provided above is not MVS/OS390 specific, it is fully compatible with a standard python tar ... It only takes care of the specificity of IBM mainframes platform , and so may be installed on standard unix platform as well ... But it's anyway better to pick up the original python sources on the official python site.

configure and setup .

the pax command described above will produce following directory at the location where you launched the above pax command

> Python-2.X.X

make a cd to this directory path and type :

export _CC_CCMODE=1

 export  _CXX_CSUFFIX=cc


The previous minimal configure command will generate a statically link python instance.


./configure –with-zdll

Adding a –with-zdll option will build a dynamically link python instance instead of the static one produced by the previous configure.


./configure --with-pydebug

This last command will generate the python shell in debug mode providing both -g DBX debug symbols and -DNDEBUG python debugging messages. This last configure launch is usefull when you want to debug a python problem occuring on your system. The configure command is an autoconf generated installer which will analyse your OS/390 environment an generate a Makefile suited to your OS390 box. For instance if your system support XPLINK optimized linking the generated make file will contain the necessary C/C++ flags to build XPLINK compliants modules.

When the autoconf has terminated, it will have generated among other stuff, a Makefile file on your current directory that will be used to build the python shell with following command :

make platform. For static library python build

make for dynamic library build , this make will launch the script at the end which will generate the loadable python modules.

The make commands will generate the python requested binaries.

When the make stage is over your python shell is ready to be used using ./python command.

NOTES FOR .dll dynamic libraries :

In order to make the dll files and python executables loadables you must set the PATH and LIBPATH environment variables ; this can be done inside the /etc/profile file dor instance.

Assuming that the python stuff has been untared inside the /usr/local/src path the following lines must be added into the profile.


# Python 2.2.1 customizations






Copyright © 2002,2003,2004,2005 Jean-Yves MENGANT .