<?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 Two C programs in intel-cmt-cat utility (RDT) give compiler errors in Software Tuning, Performance Optimization &amp; Platform Monitoring</title>
    <link>https://community.intel.com/t5/Software-Tuning-Performance/Two-C-programs-in-intel-cmt-cat-utility-RDT-give-compiler-errors/m-p/1131741#M6412</link>
    <description>&lt;P&gt;I downloaded the intel-cmt-cat utility for Intel Resource Director Technology (RDT) from &lt;A href="https://github.com/intel/intel-cmt-cat" target="_blank"&gt;https://github.com/intel/intel-cmt-cat&lt;/A&gt;. For my project, I compile all 19 of the C programs in the /lib folder to object files only, then link them into my final project.&lt;/P&gt;&lt;P&gt;I cannot use the utility as a stand-alone executable because I am writing software for distribution to end users, and cache control is implemented as a call to an entry point in another program in my project. For that purpose, I altered the allocation_app_l3cat.c example so that the main program is renamed L3_main, and call that from my own program. Therefore, I'm not using the makefile because my use case is just to link in the object files.&lt;/P&gt;&lt;P&gt;Two of the 19 files distributed in the /lib folder -- allocation.c and cpuinfo.c -- give compiler errors (using Clang-8).&lt;/P&gt;&lt;P&gt;For allocation.c, the compiler string is:&lt;/P&gt;&lt;P&gt;sudo clang-8 -fPIC -c -o allocation.o allocation.c&lt;/P&gt;&lt;P&gt;and Clang generates these warnings:&lt;/P&gt;&lt;P&gt;allocation.c:1636:33: warning: expression result unused [-Wunused-value&lt;/P&gt;&lt;P&gt;ret = (m_cpu, mba_ids&lt;J&gt;,&lt;/J&gt;&lt;/P&gt;&lt;P&gt;allocation.c:1636:49: warning: expression result unused [-Wunused-value&lt;/P&gt;&lt;P&gt;ret = (m_cpu, mba_ids&lt;J&gt;,&lt;/J&gt;&lt;/P&gt;&lt;P&gt;allocation.c:1636:29: warning: incompatible pointer to integer conversi&lt;/P&gt;&lt;P&gt;assigning to 'int' from 'unsigned int *' [-Wint-conversion]&lt;/P&gt;&lt;P&gt;ret = (m_cpu, mba_ids&lt;J&gt;,&lt;/J&gt;&lt;/P&gt;&lt;P&gt;For cpuinfo.c, the compiler string is:&lt;/P&gt;&lt;P&gt;sudo clang-8 -fPIC -c -o cpuinfo.o cpuinfo.c&lt;/P&gt;&lt;P&gt;and Clang generates these warnings:&lt;/P&gt;&lt;P&gt;cpuinfo.c:117:16: warning: implicit declaration of function 'sched_setaffinity'&lt;/P&gt;&lt;P&gt;is invalid in C99 [-Wimplicit-function-declaration]&lt;/P&gt;&lt;P&gt;return sched_setaffinity(0, sizeof(*p_set), p_set);&lt;/P&gt;&lt;P&gt;cpuinfo.c:138:9: warning: implicit declaration of function 'CPU_ZERO' is invalid&lt;/P&gt;&lt;P&gt;in C99 [-Wimplicit-function-declaration]&lt;/P&gt;&lt;P&gt;CPU_ZERO(&amp;amp;cpuset);&lt;/P&gt;&lt;P&gt;cpuinfo.c:139:9: warning: implicit declaration of function 'CPU_SET' is invalid&lt;/P&gt;&lt;P&gt;in C99 [-Wimplicit-function-declaration]&lt;/P&gt;&lt;P&gt;CPU_SET(id, &amp;amp;cpuset);&lt;/P&gt;&lt;P&gt;cpuinfo.c:157:9: warning: implicit declaration of function 'CPU_ZERO' is invalid&lt;/P&gt;&lt;P&gt;in C99 [-Wimplicit-function-declaration]&lt;/P&gt;&lt;P&gt;CPU_ZERO(p_set);&lt;/P&gt;&lt;P&gt;cpuinfo.c:159:16: warning: implicit declaration of function 'sched_getaffinity'&lt;/P&gt;&lt;P&gt;is invalid in C99 [-Wimplicit-function-declaration]&lt;/P&gt;&lt;P&gt;return sched_getaffinity(0, sizeof(*p_set), p_set);&lt;/P&gt;&lt;P&gt;5 warnings generated.&lt;/P&gt;&lt;P&gt;_________&lt;/P&gt;&lt;P&gt;These warnings generate runtime errors -- e.g "undefined symbol: CPU_ZERO" -- and I don't know how to resolve them. For example, cpu_zero is defined in sched.h, which is an include file for cpuinfo.c, but I still get the warnings.&lt;/P&gt;&lt;P&gt;I am looking forward to using RDT, so I hope someone with experience in the intel-cmt-cat urility programs can help with this.&lt;/P&gt;&lt;P&gt;Thanks very much.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 25 Feb 2020 20:29:16 GMT</pubDate>
    <dc:creator>Jones__Brian</dc:creator>
    <dc:date>2020-02-25T20:29:16Z</dc:date>
    <item>
      <title>Two C programs in intel-cmt-cat utility (RDT) give compiler errors</title>
      <link>https://community.intel.com/t5/Software-Tuning-Performance/Two-C-programs-in-intel-cmt-cat-utility-RDT-give-compiler-errors/m-p/1131741#M6412</link>
      <description>&lt;P&gt;I downloaded the intel-cmt-cat utility for Intel Resource Director Technology (RDT) from &lt;A href="https://github.com/intel/intel-cmt-cat" target="_blank"&gt;https://github.com/intel/intel-cmt-cat&lt;/A&gt;. For my project, I compile all 19 of the C programs in the /lib folder to object files only, then link them into my final project.&lt;/P&gt;&lt;P&gt;I cannot use the utility as a stand-alone executable because I am writing software for distribution to end users, and cache control is implemented as a call to an entry point in another program in my project. For that purpose, I altered the allocation_app_l3cat.c example so that the main program is renamed L3_main, and call that from my own program. Therefore, I'm not using the makefile because my use case is just to link in the object files.&lt;/P&gt;&lt;P&gt;Two of the 19 files distributed in the /lib folder -- allocation.c and cpuinfo.c -- give compiler errors (using Clang-8).&lt;/P&gt;&lt;P&gt;For allocation.c, the compiler string is:&lt;/P&gt;&lt;P&gt;sudo clang-8 -fPIC -c -o allocation.o allocation.c&lt;/P&gt;&lt;P&gt;and Clang generates these warnings:&lt;/P&gt;&lt;P&gt;allocation.c:1636:33: warning: expression result unused [-Wunused-value&lt;/P&gt;&lt;P&gt;ret = (m_cpu, mba_ids&lt;J&gt;,&lt;/J&gt;&lt;/P&gt;&lt;P&gt;allocation.c:1636:49: warning: expression result unused [-Wunused-value&lt;/P&gt;&lt;P&gt;ret = (m_cpu, mba_ids&lt;J&gt;,&lt;/J&gt;&lt;/P&gt;&lt;P&gt;allocation.c:1636:29: warning: incompatible pointer to integer conversi&lt;/P&gt;&lt;P&gt;assigning to 'int' from 'unsigned int *' [-Wint-conversion]&lt;/P&gt;&lt;P&gt;ret = (m_cpu, mba_ids&lt;J&gt;,&lt;/J&gt;&lt;/P&gt;&lt;P&gt;For cpuinfo.c, the compiler string is:&lt;/P&gt;&lt;P&gt;sudo clang-8 -fPIC -c -o cpuinfo.o cpuinfo.c&lt;/P&gt;&lt;P&gt;and Clang generates these warnings:&lt;/P&gt;&lt;P&gt;cpuinfo.c:117:16: warning: implicit declaration of function 'sched_setaffinity'&lt;/P&gt;&lt;P&gt;is invalid in C99 [-Wimplicit-function-declaration]&lt;/P&gt;&lt;P&gt;return sched_setaffinity(0, sizeof(*p_set), p_set);&lt;/P&gt;&lt;P&gt;cpuinfo.c:138:9: warning: implicit declaration of function 'CPU_ZERO' is invalid&lt;/P&gt;&lt;P&gt;in C99 [-Wimplicit-function-declaration]&lt;/P&gt;&lt;P&gt;CPU_ZERO(&amp;amp;cpuset);&lt;/P&gt;&lt;P&gt;cpuinfo.c:139:9: warning: implicit declaration of function 'CPU_SET' is invalid&lt;/P&gt;&lt;P&gt;in C99 [-Wimplicit-function-declaration]&lt;/P&gt;&lt;P&gt;CPU_SET(id, &amp;amp;cpuset);&lt;/P&gt;&lt;P&gt;cpuinfo.c:157:9: warning: implicit declaration of function 'CPU_ZERO' is invalid&lt;/P&gt;&lt;P&gt;in C99 [-Wimplicit-function-declaration]&lt;/P&gt;&lt;P&gt;CPU_ZERO(p_set);&lt;/P&gt;&lt;P&gt;cpuinfo.c:159:16: warning: implicit declaration of function 'sched_getaffinity'&lt;/P&gt;&lt;P&gt;is invalid in C99 [-Wimplicit-function-declaration]&lt;/P&gt;&lt;P&gt;return sched_getaffinity(0, sizeof(*p_set), p_set);&lt;/P&gt;&lt;P&gt;5 warnings generated.&lt;/P&gt;&lt;P&gt;_________&lt;/P&gt;&lt;P&gt;These warnings generate runtime errors -- e.g "undefined symbol: CPU_ZERO" -- and I don't know how to resolve them. For example, cpu_zero is defined in sched.h, which is an include file for cpuinfo.c, but I still get the warnings.&lt;/P&gt;&lt;P&gt;I am looking forward to using RDT, so I hope someone with experience in the intel-cmt-cat urility programs can help with this.&lt;/P&gt;&lt;P&gt;Thanks very much.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Feb 2020 20:29:16 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Tuning-Performance/Two-C-programs-in-intel-cmt-cat-utility-RDT-give-compiler-errors/m-p/1131741#M6412</guid>
      <dc:creator>Jones__Brian</dc:creator>
      <dc:date>2020-02-25T20:29:16Z</dc:date>
    </item>
    <item>
      <title>Here's how I solved this</title>
      <link>https://community.intel.com/t5/Software-Tuning-Performance/Two-C-programs-in-intel-cmt-cat-utility-RDT-give-compiler-errors/m-p/1131742#M6413</link>
      <description>&lt;P&gt;Here's how I solved this problem:&lt;/P&gt;&lt;P&gt;(1) in cpuinfo.c, add #define _GNU_SOURCE at the top of the includes.&amp;nbsp;&lt;/P&gt;&lt;P&gt;(2) in the linker string, add "/usr/lib/x86_64-linux-gnu/libc.so" to static link to libc.so (I use ld for linking).&amp;nbsp;&lt;/P&gt;&lt;P&gt;(3) the warnings in allocation.c do not produce run-time errors, apparently because the error is that the "expression result unused."&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 14 Mar 2020 19:14:21 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Tuning-Performance/Two-C-programs-in-intel-cmt-cat-utility-RDT-give-compiler-errors/m-p/1131742#M6413</guid>
      <dc:creator>Jones__Brian</dc:creator>
      <dc:date>2020-03-14T19:14:21Z</dc:date>
    </item>
  </channel>
</rss>

