Running your compiled application

After a program is compiled and linked, you can run the generated executable file on the command line.

The default file name for the program executable file produced by the XL C/C++ compiler is a.out. You can select a different name with the -o compiler option.

Avoid giving your program executable file the same name as system or shell commands, such as test or cp, as you could accidentally execute the wrong command. If you do decide to name your program executable file with the same name as a system or shell command, execute your program by specifying the path name to the directory in which your executable file resides, such as ./test.

To run a program, enter the name of the program executable file with runtime arguments on the command line.

Canceling execution

To suspend a running program, press Ctrl+Z while the program is in the foreground. Use the fg command to resume running.

To cancel a running program, press Ctrl+C while the program is in the foreground.

Setting runtime options

You can use environment variable settings to control certain runtime options and behaviors of applications created with the XL C/C++ compiler. Some environment variables do not control actual runtime behavior, but they can have an impact on how your applications run.

For more information about environment variables and how they can affect your applications at run time, see the XL C/C++ Installation Guide.

Running compiled applications on other systems

If you want to run an application developed with the XL C/C++ compiler on another system that does not install the compiler, you need to install a runtime environment on that system or link your application statically.

You can obtain the latest XL C/C++ Runtime Environment images, together with licensing and usage information, from the XL C/C++ for Linux® support page.