title: Can't install Kivy: Cython/GCC error
body: <p>so I tried to install Kivy following the instructions from the official site:</p>
  
  <pre><code>$ sudo apt-get install python-setuptools python-pygame python-opengl \
    python-gst0.10 python-enchant gstreamer0.10-plugins-good python-dev \
    build-essential libgl1-mesa-dev libgles2-mesa-dev python-pip
  
  $ sudo pip install --upgrade cython
  
  $ sudo easy_install kivy
  </code></pre>
  
  <p>This is what I get:</p>
  
  <pre><code>Searching for kivy
  Reading http://pypi.python.org/simple/kivy/
  Best match: Kivy 1.4.1
  Downloading http://pypi.python.org/packages/source/K/Kivy/Kivy-1.4.1.tar.gz#md5=94bba894269e4bdecc7881f256367e01
  Processing Kivy-1.4.1.tar.gz
  Running Kivy-1.4.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-MMi2Fv/Kivy-1.4.1/egg-dist-tmp-EcKbfC
  [INFO   ] Kivy v1.4.1
  Found GLES 2.0 headers at /usr/include/GLES2/gl2.h
  Build configuration is:
   * use_opengl_es2  =  True
   * use_glew  =  False
   * use_opengl_debug  =  False
   * use_mesagl  =  False
  Generate config.h
  Generate config.pxi
  /tmp/easy_install-MMi2Fv/Kivy-1.4.1/kivy/graphics/transformation.c: In function ‘__pyx_f_4kivy_8graphics_14transformation_6Matrix_identity’:
  /tmp/easy_install-MMi2Fv/Kivy-1.4.1/kivy/graphics/transformation.c:2774:13: error: incompatible types when assigning to type ‘__pyx_t_4kivy_8graphics_14transformation_matrix_t’ from type ‘double *’
  /tmp/easy_install-MMi2Fv/Kivy-1.4.1/kivy/graphics/transformation.c: In function ‘__pyx_f_4kivy_8graphics_14transformation_6Matrix_inverse’:
  /tmp/easy_install-MMi2Fv/Kivy-1.4.1/kivy/graphics/transformation.c:2978:13: error: incompatible types when assigning to type ‘__pyx_t_4kivy_8graphics_14transformation_matrix_t’ from type ‘double *’
  /tmp/easy_install-MMi2Fv/Kivy-1.4.1/kivy/graphics/transformation.c:2980:13: error: incompatible types when assigning to type    ‘__pyx_t_4kivy_8graphics_14transformation_matrix_t’ from type ‘double *’
  /tmp/easy_install-MMi2Fv/Kivy-1.4.1/kivy/graphics/transformation.c: In function ‘__pyx_f_4kivy_8graphics_14transformation_6Matrix_multiply’:
  /tmp/easy_install-MMi2Fv/Kivy-1.4.1/kivy/graphics/transformation.c:3364:13: error: incompatible types when assigning to type ‘__pyx_t_4kivy_8graphics_14transformation_matrix_t’ from type ‘double *’
  /tmp/easy_install-MMi2Fv/Kivy-1.4.1/kivy/graphics/transformation.c:3366:13: error: incompatible types when assigning to type ‘__pyx_t_4kivy_8graphics_14transformation_matrix_t’ from type ‘double *’
  /tmp/easy_install-MMi2Fv/Kivy-1.4.1/kivy/graphics/transformation.c:3368:13: error: incompatible types when assigning to type ‘__pyx_t_4kivy_8graphics_14transformation_matrix_t’ from type ‘double *’
  /tmp/easy_install-MMi2Fv/Kivy-1.4.1/kivy/graphics/transformation.c: In function ‘__pyx_pf_4kivy_8graphics_14transformation_6Matrix_20__str__’:
  /tmp/easy_install-MMi2Fv/Kivy-1.4.1/kivy/graphics/transformation.c:3674:13: error: incompatible types when assigning to type ‘__pyx_t_4kivy_8graphics_14transformation_matrix_t’ from type ‘double *’
   error: Setup script exited with error: command 'gcc' failed with exit status 1
  </code></pre>
  
  <p>After failing to find an answer in the web I began to investigate the files which generated the error: transformation.c, transformation.pyx and transformation.pyd. I also read a little about Cython.</p>
  
  <p>Firstly, all errors are of the same kind:</p>
  
  <pre><code>error: incompatible types when assigning to type ‘__pyx_t_4kivy_8graphics_14transformation_matrix_t’ from type ‘double *’
  </code></pre>
  
  <p>The first error is raised here: </p>
  
  <pre><code>__pyx_t_3 = __pyx_v_self-&gt;mat;
  </code></pre>
  
  <p>The type of <strong>__pyx_t_3</strong> is:</p>
  
  <pre><code>__pyx_t_4kivy_8graphics_14transformation_matrix_t
  </code></pre>
  
  <p>It has this weird name because it was generated automatically from the  <strong>transformation.pxd</strong> file:</p>
  
  <pre><code>ctypedef double matrix_t[16]
  </code></pre>
  
  <p>So, type(<strong>__pyx_t_3</strong>) == type(matrix_t) == double *.</p>
  
  <p>The type of <strong>__pyx_v_self</strong> is:</p>
  
  <pre><code>struct __pyx_obj_4kivy_8graphics_14transformation_Matrix *
  </code></pre>
  
  <p>Again, it was generated from <strong>transformation.pxd</strong>:</p>
  
  <pre><code>ctypedef double matrix_t[16]
  
  cdef class Matrix:
      cdef matrix_t mat
      ...
  </code></pre>
  
  <p>Therefore, type(<strong>__pyx_v_self->mat</strong>) == type(Matrix.mat) == type(matrix_t) == double *</p>
  
  <p>As we can see, both sides of the assignment:</p>
  
  <pre><code>__pyx_t_3 = __pyx_v_self-&gt;mat;
  </code></pre>
  
  <p>are of (double *) type.</p>
  
  <p>Why is this error: </p>
  
  <pre><code>error: incompatible types when assigning to type ‘__pyx_t_4kivy_8graphics_14transformation_matrix_t’ from type ‘double *’
  </code></pre>
  
  <p>being raised then?</p>
  
  <p>It looks like the compiler is not recognizing the type of <strong>matrix_t</strong> as a double *.</p>