Using IBM C/C++ compilers with IBM Open Enterprise SDK for Python

This section introduces multiple compilers that you can use with IBM® Open Enterprise SDK for Python 3.13 and how to use them properly.

C/C++ compilers available on z/OS

It is recommended to use either IBM C/C++ for Open Enterprise Languages on z/OS® 2.0 or IBM Open XL C/C++ 2.1 for z/OS because they provide the highest compatibility with PyPI packages. The following list provides the download address for each C/C++ compiler:

The following compilers can be used but are no longer orderable:

Build packages with setuptools

To build packages with setuptools with a given compiler, set the following environment variables:
export CC=<path_to_c_compiler>
export CXX=<path_to_cxx_compiler>
export LDSHARED=<path_to_c_compiler>
Note: There are binary compatibility issues when mixing compilers, and you should avoid mixing compilers.

Determining if you have a C/C++ Compiler

To determine if you already have a C and C++ compiler, you can test your compiler by creating the following file:
#include <stdio.h>

int main()
{
    printf("Hello, world!\n");
    return 0;
}
Then you can compile and run the program by running:
<path_to_your_c_compiler> <filename.c>
./a.out

If it runs successfully, the program will output Hello, world! which means your compiler is ready for use by IBM Open Enterprise SDK for Python.

If it fails, access the C/C++ compilers download addresses in C/C++ compilers available on z/OS section in this chapter and install the compiler.

Recommended Configuration for IBM z/OS XL C/C++

If you are using IBM z/OS XL C/C++, then it’s required to set the following environment variables before building any packages:
export _CC_CCMODE=1
export _CXX_CCMODE=1
export _C89_CCMODE=1
export _CC_EXTRA_ARGS=1
export _CXX_EXTRA_ARGS=1
export _C89_EXTRA_ARGS=1
Without these environment variables set up, you may encounter the following error while building:
FSUM3010 Specify a file with the correct suffix (.C, .hh, .i, .c, .i, .s, .o, .x, .p, .I, or .a), or a corresponding data set name

Troubleshooting on using IBM z/OS C/C++ Compilers

For more information about troubleshooting C/C++ compilers, see IBM z/OS C/C++ Failures.