scoder / fastrlock

A fast RLock implementation for CPython
MIT License
23 stars 10 forks source link

from fastrlock cimport rlock failed with setup.py #3

Closed sonots closed 7 years ago

sonots commented 7 years ago

With setup.py

install_requires = [
    'fastrlock>=0.2',
]

and

from fastrlock cimport rlock

, I got a following error:

from fastrlock cimport rlock
^
------------------------------------------------------------

cupy/cuda/memory.pyx:11:0: 'fastrlock.pxd' not found
Traceback (most recent call last):
  File "setup.py", line 30, in <module>
    ext_modules = cupy_setup_build.get_ext_modules()
  File "/home/sonots/cupy/branch_fix_race_condition_memory_pool_fastrlock/cupy_setup_build.py", line 371, in get_ext_modules
    extensions = cythonize(extensions, arg_options)
  File "/home/sonots/cupy/branch_fix_race_condition_memory_pool_fastrlock/cupy_setup_build.py", line 342, in cythonize
    compiler_directives=directives, **cythonize_options)
  File "/home/sonots/.pyenv/versions/3.6.1/lib/python3.6/site-packages/Cython/Build/Dependencies.py", line 934, in cythonize
    cythonize_one(*args)
  File "/home/sonots/.pyenv/versions/3.6.1/lib/python3.6/site-packages/Cython/Build/Dependencies.py", line 1056, in cythonize_one
    raise CompileError(None, pyx_file)

although I found following works:

from fastrlock.rlock cimport create_fastrlock
from fastrlock.rlock cimport lock_fastrlock
from fastrlock.rlock cimport unlock_fastrlock

My python and cython version is as follows:

$ python --version
Python 3.6.1
$ cython --version
Cython version 0.25.2
sonots commented 7 years ago

Maybe, touch fastrlock/__init__.pxd is necessary?