Tutorial

  • 11/18/2019
  • Public Content

Standalone GUI: Build Application and Create New Project

Intel® Inspector
is a dynamic memory and threading error checking tool for users developing serial and multithreaded applications on Windows* and Linux* operating systems. This topic is part of a
tutorial
that shows how to find and fix
memory
errors using the
Intel Inspector
and a
C++
sample application.
Follow these steps only if you are using the
Intel Inspector
standalone GUI to complete this tutorial.
To create an application the
Intel Inspector
can inspect for memory errors:

Get Software Tools

You need the following tools to try tutorial steps yourself using the
tachyon_insp_xe
sample application:
  • Intel Inspector
    installation package and license
  • .zip
    file extraction utility
  • Supported compiler (see
    Release Notes
    for more information)
Acquire the
Intel Inspector
If you do not already have access to the
Intel Inspector
, you can download an evaluation copy from http://software.intel.com/en-us/articles/intel-software-evaluation-center/.
Install and Set Up the
Intel Inspector
Sample Application
  1. Copy the
    tachyon_insp_xe.zip
    file from the
    <install-dir>\samples\<locale>\C++\
    directory to a writable directory or share on your system. The default
    <install-dir>
    is inside
    C:\Program Files (x86)\Intel\
    (on certain systems, instead of
    Program Files (86)
    , the directory name is
    Program Files
    )
    .
  2. Extract the sample from the
    .zip
    file to create the
    tachyon_insp_xe
    directory.
  • Samples are non-deterministic. Your screens may vary from the screen captures shown throughout this tutorial.
  • Samples are designed only to illustrate the
    Intel Inspector
    features; they do not represent best practices for creating code.

Understand Optimal Compiler/Linker Settings

You can use the
Intel® Inspector
to analyze memory and threading errors in both debug and release modes of C++ and Fortran binaries; however, applications compiled/linked in debug mode using the following settings produce the most accurate and complete analysis results.
Compiler/Linker Property
Correct C/C++ Setting
Impact If Not Set Correctly
Debug information
Enabled (
/Zi
or
/ZI
)
Missing file/line information
Optimization
Disabled (
/Od
)
Incorrect file/line information
Dynamic runtime library
Selected (
/MD
or
/MDd
)
False positives or missing code locations
Basic runtime error checks
Disabled (do not use
/RTC
;
Default
option in Visual Studio* IDE)
False positives
Compiler/Linker Property
Correct Fortran Setting
Impact If Not Set Correctly
Debug information
Enabled (
/debug:full
)
Missing file/line information
Optimization
Disabled (
/Od
)
Incorrect file/line information
Dynamic runtime library
Selected (
/libs:dll/threads
or
libs:dll/threads/dbglibs
)
False positives or missing code locations
Basic runtime error checks
None (
/check:none
)
False positives

Build the Application

  1. Find
    Visual Studio Tools
    for your Visual Studio* and OS version, and select one of the command prompt shortcuts. For example, from the Microsoft Windows* 10
    All Apps
    screen, select
    Visual Studio 2013
    Visual Studio Tools
    VS2013 x64 Native Tools Command Prompt
    .
  2. In the command prompt window, change directory to the
    tachyon_inspxe\
    directory in its unzipped location.
  3. If you are using Microsoft Visual Studio* version 2012 or later, type
    devenv vc10\tachyon_insp_xe.sln /Upgrade
    to convert the
    tachyon_insp_xe.sln
    solution.
  4. Type
    devenv vc10\tachyon_insp_xe.sln /Build
    to build all projects in the solution.

Verify the Application Runs Outside the
Intel Inspector

  1. Change directory to
    vc10\find_and_fix_memory_errors_Win32\Debug\
    .
  2. Type
    find_and_fix_memory_errors.exe ..\..\..\dat\simpleballs.dat
    to execute the application.
  3. Check for application output similar to the following:
    Application output
    Notice the application output window is empty. The cause: Memory errors. This is how the application output should look after various memory errors are resolved:
    Application output
Keep the command prompt window open.

Set up the
Intel Inspector
Environment

Setting up the
Intel Inspector
environment is necessary only if you plan to use the
inspxe-gui
command to launch the
Intel Inspector
standalone GUI or the
inspxe-cl
command to run the command line interface.
For the
Intel Inspector
in the
Intel Parallel Studio XE
, do one of the following to set up your environment:
  • Run the
    <inspector-install-dir>\inspxe-vars.bat
    command.
    The default installation path,
    <inspector-install-dir>
    , is inside
    C:\Program Files (x86)\IntelSWTools\
    (on certain systems, instead of
    Program Files (x86)
    , the directory name is
    Program Files
    ).
  • Run the
    <studio-install-dir>\psxevars.bat
    command.
    The default installation path,
    <studio-install-dir>
    , is inside
    C:\Program Files (x86)\IntelSWTools\
    .
For the
Intel Inspector
in the
Intel System Studio
, run the
<inspector-install-dir>\inspxe-vars.bat
command to set up your environment. The default installation path,
<inspector-install-dir>
, is inside
C:\Program Files (x86)\IntelSWTools\
(on certain systems, instead of
Program Files (x86)
, the directory name is
Program Files
).
For the application as part of an
Intel® oneAPI HPC Toolkit
or
Intel® oneAPI IoT Toolkit
installation, run the
<oneapi-install-dir>\
env\vars
.bat
command. The default installation path,
<oneapi-install-dir>
, is inside
C:\Program Files (x86)\inteloneapi\
.

Open the
Intel Inspector
Standalone GUI

For the
Intel Inspector
standalone GUI in the
Intel Parallel Studio XE
, do one of the following:
  • Run the
    inspxe-gui
    command.
  • From the Microsoft Windows* 7
    Start
    menu, select
    Intel Parallel Studio XE [version]
    >
    Analyzers
    >
    Intel Inspector [version]
    .
  • From the Microsoft Windows* 8/8.1/10
    All Apps
    screen, select
    Intel Parallel Studio XE [version]
    >
    Intel Inspector [version]
    .
For the
Intel Inspector
standalone GUI in the
Intel System Studio
, do one of the following:
  • Run the
    inspxe-gui
    command.
  • From the Microsoft Windows* 7
    Start
    menu, select
    Intel System Studio [version] for Windows target
    >
    Analyzers
    >
    Intel Inspector [version]
    for Systems
    .
  • From the Microsoft Windows* 8/8.1/10
    All Apps
    screen, select
    Intel System Studio [version] for Windows target
    >
    Intel Inspector [version]
    for Systems
    .

Create a New Project

  1. Choose
    File
    New
    Project...
    to display a dialog box similar to the following:
    Create a Project dialog box
  2. In the
    Project name
    field, type
    memory
    . Then click the
    Create project
    button to create a
    config.inspxeproj
    file in the
    \Inspector\Projects\memory\
    directory (default location) and display a dialog box similar to the following:
    Target tab in the Project Properties dialog box
  3. Click the
    Browse...
    button next to the
    Application
    field and select the
    tachyon_insp_xe\vc10\find_and_fix_memory_errors_Win32\Debug\find_and_find_memory_errors.exe
    application. Notice the
    Intel Inspector
    autofills the project
    Working directory
    field for you.
  4. Click the
    Modify
    button next to the
    Application Parameters
    field. In the
    Application Parameters
    window, click the
    Browse to insert file path
    button, change the
    Select the file to launch
    window to show all files, select the
    tachyon_insp_xe\dat\simpleballs.dat
    file, click the
    OK
    button to close the
    Application Parameters
    window, then click the
    OK
    button to return to the Welcome page, where the name of the opened project displays in the title bar and in the
    Project Navigator
    pane. (If necessary, choose
    View
    Project Navigator
    to display the
    Project Navigator
    .)

Product and Performance Information

1

Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include SSE2, SSE3, and SSSE3 instruction sets and other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended for use with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are reserved for Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the specific instruction sets covered by this notice.

Notice revision #20110804