Skip to content

Commit

Permalink
fix up demo code
Browse files Browse the repository at this point in the history
  • Loading branch information
scoder committed Oct 9, 2014
1 parent 91934c5 commit e505c27
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions Demos/libraries/setup.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
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.
Expand All @@ -12,20 +13,19 @@
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,
)

0 comments on commit e505c27

Please sign in to comment.