python - Failure to build Cython module using distutils -


i trying build cython try call c functions python trying link cython c headers. when try use command build python

python setup.py build_ext --inplace 

it shows error:

 running build_ext building 'cython' extension /usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -g -dndebug -g -fwrapv -o3 -wall -wstrict-prototypes -i/library/frameworks/python.framework/versions/2.7/include/python2.7 -c cython.c -o build/temp.macosx-10.6-intel-2.7/cython.o cython.c:692:14: error: typedef redefinition different types ('void' vs       'struct _typeobject') typedef void pytypeobject;              ^ /library/frameworks/python.framework/versions/2.7/include/python2.7/object.h:411:3: note:        previous definition here } pytypeobject;   ^ 1 error generated. error: command '/usr/bin/clang' failed exit status 1 

edit: cython.pyx looks this:

 cdef extern "rnafoldenergy.h":     float dostuff(int maxw, char *sequence2, char *sequence3, float *freeenergy)    cpdef int dothings():     print "hello!"      cdef int maxw = 50      cdef float freeenergyarray[3]     freeenergyarray[:] = [0, 0, 0]     cdef char* sequence2 = "aaacattgaaaataagagtacatgaaggatatgaggaattcacaatggttgggcgaagagcaacagccattctaaggaaagcaaccagaagactgatccaactgatagtgagtgggaaag"     cdef char* sequence3 = "atccttcatgtactcttattttcaatgtttataaaagaggagaaatataaaatgtgaaaataaaacctggcggcagcgcaaaag"      cdef float interactenergy=0       interactenergy=dostuff(maxw=maxw, sequence2=sequence2, sequence3=sequence3, freeenergy=freeenergyarray)       print "a: %f, b: %f, ab: %f, interact: %f" % (freeenergyarray[0],freeenergyarray[1],freeenergyarray[2],interactenergy)      return 0 

i think it's because you've calling file "cython.pyx". can reproduce error file called "cython.pyx" if rename else don't line typedef void pytypeobject; , don't error.

it's bit of mystery why generates exact error, given there's module called "cython" (which you're using...) seems idea not call module same thing.


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -