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
e505c27a
Commit
e505c27a
authored
Oct 09, 2014
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix up demo code
parent
91934c52
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
11 deletions
+11
-11
Demos/libraries/setup.py
Demos/libraries/setup.py
+11
-11
No files found.
Demos/libraries/setup.py
View file @
e505c27a
import
os
import
sys
from
distutils.core
import
setup
from
distutils.extension
import
Extension
from
Cython.
Distutils
import
build_ext
from
Cython.
Build
import
cythonize
# For demo purposes, we build our own tiny library.
...
...
@@ -12,20 +13,19 @@ try:
assert
os
.
system
(
"ar rcs libmymath.a mymath.o"
)
==
0
except
:
if
not
os
.
path
.
exists
(
"libmymath.a"
):
print
"Error building external library, please create libmymath.a manually."
print
(
"Error building external library, please create libmymath.a manually."
)
sys
.
exit
(
1
)
# Here is how to use the library built above.
ext_modules
=
[
ext_modules
=
cythonize
([
Extension
(
"call_mymath"
,
sources
=
[
"call_mymath.pyx"
],
include_dirs
=
[
os
.
getcwd
()],
# path to .h file(s)
library_dirs
=
[
os
.
getcwd
()],
# path to .a or .so file(s)
libraries
=
[
'mymath'
])
]
sources
=
[
"call_mymath.pyx"
],
include_dirs
=
[
os
.
getcwd
()],
# path to .h file(s)
library_dirs
=
[
os
.
getcwd
()],
# path to .a or .so file(s)
libraries
=
[
'mymath'
])
]
)
setup
(
name
=
'Demos'
,
cmdclass
=
{
'build_ext'
:
build_ext
},
ext_modules
=
ext_modules
,
name
=
'Demos'
,
ext_modules
=
ext_modules
,
)
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