I tried to write a Cython wrapper around the C++ library http://primesieve.org/
It wraps a single function count
. So far, it installs correctly python setup.py install
, but when I import primesieve
the function primesieve.count
is missing. Any ideas?
primesieve.pxd (following http://docs.cython.org/src/tutorial/clibraries.html)
cdef extern from "stdint.h":
ctypedef unsigned long long uint64_t
cdef extern from "primesieve/include/primesieve.h":
uint64_t primesieve_count_primes(uint64_t start, uint64_t stop)
primesieve.pyx
cimport primesieve
cpdef int count(self, int n):
return primesieve.primesieve_count_primes(1, n)
setup.py
from setuptools import setup, Extension
from Cython.Build import cythonize
setup(
ext_modules = cythonize([Extension("*", ["primesieve.pyx"], include_dirs = ["primesieve/include"])])
)