Testing the installation

To test the product installation and the critical search paths, build and run a sample application.

About this task

Take the following steps to build and run a “Hello World” application:
  1. Create the following Fortran program and name the source file hello.f:
          PRINT *, "Hello World!"
          END
    Note: Each line must have six blank spaces before the first text character.
  2. Compile the program:

    If you have set up the short invocation commands, enter the following command:

     bgxlf hello.f -o hello
    If you have not set up the short invocation commands, enter the following command:
      installation_path/xlf/bg/14.1/bin/bgxlf hello.f -o hello
    where installation_path is the installation location of the compiler packages. If the compiler has been installed to the default location, installation_path is /opt/ibmcmp/.
  3. Compile the program:

    If short invocation commands have been set up, enter the following command:

     bgxlf hello.f -o hello
    If short invocation commands have not been set up, enter the following command:
     /opt/ibmcmp/xlf/bg/14.1/bin/bgxlf hello.f -o hello
  4. Run the program by entering the following command:
      ./hello

    The result is "Hello World!".

  5. Check the exit code of the program by entering the following command:
      echo $?

    The result is "0".