<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Hi, in Software Tuning, Performance Optimization &amp; Platform Monitoring</title>
    <link>https://community.intel.com/t5/Software-Tuning-Performance/Intel-PCM-APIs-Question/m-p/1098210#M5791</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;the latest version of PCM also needs&amp;nbsp;&amp;nbsp;-std=c++0x option. For all other options you can consult the PCM Makefile.&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;

&lt;P&gt;Roman&lt;/P&gt;</description>
    <pubDate>Mon, 07 Dec 2015 12:37:36 GMT</pubDate>
    <dc:creator>Roman_D_Intel</dc:creator>
    <dc:date>2015-12-07T12:37:36Z</dc:date>
    <item>
      <title>Intel PCM APIs Question</title>
      <link>https://community.intel.com/t5/Software-Tuning-Performance/Intel-PCM-APIs-Question/m-p/1098209#M5790</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I am a new user of Intel PCM tool. When I was trying to use PCM APIs in my c++ application, I kinda stuck at the very beginning. I think the error might be caused by failing of linking libraries or including headers. But I just followed the example given by PCM articles... Here is what I did and got...&lt;/P&gt;

&lt;P&gt;I just faked a very simple example (test.cc):&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;#include "cpucounters.h"

void main(){
  PCM * m = PCM::getInstance();
  PCM::ErrorCode returnResult = m-&amp;gt;program();
  if (returnResult != PCM::Success){
     std::cerr &amp;lt;&amp;lt; "Intel's PCM couldn't start" &amp;lt;&amp;lt; std::endl;
     std::cerr &amp;lt;&amp;lt; "Error code: " &amp;lt;&amp;lt; returnResult &amp;lt;&amp;lt; std::endl;
     exit(1);
  }

  SystemCounterState before_sstate = getSystemCounterState();

  SystemCounterState after_sstate = getSystemCounterState();

  std::cout &amp;lt;&amp;lt; "Instructions per clock:" &amp;lt;&amp;lt; getIPC(before_sstate,after_sstate) &amp;lt;&amp;lt; std::endl;
  std::cout &amp;lt;&amp;lt; "Bytes read:" &amp;lt;&amp;lt; getBytesReadFromMC(before_sstate,after_sstate) &amp;lt;cleanup();
}&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Then I did the compilation work by:&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;PRE class="brush:bash;"&gt;g++ -I. cpucounters.o msr.o pci.o test.cc&lt;/PRE&gt;

&lt;P&gt;Since I put the file test.cc in the root directory of PCM, I did not put any prefix before object files. When I compile, I got errors as below:&lt;/P&gt;

&lt;PRE class="brush:bash;"&gt;In file included from cpucounters.h:34,
                 from test.cc:1:
msr.h:67: error: ISO C++ forbids declaration of ‘shared_ptr’ with no type
msr.h:67: error: invalid use of ‘::’
msr.h:67: error: expected ‘;’ before ‘&amp;lt;’ token
msr.h: In constructor ‘SafeMsrHandle::SafeMsrHandle(uint32)’:
msr.h:76: error: class ‘SafeMsrHandle’ does not have any field named ‘pHandle’
msr.h: In member function ‘int32 SafeMsrHandle::read(uint64, uint64*)’:
msr.h:82: error: ‘pHandle’ was not declared in this scope
msr.h: In member function ‘int32 SafeMsrHandle::write(uint64, uint64)’:
msr.h:92: error: ‘pHandle’ was not declared in this scope
msr.h: In member function ‘int32 SafeMsrHandle::getCoreId()’:
msr.h:99: error: ‘pHandle’ was not declared in this scope
In file included from cpucounters.h:37,
                 from test.cc:1:
width_extender.h: At global scope:
width_extender.h:54: error: ISO C++ forbids declaration of ‘shared_ptr’ with no type
width_extender.h:54: error: invalid use of ‘::’
width_extender.h:54: error: expected ‘;’ before ‘&amp;lt;’ token
width_extender.h:56: error: expected ‘)’ before ‘&amp;lt;’ token
width_extender.h:67: error: ISO C++ forbids declaration of ‘shared_ptr’ with no type
width_extender.h:67: error: invalid use of ‘::’
.......&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Can anyone help me with this? Thanks.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Dec 2015 10:00:13 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Tuning-Performance/Intel-PCM-APIs-Question/m-p/1098209#M5790</guid>
      <dc:creator>Spivoler</dc:creator>
      <dc:date>2015-12-07T10:00:13Z</dc:date>
    </item>
    <item>
      <title>Hi,</title>
      <link>https://community.intel.com/t5/Software-Tuning-Performance/Intel-PCM-APIs-Question/m-p/1098210#M5791</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;the latest version of PCM also needs&amp;nbsp;&amp;nbsp;-std=c++0x option. For all other options you can consult the PCM Makefile.&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;

&lt;P&gt;Roman&lt;/P&gt;</description>
      <pubDate>Mon, 07 Dec 2015 12:37:36 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Tuning-Performance/Intel-PCM-APIs-Question/m-p/1098210#M5791</guid>
      <dc:creator>Roman_D_Intel</dc:creator>
      <dc:date>2015-12-07T12:37:36Z</dc:date>
    </item>
    <item>
      <title>Quote:Roman Dementiev (Intel)</title>
      <link>https://community.intel.com/t5/Software-Tuning-Performance/Intel-PCM-APIs-Question/m-p/1098211#M5792</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;Roman Dementiev (Intel) wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;the latest version of PCM also needs&amp;nbsp;&amp;nbsp;-std=c++0x option. For all other options you can consult the PCM Makefile.&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;

&lt;P&gt;Roman&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;Thanks, Roman. I will try that out and other details in Makefile.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Dec 2015 21:51:23 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Tuning-Performance/Intel-PCM-APIs-Question/m-p/1098211#M5792</guid>
      <dc:creator>Spivoler</dc:creator>
      <dc:date>2015-12-10T21:51:23Z</dc:date>
    </item>
  </channel>
</rss>

