Browse files

Document OpenMP in %%cython magic

  • Loading branch information...
1 parent bb2d35b commit 3e29bca52d3f25c324b07e28e337deb375f099a1 @bfroehle committed Dec 16, 2012
Showing with 9 additions and 3 deletions.
  1. +9 −3 IPython/extensions/cythonmagic.py
View
12 IPython/extensions/cythonmagic.py
@@ -158,9 +158,15 @@ def cython(self, line, cell):
namespace. The usage is similar to that of `%%cython_pyximport` but
you don't have to pass a module name::
- %%cython
- def f(x):
- return 2.0*x
+ %%cython
+ def f(x):
+ return 2.0*x
+
+ To compile OpenMP codes, pass the required `--compile-args`
+ and `--link-args`. For example with gcc::
+
+ %%cython --compile-args=-fopenmp --link-args=-fopenmp
+ ...
"""
args = magic_arguments.parse_argstring(self.cython, line)
code = cell if cell.endswith('\n') else cell+'\n'

0 comments on commit 3e29bca

Please sign in to comment.