m2m模型翻译
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
1.4 KiB

6 months ago
  1. #!/usr/bin/env python3
  2. """
  3. Build the Cython demonstrations of low-level access to NumPy random
  4. Usage: python setup.py build_ext -i
  5. """
  6. from distutils.core import setup
  7. from os.path import dirname, join, abspath
  8. import numpy as np
  9. from Cython.Build import cythonize
  10. from numpy.distutils.misc_util import get_info
  11. from setuptools.extension import Extension
  12. path = dirname(__file__)
  13. src_dir = join(dirname(path), '..', 'src')
  14. defs = [('NPY_NO_DEPRECATED_API', 0)]
  15. inc_path = np.get_include()
  16. lib_path = [abspath(join(np.get_include(), '..', '..', 'random', 'lib'))]
  17. lib_path += get_info('npymath')['library_dirs']
  18. extending = Extension("extending",
  19. sources=[join('.', 'extending.pyx')],
  20. include_dirs=[
  21. np.get_include(),
  22. join(path, '..', '..')
  23. ],
  24. define_macros=defs,
  25. )
  26. distributions = Extension("extending_distributions",
  27. sources=[join('.', 'extending_distributions.pyx')],
  28. include_dirs=[inc_path],
  29. library_dirs=lib_path,
  30. libraries=['npyrandom', 'npymath'],
  31. define_macros=defs,
  32. )
  33. extensions = [extending, distributions]
  34. setup(
  35. ext_modules=cythonize(extensions)
  36. )