Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segmentation Fault upon importing compiled Cython module #19

Open
aromanielloNTIA opened this issue Jul 27, 2020 · 1 comment
Open

Segmentation Fault upon importing compiled Cython module #19

aromanielloNTIA opened this issue Jul 27, 2020 · 1 comment

Comments

@aromanielloNTIA
Copy link

aromanielloNTIA commented Jul 27, 2020

Despite fixing the compile errors I mentioned before, I am still not having success using the Cython API (previous issue: #18)

Since I successfully compiled a .so module, I tried to run the cython_example.py script. This results in a simple but completely uninformative error message:

Segmentation fault (core dumped)

It seems that this error occurs while importing the module (and not when making calls to it after a successful import). As of now, I have no idea what is causing this error or how to fix it. Any input on that would be appreciated.

Thanks

Edit: For more information, I am trying to use the Cython API on Linux (Ubuntu)

@legodfrey
Copy link

legodfrey commented Apr 15, 2024

I managed to get the Cython version to compile and run, it looks like the following was missing:

setup.py:

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

setup(
    ext_modules=cythonize(
                [Extension('rsa_api',
                ['rsa_api.pyx'],
                libraries=['RSA_API', 'cyusb_shared'],
                include_dirs=['/usr/local/include', np.get_include()],
                library_dirs=['/usr/local/lib'])])

(note both libraries which were in the RSA_API are now included, and the dirs were updated to where I placed them)

Some of the example scripts still fail with assertions, but it at least imports!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants