Building the Sample Code

A simple Hello World application can demonstrate some of the debugger's basic features.

To prepare helloworld in C:

Create a new file named helloworld.c in a working directory. Add the following code to helloworld.c:

 #include <stdio.h>
 int main()
 {
    printf("Hello World!\n");
    return 0;
 }

Note iconNote

The Intel Debugger does not support position independent executable (pie).

On some systems the compiler option -fpie is set by default. Use -fno-pie to disable pie.

To compile helloworld.c:

Before compiling you must set the environment variables as described in the compiler User Guide.


  1. Open a shell and change to the working directory.
  2. Compile the application:

    • On Linux* OS, compile the application using the following command:

      icc -debug -O0 helloworld.c -o helloworld

Following successful compilation, the compiler creates an executable named helloworld in the working directory.

To prepare helloworld in Fortran:

Create a new file named helloworld.f90 in a working directory. Add the following code to helloworld.f90:

program main
print *,"Hello World!"
end program main 

To compile helloworld.c:


  1. Open a shell and change to the working directory.

  2. Compile the application:

    • On Linux* OS, compile the application using the following command:

      ifort -debug -O0 helloworld.f90 -o helloworld

Following successful compilation, the compiler creates an executable named helloworld in the working directory.


Submit feedback on this help topic

Copyright © 2001-2011, Intel Corporation. All rights reserved.