title: How to print something to the console from OpenMP source Code?
body: <p>I am modifying OpenMP source Code, and I want to make sure that it is indeed working.
  For example the following code:</p>
  
  <pre><code>#include "omp.h"
  
  int main()
  {
      int i=0;
      #pragma omp parallel for schedule(dynamic,4)
      for(i=0;i&lt;1000;++i)
      {
          int x = 4+i;
      }
  }
  </code></pre>
  
  <p>Should call __kmpc_dispatch_init_4()
  And I have verified this by using emit-llvm option in clang.</p>
  
  <p>To double check I added the following print statement:</p>
  
  <pre><code>void __kmpc_dispatch_init_4(ident_t *loc, kmp_int32 gtid,
                              enum sched_type schedule, kmp_int32 lb,
                              kmp_int32 ub, kmp_int32 st, kmp_int32 chunk) {
    KMP_DEBUG_ASSERT(__kmp_init_serial);
    printf("%s\n", "Hello OpenMP");
  
  #if OMPT_SUPPORT &amp;&amp; OMPT_OPTIONAL
    OMPT_STORE_RETURN_ADDRESS(gtid);
  #endif
    __kmp_dispatch_init&lt;kmp_int32&gt;(loc, gtid, schedule, lb, ub, st, chunk, true);
  }
  </code></pre>
  
  <p>But when I am compiling the code, I am not getting this output on terminal.</p>
  
  <p>I am compiling the code like this:</p>
  
  <pre><code>llvm_build/bin/clang sc.c  -L/usr/local/lib -fopenmp
  </code></pre>
  
  <p>And after building the openmp source code the output of <code>sudo make install</code> is this:</p>
  
  <pre><code>Install the project...
  -- Install configuration: "Release"
  -- Up-to-date: /usr/local/lib/libomp.so
  -- Up-to-date: /usr/local/include/omp.h
  -- Up-to-date: /usr/local/include/omp-tools.h
  -- Up-to-date: /usr/local/include/ompt.h
  -- Up-to-date: /usr/local/lib/libomptarget.so
  -- Up-to-date: /usr/local/lib/libomptarget.rtl.x86_64.so
  </code></pre>
  
  <p>To cross check if this is used I used:</p>
  
  <pre><code>ldd a.out
  </code></pre>
  
  <p>And the output is:</p>
  
  <pre><code>linux-vdso.so.1 (0x00007fff25bb6000)
      libomp.so =&gt; /usr/local/lib/libomp.so (0x00007f75a52c6000)
      libpthread.so.0 =&gt; /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f75a50a7000)
      libc.so.6 =&gt; /lib/x86_64-linux-gnu/libc.so.6 (0x00007f75a4cb6000)
      libdl.so.2 =&gt; /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f75a4ab2000)
      /lib64/ld-linux-x86-64.so.2 (0x00007f75a558a000)
  </code></pre>
  
  <p>So I am assuming it should be using the code that I have modified.
  But not able to see the output of the print statement.
  I have also tried using fprintf(stderr, ....)
  But doesn't work.</p>
  
  <p>Thank you in advance.</p>