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
threading
errors using the
Intel Inspector
and a
C++
sample application.
To create an application the
Intel Inspector
can inspect for threading 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
  • .tgz
    file extraction utility
  • Supported compiler (see
    Release Notes
    for more information)
  • Editor
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 Applications
  1. Copy the
    tachyon_inxp_xe.tgz
    file from the
    <install-dir>/samples/<locale>/C++/
    directory to a writable directory or share on your system. The default
    <install-dir>
    is below
    /opt/intel/
    .
  2. Extract the sample from the
    .tgz
    file to create the
    tachyon_insp_xe
    directory.
  3. Ensure you have set the EDITOR or VISUAL environment variable to your text editor.
  • 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 (
-g
)
Missing file/line information
Optimization
Disabled (
-O0
)
Incorrect file/line information
Dynamic runtime library
Selected (
-shared-intel
for Intel(R) compilers; default or
-Bdynamic
for GNU compilers)
False positives or missing code locations
Basic runtime error checks
Disabled (do not use
-fmudflap
)
False positives
Compiler/Linker Property
Correct Fortran Setting
Impact If Not Set Correctly
Debug information
Enabled (
-debug
or
-g
)
Missing file/line information
Optimization
Disabled (
-O0
)
Incorrect file/line information
Dynamic runtime library
Selected (
-shared-intel
)
False positives or missing code locations
Basic runtime error checks
None (
-check:none
)
False positives

Build the Application

  1. In a terminal session, change directory to the
    tachyon_insp_xe
    directory.
  2. Type
    make
    .

Verify the Application Runs Outside the
Intel Inspector

  1. In the same terminal session, type
    ./tachyon.find_and_fix_threading_errors
    to execute the sample application.
  2. Check for non-deterministic application output similar to the following:
    Application output
    Notice the off-color dots in the image. The cause: Threading errors.

Set up the
Intel Inspector
Environment

Do one of the following to set up the
Intel Inspector
environment:
  • Run one of the following
    source
    commands:
    • For csh/tcsh users:
      source <inspector-install-dir>/inspxe-vars.csh
    • For bash users:
      source <inspector-install-dir>/inspxe-vars.sh
    The name of this script for the application as part of an
    Intel® oneAPI HPC Toolkit
    or
    Intel® oneAPI IoT Toolkit
    installation is
    env\vars
    instead of
    inspxe-vars
    .
    The default installation path,
    <inspector-install-dir>
    , is below:
    • /opt/intel/
      for root users
    • $HOME/intel/
      for non-root users
  • Add
    <inspector-install-dir>/bin32
    or
    <inspector-install-dir>/bin64
    to your path.
In some cases, you can also run the
<studio-install-dir>/psxevars.csh
or
<studio-install-dir>/psxevars.sh
command. The default installation path,
<studio-install-dir>
, is below:
  • /opt/intel/
    for root users
  • $HOME/intel/
    for non-root users

Open the
Intel Inspector
Standalone GUI

In the same terminal session, type
inspxe-gui &
to run the
Intel Inspector
standalone GUI in the background.

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
    threading
    . Then click the
    Create project
    button to create a
    config.inspxeproj
    file in the
    ~/intel/inspxe/projects/threading/
    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/tachyon.find_and_fix_threading_errors
    application. Notice the
    Intel Inspector
    autofills the project
    Working directory
    field for you.
    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