dimanche 25 septembre 2016

Intel Pin with C++14

The Questions

I have a few questions surrounding usage of Intel Pin with C++14 or other C++ verions.

  • There are rarely any problems compiling code from older C++ with newer versions, but since Intel Pin is manipulates instruction level, is there any undesirable side effects that might come if I compile it with C++11 or C++14?
  • If it's ok to compile with C++11 or C++14, how do I make a rule to enable a newer version of C++ for my tool only?
  • How do I set GCC/G++ default C++ version to latest, and what should I keep in mind when doing so?

Situation

I'm building a dynamic call graph pin tool. To make it understandable, I'm computing the depth of the call stack. For safety, I decided to wrap the excerpt of code that increments or decrements the depth with a std::mutex. This has gotten me to the problem that std::mutex is available only since C++11, which is not Intel Pin default in my machine.

$ g++ -v
[...]
gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.2)

Compile command:

$ make obj-intel64/callgraph.so
[...]
error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
#error This file requires compiler and library support
[...]

Aucun commentaire:

Enregistrer un commentaire