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.
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 threading errors:
Get Software Tools
You need the following tools to try tutorial steps yourself using the
tachyon_insp_xe
sample application:
- Intel Inspectorinstallation package and license
- .zipfile extraction utility
- Supported compiler (seeRelease Notesfor 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 Applications- Copy thetachyon_inxp_xe.zipfile from the<install-dir>\samples\<locale>\C++\directory to a writable directory or share on your system. The default<install-dir>is belowC:\Program Files (x86)\Intel\(on certain systems, instead of.Program Files (x86), the directory name isProgram Files)
- Extract the sample from the.zipfile to create thetachyon_insp_xedirectory.
- Samples are non-deterministic. Your screens may vary from the screen captures shown throughout this tutorial.
- Samples are designed only to illustrate theIntel Inspectorfeatures; 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
- FindVisual Studio Toolsfor your Visual Studio* and OS version, and select one of the command prompt shortcuts. For example, from the Microsoft Windows* 10All Appsscreen, select .
- In the command prompt window, change directory to thetachyon_inspxe\directory in its unzipped location.
- If you are using Microsoft Visual Studio* version 2012 or later, typedevenv vc10\tachyon_insp_xe.sln /Upgradeto convert thetachyon_insp_xe.slnsolution.
- Typedevenv vc10\tachyon_insp_xe.sln /Buildto build all projects in the solution.
Verify the Application Runs Outside the
Intel Inspector
Intel Inspector
- Change directory tovc10\find_and_fix_threading_errors_Win32\Debug\.
- Typefind_and_fix_threading_errors.exe ..\..\..\dat\simpleballs.datto execute the application.
- Check for non-deterministic application output similar to the following:Notice the off-color dots in the image. The cause: Threading errors.
Keep the command prompt window open.
Set up the
Intel Inspector Environment
Intel Inspector
EnvironmentSetting 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 standalone
Intel Inspector
, run the
<inspector-install-dir>\inspxe-vars.bat
command.
The default installation path,
<inspector-install-dir>
, is below
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>\
command. The default installation path,
env\vars
.bat<oneapi-install-dir>
, is inside
C:\Program Files (x86)\Intel\oneAPI
.
Open the
Intel Inspector Standalone GUI
Intel Inspector
Standalone GUI For the
Intel Inspector
standalone GUI, do one of the following:
- Run theinspxe-guicommand.
- From the Microsoft Windows* 7Startmenu, selectIntel Inspector [version].
- From the Microsoft Windows* 8/8.1/10All Appsscreen, selectIntel Inspector [version].
Create a New Project
- Chooseto display a dialog box similar to the following:
- In theProject namefield, typethreading. Then click theCreate projectbutton to create aconfig.inspxeprojfile in the\Inspector\Projects\threading\directory (default location) and display a dialog box similar to the following:
- Click theBrowse...button next to theApplicationfield and select thetachyon_insp_xe\vc10\find_and_fix_threading_errors_Win32\Debug\find_and_find_threading_errors.exeapplication. Notice theIntel Inspectorautofills the projectWorking directoryfield for you.
- Click theModifybutton next to theApplication Parametersfield. In theApplication Parameterswindow, click theBrowse to insert file pathbutton, change theSelect the file to launchwindow to show all files, select thetachyon_insp_xe\dat\simpleballs.datfile, click theOKbutton to close theApplication Parameterswindow, then click theOKbutton to return to the Welcome page, where the name of the opened project displays in the title bar and in theProject Navigatorpane. (If necessary, choose to display theProject Navigator.)