A C++ template meta-programmable framework for authoring Pintools
See our Wiki for tutorials on using Pin++, or the list below for tutorial presentations:
The following is the minumum system requirements needed to build and use Pin++:
- Perl, on Windows we suggest ActivePerl
- [GIT] (http://git-scm.com/downloads)
- Pin (build 71313 or greater)
- Makefile, Project, Workspace Creator (master) from its GitHub repository.
To build the examples:
- C++11 compliant compiler
If you building only the Pin++ library, then you do not have to worry about the requirements for building the examples.
We have physically tested Pin++ with the following compilers:
- GCC 4.2*, 4.6*, 4.7, 4.8, 4.9
- Visual Studio 2008 (vc9)*, 2010 (vc10)*, 2012 (vc11)
* Does not support compiling the examples.
If a compiler you use is not on the list above and Pin++ compiles correctly, please let us know so we can update the list with the compiler you have tested and/or are using.
Set PIN_ROOT
environment variable to the location of Pin
since we will be building Pintools outside of the normal distribution
of Pin. We also assume that you have your PATH
(and LD_LIBRARY_PATH
or DYLD_LIBRARY_PATH
) configured correctly for Pin. Next, clone the
Pin++ repo and configure the environment variables:
Windows
set PINPP_ROOT=[location of Pin++]
set PATH=%PATH%;%PINPP_ROOT%\bin;%PINPP_ROOT%\lib
Linux
export PINPP_ROOT=[location of Pin++]
export PATH=$PATH:$PINPP_ROOT/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PINPP_ROOT/lib
MacOS X
export PINPP_ROOT=[location of Pin++]
export PATH=$PATH:$PINPP_ROOT/bin
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$PINPP_ROOT/lib
Generate the Pin++ workspace:
cd $PINPP_ROOT
$MPC_ROOT/mwc.pl -type [build type] -features pin=1,[ia32=0|1],intel64=[0|1] pin++.mwc
If you are building Pin++ for a 32-bit architecture, then select
ia32=1
. If you are building Pin++ for a 64-bit architecture,
then select intel64=1
. You can not set both features to 1, and
one must be set to 0.
Lastly, build the generated workspace. The Pin++ library (i.e., pin++[.a|.lib]
)
will be placed in $PINPP_ROOT/lib
.
The default compiler on MacOS X (distributed via XCode) can sometimes be an outdated version of GCC. If you need to use a newer version of GCC than what is provided when installing XCode, we recommend installing your version of choice via MacPorts.
To use the different version of GCC, make sure set the CC
and
CXX
macros to the corresponding version of gcc
and g++
that you want to you.
Here is an example:
make CC=gcc-mp-4.9 CXX=g++-mp-4.9
Thanks to Kenneth Miller for the suggestion.
When building the Pin++ examples, you must enable the C++11 feature cpp11=1
.
Here is the command-line for building the Pin++ library, and the examples:
$MPC_ROOT/mwc.pl -type [build type] -features pin=1,[ia32=0|1],intel64=[0|1],cpp11=1 pin++.mwc
If you do not have a C++11 compliant compiler, then you will get a LOT of compile and link errors build you try to build the workspace.
Send all questions to [email protected]. Please make
sure to include Pin++
in the subject.
Happy Coding!