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 appended with "cpython-36m-x86_64-linux-gnu". For example, if I build "helloworld.pyx" the resulting .so file is called: "helloworld.cpython-36m-x86_64-linux-gnu.so". I however would just want it to be called "helloworld.so".
I thought the answer would be quite trivial, so I started googling, even after 30 minutes I could find nothing on the subject. Does anyone have any idea?
Here is my .pyx file:
print('hello world')
setup.py file:
from distutils.core import setup
from Cython.Build import cythonize
setup(
ext_modules = cythonize("helloworld.pyx")
)
building the file:
python setup.py build_ext --inplace
Compiling helloworld.pyx because it changed.
[1/1] Cythonizing helloworld.pyx
running build_ext
building 'helloworld' extension
gcc -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/**/anaconda3/include/python3.6m -c helloworld.c -o build/temp.linux-x86_64-3.6/helloworld.o
gcc -pthread -shared -L/home/**/anaconda3/lib -Wl,-rpath=/home/ed/anaconda3/lib,--no-as-needed build/temp.linux-x86_64-3.6/helloworld.o -L/home/**/anaconda3/lib -lpython3.6m -o /home/**/new_project/helloworld.cpython-36m-x86_64-linux-gnu.so
import helloworld
works just fine. You could try editing the file name after creation, or make a copy. But I just let it be. It doesn't get in the way for me. – Logorrheagcc
command from-o /home/paul/mypy/cython3/try_numpy/iterate.cpython-35m-i386-linux-gnu.so
to-o ./iterate.so
, changes the resulting.so
name. But I can't find of way of specifying that-o
option in thesetup
file. – Logorrhea