Show More
@@ -115,7 +115,7 b' class CythonMagics(Magics):' | |||||
115 | help="Add a library to link the extension against (can be called multiple times)." |
|
115 | help="Add a library to link the extension against (can be called multiple times)." | |
116 | ) |
|
116 | ) | |
117 | @argument( |
|
117 | @argument( | |
118 |
'- |
|
118 | '-I', '--include', action='append', default=[], | |
119 | help="Add a path to the list of include directories (can be called multiple times)." |
|
119 | help="Add a path to the list of include directories (can be called multiple times)." | |
120 | ) |
|
120 | ) | |
121 | @argument( |
|
121 | @argument( |
@@ -205,13 +205,13 b'' | |||||
205 | { |
|
205 | { | |
206 | "cell_type": "markdown", |
|
206 | "cell_type": "markdown", | |
207 | "source": [ |
|
207 | "source": [ | |
208 |
"Cython allows you to specify additional libraries to be linked with your extension, you can do so with the `-l` flag (also spelled `--lib`). Note that this flag can be passed more than once to specify multiple libraries, such as `-l |
|
208 | "Cython allows you to specify additional libraries to be linked with your extension, you can do so with the `-l` flag (also spelled `--lib`). Note that this flag can be passed more than once to specify multiple libraries, such as `-lm -llib2 --lib lib3`. Here's a simple example of how to access the system math library:" | |
209 | ] |
|
209 | ] | |
210 | }, |
|
210 | }, | |
211 | { |
|
211 | { | |
212 | "cell_type": "code", |
|
212 | "cell_type": "code", | |
213 | "input": [ |
|
213 | "input": [ | |
214 |
"%%cython -l |
|
214 | "%%cython -lm\n", | |
215 | "from libc.math cimport sin\n", |
|
215 | "from libc.math cimport sin\n", | |
216 | "print 'sin(1)=', sin(1)" |
|
216 | "print 'sin(1)=', sin(1)" | |
217 | ], |
|
217 | ], | |
@@ -230,7 +230,7 b'' | |||||
230 | { |
|
230 | { | |
231 | "cell_type": "markdown", |
|
231 | "cell_type": "markdown", | |
232 | "source": [ |
|
232 | "source": [ | |
233 |
"You can similarly use the `- |
|
233 | "You can similarly use the `-I/--include` flag to add include directories to the search path, and `-c/--compile-args` to add extra flags that are passed to Cython via the `extra_compile_args` of the distutils `Extension` class. Please see [the Cython docs on C library usage](http://docs.cython.org/src/tutorial/clibraries.html) for more details on the use of these flags." | |
234 | ] |
|
234 | ] | |
235 | } |
|
235 | } | |
236 | ] |
|
236 | ] |
General Comments 0
You need to be logged in to leave comments.
Login now