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
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
120fe47b
Commit
120fe47b
authored
Feb 23, 2014
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update C-library wrapping tutorial to use cythonize()
parent
fb863d29
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
7 deletions
+6
-7
docs/src/tutorial/clibraries.rst
docs/src/tutorial/clibraries.rst
+6
-7
No files found.
docs/src/tutorial/clibraries.rst
View file @
120fe47b
...
...
@@ -226,12 +226,11 @@ Here is the most basic script for compiling a Cython module::
from
distutils
.
core
import
setup
from
distutils
.
extension
import
Extension
from
Cython
.
Distutils
import
build_ext
from
Cython
.
Build
import
cythonize
setup
(
cmdclass
=
{
'build_ext'
:
build_ext
},
ext_modules
=
[
Extension
(
"queue"
,
[
"queue.pyx"
])]
)
ext_modules
=
cythonize
([
Extension
(
"queue"
,
[
"queue.pyx"
])])
)
To
build
against
the
external
C
library
,
we
must
extend
this
script
to
include
the
necessary
setup
.
Assuming
the
library
is
installed
in
the
...
...
@@ -240,16 +239,16 @@ Unix-like system), we could simply change the extension setup from
::
ext_modules
=
[
Extension
(
"queue"
,
[
"queue.pyx"
])]
ext_modules
=
cythonize
([
Extension
(
"queue"
,
[
"queue.pyx"
])])
to
::
ext_modules
=
[
ext_modules
=
cythonize
(
[
Extension
(
"queue"
,
[
"queue.pyx"
],
libraries
=[
"calg"
])
]
]
)
If
it
is
not
installed
in
a
'normal'
location
,
users
can
provide
the
required
parameters
externally
by
passing
appropriate
C
compiler
...
...
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