from distutils.core import setup
from Cython.Build import cythonize
import numpy as np

# To compile run "python setup.py build_ext --inplace"

setup(name='pycocotools',
      packages=['pycocotools'],
      package_dir = {'pycocotools': 'pycocotools'},
      version='1.0.2',
      include_dirs = [np.get_include(), '../MatlabAPI/private'],
      ext_modules=
        cythonize('pycocotools/_mask.pyx'),
      )
@@ -61,16 +61,58 @@
 thonize%0A
+from distutils.extension import Extension%0A
 import n
@@ -136,16 +136,36 @@
 compile 
+and install locally 
 run %22pyt
@@ -197,16 +197,391 @@
 inplace%22
+%0A# To install library to Python site-packages run %22python setup.py build_ext install%22%0A%0Aext_modules = %5B%0A    Extension(%0A        'pycocotools._mask',%0A        sources=%5B'../MatlabAPI/private/maskApi.c', 'pycocotools/_mask.pyx'%5D,%0A        include_dirs = %5Bnp.get_include(), '../MatlabAPI/private'%5D,%0A        extra_compile_args=%5B'-Wno-cpp', '-Wno-unused-function', '-std=c99'%5D,%0A    )%0A%5D
 %0A%0Asetup(
@@ -711,73 +711,8 @@
 2',%0A
-      include_dirs = %5Bnp.get_include(), '../MatlabAPI/private'%5D,%0A
     
@@ -734,16 +734,18 @@
         
+  
 cythoniz
@@ -750,33 +750,20 @@
 ize(
-'pycocotools/_mask.pyx'),
+ext_modules)
 %0A   

add c99 flag for compilation