title: Accessing GSL Library with Cython
body: <p>I am trying to use the GSL library in a Cython program but don't seem to have the paths correctly specified; I encounter the following error when I try writing a simple example:</p>
  
  <pre><code>%load_ext cythonmagic
  %%cython -lgsl -lgslcblas
  
  cdef extern from "gsl/gsl_ran_poisson_pdf.h":
      double gsl_ran_poisson_pdf(int x, double mu)
  
      def poison(int x, double mu):
          return gsl_ran_poisson_pdf(x,mu)
  
     /Users/name/.ipython/cython/_cython_magic_189673701925d12059c18b75663da8bd.c:317:10: fatal error: 
    'gsl/gsl_mode.h' file not found
    #include "gsl/gsl_mode.h"
  </code></pre>
  
  <p>I get the same error using CythonGSL and the demo program here: <a href="http://nbviewer.ipython.org/github/twiecki/CythonGSL/blob/master/examples/cython_gsl_ipythonnb.ipynb" rel="nofollow">http://nbviewer.ipython.org/github/twiecki/CythonGSL/blob/master/examples/cython_gsl_ipythonnb.ipynb</a></p>
  
  <p>The GSL libraries are located in the following directories:</p>
  
  <pre><code>-I/usr/local/include
  -L/usr/local/lib -lgsl
  </code></pre>
  
  <p>I know that similar questions have been asked on SO before, but I couldn't find one relevant to my situation and system (I'm using OS-X).  Any help would be appreciated.</p>
  
  <p>Thanks!</p>