blob: 1598624d59d2f592f14c19a2bf3cff1c7d6f7f3c [file] [log] [blame]
<HTML>
<BODY>
<H2>Overview</H2>
This directory has example usages of Threading Building Blocks.
<H2>Directories</H2>
<DL>
<DT><A HREF="GettingStarted/index.html">GettingStarted</A>
<DD>Examples from the Getting Started Guide.
<DT><A HREF="concurrent_hash_map/index.html">concurrent_hash_map</A>
<DD>Examples using <CODE>concurrent_hash_map</CODE>.
<DT><A HREF="parallel_do/index.html">parallel_do</A>
<DD>Examples using <CODE>parallel_do</CODE>.
<DT><A HREF="parallel_for/index.html">parallel_for</A>
<DD>Examples using <CODE>parallel_for</CODE>.
<DT><A HREF="parallel_reduce/index.html">parallel_reduce</A>
<DD>Examples using <CODE>parallel_reduce</CODE>.
<DT><A HREF="pipeline/index.html">pipeline</A>
<DD>Examples using <CODE>pipeline</CODE>.
<DT><A HREF="task/index.html">task</A>
<DD>Examples using raw <CODE>task</CODE> interface.
<DT><A HREF="test_all/index.html">test_all</A>
<DD>Examples that test all the parts of the package.
<DT><A HREF="common/index.html">common</A>
<DD>Common files for building various examples. Not used directly.
</DL>
<A NAME=build><H2>To Build</H2></A>
Build each example by using one of the following methods. The specific directions for each
method can be found below.
<UL>
<LI>Build by using a <A HREF=#build_1>Microsoft* Visual Studio* project (Windows* systems only)</A>.
<LI>Build by using a <A HREF=#build_2>Xcode* IDE project (Mac OS* X systems only)</A>.
<LI>Build by using a <A HREF=#build_3>Makefile (Windows*, Linux* or Mac OS* X systems)</A>.
</UL>
<P>
Some of the following directions refer to a shell window; this refers
to the command prompt environment/window normally used on your system.
A shell might be a cmd.exe command prompt window (Windows* systems), or a
sh, bash, csh, ksh, etc. (or compatible) shell window (Windows*, Linux* or Mac OS* X systems).
</P>
<A NAME=build_1><H4>To build by using a Microsoft* Visual Studio* project (Windows* systems):</H4></A>
Perform the following steps:
<OL>
<LI>Identify the solution (*.sln) file for the example you wish to build and run.For Microsoft* Visual Studio* 2005, the *.sln file is in the example's msvs sub-directory. For other versions please use Microsoft*
Visual Studio* project converter
<UL>
<li>&lt;example_name&gt;_cl.sln&nbsp; - Solution for Microsoft* Visual C++* compiler
</li>
<li>&lt;example_name&gt;_icl.sln - Solution for Intel&reg; C++ Compiler </li>
</UL>
<LI>Open the project by using one of the following methods:
<UL>
<LI>Navigate to the *.sln file from My Computer, by using Windows Explorer, or by using another file browser.
Double-click the *.sln file to invoke Microsoft* Visual Studio* and open the project.
<LI>Invoke Microsoft* Visual Studio* from the Start menu and use the "Open Project" dialog to navigate to
and open the project.
</UL>
<LI>Press &lt;ctrl-F5&gt; to build and run the example.
</OL>
<A NAME=build_2><H4>To build by using a Xcode* IDE project (Mac OS* X systems):</H4></A>
Perform the following steps:
<OL>
<LI>Identify the project (*.xcodeproj) file for the example you wish to build and run.
<UL>
<LI>The *.xcodeproj file is in the example's xcode sub-directory.
</UL>
<LI>Open the project by using one of the following methods:
<UL>
<LI>Navigate to the *.xcodeproj file by using the Finder.
Double-click the *.xcodeproj file to invoke the Xcode* IDE and open the project.
<LI>Invoke the Xcode* IDE and use the "File &rArr; Open&hellip;" dialog to navigate to
and open the project.
</UL>
<LI>Press &lt;Apple-R&gt;, or press the "Build and Go" button in the toolbox, to build and run the example.
</OL>
<A NAME=build_3><H4>To build by using a Makefile (Windows*, Linux* or Mac OS* X systems):</H4></A>
Perform the following steps:
<OL>
<LI>Open a shell window. For Windows* systems, make sure this shell window has the proper environment
defined for use with Microsoft* Visual Studio* (.NET 2003 or 2005); such a shell can be invoked
from the Start menu, under Visual Studio, Visual Studio Tools, Visual Studio Command Prompt.
<LI>Set up the environment in this shell window for use with Threading Building Blocks.
<BR>See below for how to set up the environment for
<A HREF=#env_1>Windows*</A>, <A HREF=#env_23>Linux*</A> or <A HREF=#env_23>Mac OS* X</A> systems.
<LI>Unless you installed Threading Building Blocks yourself, you may not have write permissions
to the directory containing the example. In this case, make a copy of the example, and use the copy
for the following steps.
<LI>In the shell window, navigate to the directory for the example
(or to the directory for the copy of the example if you made one in the previous step).
<LI>Use one or more of the following commands to build and run the example.
Here, make refers to the make command normally used on your system: this could be
nmake, gmake, or make on Windows* systems, or make or gmake on Linux* or Mac OS* X systems.
<DL>
<DT><TT>make</TT>
<DD>Default build and run. Equivalent to 'make release test'.
<DT><TT>make release</TT>
<DD>Compile and link against the release version of the Threading Building Blocks library.
The resulting executable is left in the directory for the example.
<DT><TT>make debug</TT>
<DD>Compile and link against the debug version of the Threading Building Blocks library.
The resulting executable is left in the directory for the example.
<DT><TT>make test</TT>
<DD>Run an executable previously produced by one of the above commands.
<DT><TT>make <B>[</B>(above options or targets)<B>]</B> CXX=<B>{</B>icl, icc<B>}</B></TT>
<DD>Build and run as above, but use Intel&reg; compilers instead of default, native compilers
(e.g., icl instead of cl.exe on Windows* systems, or icc instead of g++ on Linux* or Mac OS* X systems).
<DT><TT>make clean</TT>
<DD>Remove any executables or intermediate files produced by the above commands.
</DL>
</OL>
<A NAME=env_1><H4>To set up the environment (Windows* systems):</H4></A>
It is <B>strongly</B> recommended that the environment be set up when installing Threading Building Blocks.
Do this by selecting the appropriate check-box during the install. However, if the environment is not set up
during installation, or you wish to build for an alternate architecture or Microsoft* Visual Studio* version,
it may be set up, for a given type of shell window, by using one of the following commands:
<DL>
<DT>For cmd.exe (command prompt):
<DD><TT>&lt;<I>installdir</I>&gt;\{ia32,intel64}\{vc8,vc9,vc_mt}\bin\tbbvars.bat</TT>
<DT>For sh, bash, ksh (or compatibles):
<DD><TT>. &lt;<I>installdir</I>&gt;\{ia32,intel64}\{vc8,vc9,vc_mt}\bin\tbbvars.sh</TT>
<DT>For csh (or compatibles):
<DD><TT>source &lt;<I>installdir</I>&gt;\{ia32,intel64}\{vc8,vc9,vc_mt}\bin\tbbvars.csh</TT>
<DT><I>Notes:</I>
<DD><I><SL>
<LI>Choose one of {ia32,intel64} depending on the architecture to be used.
<LI>Environment setup need only be performed once per shell window to be used.
<LI>Always source tbbvars.sh or tbbvars.csh rather than executing them directly.
</SL>
{<span style="font-family: Courier New">vc8,vc9,vc_mt</span>}
{<span style="font-family: Courier New">vc8,vc9,vc_mt</span>} depending on which
Microsoft* Visual Studio* </I>
</DL>
<A NAME=env_23><H4>To set up the environment (Linux* or Mac OS* X systems):</H4></A>
The environment may be set up, for a given type of shell window, by using one of the following commands:
<DL>
<DT>For sh, bash, ksh (or compatibles):
<DD>. &lt;<I>installdir</I>&gt;/bin/tbbvars.sh
<DT>For csh (or compatibles):
<DD>source &lt;<I>installdir</I>&gt;/bin/tbbvars.csh
<DT>For sh, bash, ksh (or compatibles), when using an alternate architecture or platform:
<DD>. &lt;<I>installdir</I>&gt;/{ia32,intel64,ia64}/cc&lt;<I>gccversion</I>&gt;_libc&lt;<I>libcversion</I>&gt;_kernel&lt;<I>kernelversion</I>&gt;/bin/tbbvars.sh
<DT>For csh (or compatibles), when using an alternate architecture or platform:
<DD>source &lt;<I>installdir</I>&gt;/{ia32,intel64,ia64}/cc&lt;<I>gccversion</I>&gt;_libc&lt;<I>libcversion</I>&gt;_kernel&lt;<I>kernelversion</I>&gt;/bin/tbbvars.csh
<DT><I>Notes:</I>
<DD><I><SL>
<LI>Choose one of {ia32,intel64,ia64} depending on the architecture to be used.
<LI>Choose a cc&lt;<I>gccversion</I>&gt;_libc&lt;<I>libcversion</I>&gt;_kernel&lt;<I>kernelversion</I>&gt;
value, from among the available platforms installed with Threading Building Blocks
(for <A HREF=../ia32>ia32</A>, <A HREF=../intel64>intel64</A> or <A HREF=../ia64>ia64</A>),
depending on the platform to be used.
<LI>Environment setup need only be performed once per shell window to be used.
<LI>Always source tbbvars.sh or tbbvars.csh rather than executing them directly.
</SL></I>
</DL>
<HR>
<A HREF="../index.html">Up to parent directory</A>
<p></p>
Copyright &copy; 2005-2010 Intel Corporation. All Rights Reserved.
<p></p>
Intel, Pentium, Intel Xeon, Itanium, Intel XScale and VTune are
registered trademarks or trademarks of Intel Corporation or its
subsidiaries in the United States and other countries.
<p></p>
* Other names and brands may be claimed as the property of others.
</BODY>
</HTML>