mirror of
https://github.com/wassname/simpeg.git
synced 2026-10-29 13:40:11 +08:00
Cython dep. the setup.py
This commit is contained in:
1 parent
f6c5b011e8
commit
37a68dd5b7
3 files changed
+8487
-3
No files matched your search
@@ -38,5 +38,4 @@ nosetests.xml
|
||||
*.sublime-project
|
||||
*.sublime-workspace
|
||||
docs/_build/
|
||||
*_cython.c
|
||||
Makefile
|
||||
File diff suppressed because it is too large.
Load diff
@@ -7,7 +7,7 @@ parameter estimation in the context of geophysical applications.
|
||||
|
||||
from distutils.core import setup
|
||||
from setuptools import find_packages
|
||||
from Cython.Build import cythonize
|
||||
from distutils.extension import Extension
|
||||
import numpy as np
|
||||
|
||||
CLASSIFIERS = [
|
||||
@@ -26,6 +26,27 @@ CLASSIFIERS = [
|
||||
'Natural Language :: English',
|
||||
]
|
||||
|
||||
|
||||
from distutils.core import setup
|
||||
|
||||
try:
|
||||
from Cython.Build import cythonize
|
||||
USE_CYTHON = True
|
||||
except Exception, e:
|
||||
USE_CYTHON = False
|
||||
|
||||
ext = '.pyx' if USE_CYTHON else '.c'
|
||||
|
||||
cython_files = [
|
||||
"SimPEG/Utils/interputils_cython",
|
||||
"SimPEG/Mesh/TreeUtils"
|
||||
]
|
||||
extensions = [Extension(f, [f+ext]) for f in cython_files]
|
||||
|
||||
if USE_CYTHON:
|
||||
from Cython.Build import cythonize
|
||||
extensions = cythonize(extensions)
|
||||
|
||||
import os, os.path
|
||||
|
||||
with open("README.rst") as f:
|
||||
@@ -51,5 +72,5 @@ setup(
|
||||
platforms = ["Windows", "Linux", "Solaris", "Mac OS-X", "Unix"],
|
||||
use_2to3 = False,
|
||||
include_dirs=[np.get_include()],
|
||||
ext_modules = cythonize(['SimPEG/Utils/interputils_cython.pyx', 'SimPEG/Mesh/TreeUtils.pyx'])
|
||||
ext_modules = extensions
|
||||
)
|
||||
Reference in new issue
Block a user