Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Gwenaël Samain
cython
Commits
d4d2deb8
Commit
d4d2deb8
authored
May 24, 2013
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #234 from wichert/doc-compilation
Document cythonize accepts Extension arguments.
parents
9b4eb5fd
5e7c6d78
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
0 deletions
+41
-0
docs/src/reference/compilation.rst
docs/src/reference/compilation.rst
+41
-0
No files found.
docs/src/reference/compilation.rst
View file @
d4d2deb8
...
...
@@ -67,6 +67,47 @@ The ``cythonize`` command also allows for multi-threaded compilation and
dependency resolution. Recompilation will be skipped if the target file
is up to date with its main source file and dependencies.
If you have include files in non-standard places you can pass an
``include_path`` parameter to ``cythonize``::
from distutils.core import setup
from Cython.Build import cythonize
setup(
name = "My hello app",
ext_modules = cythonize("src/*.pyx", include_path = [...]),
)
If you need to specify compiler options, libraries to link with or other linker
options you will need to create ``Extension`` instances manually::
from distutils.core import setup
from distutils.extension import Extension
from Cython.Build import cythonize
extensions = [
Extension("primes", ["primes.pyx"],
include_dirs = [...],
libraries = [...],
library_dirs = [...]),
Extension("spam", ["spam.pyx"],
include_dirs = [...],
libraries = [...],
library_dirs = [...]),
]
setup(
name = "My hello app",
ext_modules = cythonize(extensions),
)
If your options are static (for example you do not need to call a tool like
``pkg-config`` to determine them) you can also provide them directly in your
.pyx source file using a special comment block at the start of the file::
# distutils: libraries = spam eggs
# distutils: include_dirs = /opt/food/include
Compiling with ``pyximport``
=============================
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment