title: Some standard C library math operations don't play nice with noGIL
body: <p>I have a pyx file containing the following code:</p>
  <pre><code>cimport cython
  from libc.math cimport sqrt, abs
  from libc.stdio cimport printf
  from cython.parallel import prange
  
  cdef double my_abs(double a):
      return sqrt(a*a)
  
  cpdef loop(int a):
      cdef int i
      cdef int sum = 0
      for i in prange(a, nogil=True):
          printf(&quot;%s %i %s %f\n&quot;, &quot;The square root of &quot;, i, &quot; is &quot;, sqrt(i))
          #printf(&quot;%s %i %s %f\n&quot;, &quot;The absolute value of &quot;, i, &quot; is &quot;, abs(i))
          #printf(&quot;%s %i %s %f\n&quot;, &quot;The absolute value of &quot;, i, &quot; is &quot;, my_abs(i))
      return
  </code></pre>
  <p>Which fails to compile when I uncomment either of the two lines within the loop.</p>
  <ol>
  <li>Why does the libc.math abs function not play nice with nogil when others like sqrt, pow etc seem to?</li>
  <li>What do I have to add to my function (and .pxd file) to make it nogil? I have tried adding following this page <a href="https://lbolla.info/python-threads-cython-gil" rel="nofollow noreferrer">https://lbolla.info/python-threads-cython-gil</a> but it still won't compile.</li>
  </ol>
  <p>This question is similar to:</p>
  <ul>
  <li><a href="https://stackoverflow.com/questions/48363425/cython-how-to-print-without-gil">Cython: How to print without GIL</a></li>
  <li><a href="https://stackoverflow.com/questions/33368628/which-c-functions-are-not-gil-requiring-in-cython">Which C functions are not gil-requiring in Cython?</a></li>
  </ul>
  <p>Thanks in advance!</p>