I want to compile my python project with cython. I created this setup.py file :
from setuptools import setup, find_packages
from Cython.Build import cythonize
recursive_tree = [file for file in glob.iglob("sample/**/*.py", recursive=True)]
setup(
name = 'sample',
version = sample.__version__,
packages = find_packages(),
author = "42",
description = "Cython Sample",
include_package_data = True,
ext_modules = cythonize(
recursive_tree,
nthreads=2,
exclude="setup.py",
build_dir = "out",
),
)
In this thread, we can see it's possible to add some extra compile args, but can we do the opposite and remove one?
When I use this command :
python setup.py build_ext --inplace
I got this gcc configuration :
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/local/include/python3.6m -c out/sample/hello.c -o build/temp.linux-x86_64-3.6/out/sample/hello.o
gcc -pthread -shared build/temp.linux-x86_64-3.6/out/sample/hello.o -o build/lib.linux-x86_64-3.6/hello.cpython-36m-x86_64-linux-gnu.so
How can i remove the -g
option?