Intel® Advisor GUI: Build Application and Create New Project

To create an application the Intel Advisor can profile:

Get Software Tools and Unpack the Sample

You need the following tools to try tutorial steps yourself using the nqueens_Advisor sample application:

  • Intel Advisor, including sample applications

  • .tgz file extraction utility

  • Supported compiler (see Release Notes for more information)

  • Source code editor

Acquire Intel Advisor

If you do not already have access to the Intel Advisor, you can download an evaluation copy from http://software.intel.com/en-us/articles/intel-software-evaluation-center/.

Install and Set Up Intel Advisor Sample Applications

  1. Copy the nqueens_Advisor.tgz file from the samples/<locale>/C++/ directory to a writable directory or share on your system. The default installation path is /opt/intel/advisor_xe_2013/.

  2. Extract the sample from the .tgz file to a writable directory or share on your system.

  3. Ensure you have set the VISUAL or EDITOR environment variable to your editor.

Verify Optimal Compiler/Linker Options

You can use the Intel Advisor Survey tool to profile your application.

Applications compiled/linked for a release build using the following options produce the most accurate, complete results.

Compiler/Linker Settings

Release Build Options

Compiler: Debug information

-g

Compiler: Optimization

-O2 and -fno-inline-functions

Linker Options

-g and-ldl

Build the Target Executable

  1. In a terminal session, locate the Intel Advisor installation directory root on your system. The default installation location is /opt/intel/advisor_xe_2013.

  2. Type source /opt/intel/advisor_xe_2013/advixe-vars.sh (or equivalent path) to set up your bash shell environment. With a different shell, source the advixe-vars.csh script.

  3. If you need to set up your compiler environment, do so now.

  4. Verify that the environment variable is set. If it is not set, define it by using an export command: export ADVISOR_XE_2013_DIR=/opt/intel/advisor_xe_2013.
  5. Change directory to the nqueens_Advisor/ directory.

  6. For the Survey tool, type make 1_nqueens_serial to build a release version of the nqueens_Advisor sample application.

  7. For the Suitability tool, type make 2_nqueens_annotated to build a release version of the annotated nqueens_Advisor sample application. If you get compiler errors, make sure the ADVISOR_XE_2013_DIR environment variable is defined.

  8. For the Correctness tool, type make 2_nqueens_annotated_debug to build a debug version of the annotated nqueens_Advisor sample application. If you get compiler errors, make sure the ADVISOR_XE_2013_DIR environment variable is defined.

Note

This first part of the tutorial uses the 1_nqueens_serial executable. Later parts use different files, such as 2_nqueens_annotated and 2_nqueens_annotated_debug.

Verify the Target Executable Runs Outside the Intel Advisor

  1. In the same terminal session, change directory (cd) to the nqueens_Advisor directory that you created when you extracted the nqueens_Advisor.tgz file.

  2. Type ./1_nqueens_serial to execute the sample application.

  3. Check for output similar to the following:

    Usage: 1_nqueens_serial[_debug] boardSize [default is 14].
    Starting nqueens (1_nqueens_serial) solver for size 14...
    Number of solutions: 365596
    Correct result!
    
    Calculations took 6.31725 sec.
    

Open the Intel Advisor GUI

  1. If you have not already done so, type source /opt/intel/advisor_xe_2013/advixe-vars.sh (or .csh) to set up your command-line environment.

  2. Type advixe-gui to open the Intel Advisor GUI.

Create a New Project and Specify its Properties

  1. Choose File > New > Project... (or click New Project... in the Welcome page) to display a dialog box similar to the following:
    Create a Project dialog box

  2. Type nqueens_advisor in the Project name field. Then click the Create Project button to create a config.advixeproj file in the $HOME/intel/advixe/projects/nqueens_advisor/ directory (default location) and display a dialog box similar to the following:
    Project Properties dialog box

  3. For the selected Target type of Survey/Suitability Analysis, click the Browse... button next to the Application field and select the nqueens_advisor/1_nqueens_serial executable file. Notice the Intel Advisor autofills the project Working directory field for you.

  4. Click the Binary/Symbol Search tab. In this tab:

    • Locate the line labeled Add new search location.
    • Click the button on the right of that line.
    • Navigate to and select the nqueens_advisor directory.
    • Click Open to add the line.
    • Later when you use your own application, you may need to repeat the above steps to include other directories. You can move the current line up, down, and delete lines using the buttons on the lower-right.
    • In this case, do not select (check) the Search recursively box (lower-left corner).

  5. Click the Source Search tab. In this tab:

    • Locate the line labeled Add new search location.
    • Click the button on the right of that line.
    • Navigate to and select the nqueens_advisor directory.
    • Click Open to add the line.
    • Later when using your own application, repeat the above if you need to include other local directories. You can also use wildcard characters (*.cpp) or specific file names to be included or excluded. You can move the current line up, down, and delete lines using the buttons on the lower-right.
    • In this case, do not check the Search recursively box (lower-left corner).

  6. When the directories are complete, click the OK button. Notice that the project name appears in the title bar.

You have created a project and specified its project properties. At any time, to modify project properties for the currently opened project, click the Project properties icon in the Intel Advisor toolbar.

Key Terms

target

For more complete information about compiler optimizations, see our Optimization Notice.