cythonize Questions

3

Solved

Firstly, my thanks to all of you for trying to resolve this doubt of mine. I am working on converting a minimal C++ project to be used in Python. The real reason behind this effort is for speed. I ...
Slosh asked 24/9, 2017 at 9:51

1

I have used cythonize to compile my python modules. This way speed of code is increased and also the code can not be read by developers. However I have doubts if some python developer can crack tha...
Sublimity asked 25/2, 2022 at 16:56

2

Solved

Whenever I try to compile the simpleset cython example helloworld.pyx print "Hello World" setup.py from distutils.core import setup from Cython.Build import cythonize setup( ext_modules = cy...
Cattery asked 7/6, 2017 at 16:37

3

I'm working on a project to call C++ from Python. We use Cython for this purpose. When compile by using the command "python3.6 setup.py build_ext --inplace", the compiler "x86_64-linux-gnu-gcc" is ...
Monograph asked 23/7, 2019 at 22:11

3

Solved

I'm new to Cython, but got it working by following this basic guide from the official docs: All it says is: "Cython has a way to visualise where interaction with Python objects and Python’s C-...
Ard asked 8/7, 2019 at 4:37

1

Solved

I coerced Cython to use clang by specifying the CC environment variable: import os os.environ['CC'] = 'clang' I have a standard build: EXT_MODULES = [Extension('example.src.ex', sources=['example...
Frowsy asked 8/10, 2020 at 13:34

2

Solved

I would like to perform cython files compilation in parallel. So, I take a look at Cython.Build source file, and find the following signature for cythonize function: def cythonize(module_list, ex...
Hathaway asked 24/6, 2016 at 12:49

1

Solved

In a nutshell I try to compile a cython extension called extension2 that cimports a file extension from a self-created package. When building extension2, I get the error that extension.pxd is not...
Opinion asked 31/12, 2019 at 15:8

2

I am trying to make one unix executable file from my python source files. I have two file, p1.py and p2.py p1.py :- from p2 import test_func print (test_func()) p2.py :- def test_func(): re...
Publicist asked 24/10, 2018 at 1:28

1

Solved

In linux environment, when I run the setup script for cython, I get gcc -pthread -B /apps/.../compiler_compat -Wl,-sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPI...
Somite asked 15/7, 2019 at 20:31

2

I'm working with cython on the Ubuntu platform. Everything works fine, except there is one thing that annoys me. When compiling a cython project to a .so file, the filename of the .pyx file is appe...
Ambrosial asked 15/3, 2017 at 17:53

1

I am working with compiler directives for Cython (http://docs.cython.org/en/latest/src/reference/compilation.html#globally). $ cat temp.pyx # cython: language_level=3 print("abc", "def", sep=" ,")...
Enzymology asked 2/5, 2018 at 8:10

1

Solved

While cythonizing some PyQt5 code, I was encountering TypeError: method() takes exactly 1 positional argument (2 given). Strangely, replacing PyQt5 with PySide2 seems to not cause this behavior. I ...
Pangolin asked 18/4, 2019 at 1:3

1

I currently use 'setuptools' to automatically cythonize and compile my Cython modules on Linux using gcc. From now on, I need more control over the build flags supplied to gcc. If I use the followi...
Cam asked 25/6, 2018 at 8:21

2

I have build a Python 3 module for my own process. I use cython to compile and wrap C++ sources. I have a Linux (Debian Jessie) machine with Python 3.4 and so cythonize make me a Processing.cpyth...
Schrader asked 14/3, 2018 at 13:43

2

Solved

How should I use print in a Cython function with no gil? For example: from libc.math cimport log, fabs cpdef double f(double a, double b) nogil: cdef double c = log( fabs(a - b) ) print c retur...
Mitten asked 21/1, 2018 at 3:31

1

Solved

The following cimport cython @cython.boundscheck(False) def boundtest(): cdef int r=4 cdef double l[3] works fine. But when I try this: cimport cython @cython.boundscheck(False) def boundtest(...
Averse asked 19/9, 2017 at 17:41

1

Solved

I have a small helper function test containing sensitive code. To mask this code, I have written the function in hello.pyx and using it in my package mypackage. I am able to build and use it by m...
Recidivate asked 25/7, 2017 at 22:0

1

Solved

The SFML library that I'm trying to cythonize defines this function below that allows to change where errors are printed to (by default SFML writes error messages to the console when this function ...
Unbending asked 27/7, 2017 at 22:24

1

Solved

I have attempted to use the answer here to add the building of a cython extension into my package. It currently cythonizes the code to produce a .c file from the .pyx file but doesn't create a shar...
Jamboree asked 2/7, 2017 at 20:43

0

I have created a plugin for a software, this plugin is written in Python and I wish to distribute it in the form of a shared library (.so) for Mac OS (only). In my code I have a number of imports t...
Hibernia asked 9/2, 2017 at 23:15

1

I am trying to wrap some C++ classes and functions to Python using Cython. So far I have wrapped 2 classes, and now I want to wrap a function. The function's signature is std::map<std::string...
Danby asked 28/1, 2017 at 11:51

1

Solved

I've been playing around with Cython lately and I came across this error when applying a decorator to a Cython function Cdef functions/classes cannot take arbitrary decorators Here is the code I ...
Forfar asked 16/9, 2016 at 21:53
1

© 2022 - 2024 — McMap. All rights reserved.