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
Boxiang Sun
cython
Commits
2edd9045
Commit
2edd9045
authored
Dec 05, 2010
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
C++ cythonize test.
parent
bc01fbfd
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
2 deletions
+29
-2
Cython/Build/Dependencies.py
Cython/Build/Dependencies.py
+1
-1
Cython/Compiler/Main.py
Cython/Compiler/Main.py
+1
-1
tests/build/cpp_cythonize.srctree
tests/build/cpp_cythonize.srctree
+27
-0
No files found.
Cython/Build/Dependencies.py
View file @
2edd9045
...
@@ -426,7 +426,7 @@ def create_extension_list(patterns, ctx=None, aliases=None):
...
@@ -426,7 +426,7 @@ def create_extension_list(patterns, ctx=None, aliases=None):
def
cythonize
(
module_list
,
nthreads
=
0
,
aliases
=
None
,
**
options
):
def
cythonize
(
module_list
,
nthreads
=
0
,
aliases
=
None
,
**
options
):
c_options
=
CompilationOptions
(
options
)
c_options
=
CompilationOptions
(
options
)
cpp_options
=
CompilationOptions
(
options
);
cpp_options
.
cplus
=
True
cpp_options
=
CompilationOptions
(
options
);
cpp_options
.
cplus
=
True
ctx
=
options
.
create_context
()
ctx
=
c_
options
.
create_context
()
module_list
=
create_extension_list
(
module_list
,
ctx
=
ctx
,
aliases
=
aliases
)
module_list
=
create_extension_list
(
module_list
,
ctx
=
ctx
,
aliases
=
aliases
)
deps
=
create_dependency_tree
(
ctx
)
deps
=
create_dependency_tree
(
ctx
)
to_compile
=
[]
to_compile
=
[]
...
...
Cython/Compiler/Main.py
View file @
2edd9045
...
@@ -564,7 +564,7 @@ def create_default_resultobj(compilation_source, options):
...
@@ -564,7 +564,7 @@ def create_default_resultobj(compilation_source, options):
def
run_pipeline
(
source
,
options
,
full_module_name
=
None
):
def
run_pipeline
(
source
,
options
,
full_module_name
=
None
):
# Set up context
# Set up context
context
=
optons
.
create_context
()
context
=
opt
i
ons
.
create_context
()
# Set up source object
# Set up source object
cwd
=
os
.
getcwd
()
cwd
=
os
.
getcwd
()
...
...
tests/build/cpp_cythonize.srctree
0 → 100644
View file @
2edd9045
PYTHON setup.py build_ext --inplace
PYTHON -c "import a; a.use_vector([1,2,3])"
######## setup.py ########
from Cython.Build.Dependencies import cythonize
from distutils.core import setup
setup(
ext_modules = cythonize("*.pyx"),
)
######## a.pyx ########
# distutils: language = c++
from libcpp.vector cimport vector
def use_vector(L):
try:
v = new vector[int]()
for a in L:
v.push_back(a)
return v.size()
finally:
del v
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