setup.py 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. from distutils.core import setup, Extension
  2. import glob
  3. import numpy
  4. import config
  5. import sys
  6. import os
  7. from config import ROOT
  8. includes = [os.path.join("cmsisdsp_pkg","custom"),os.path.join("cmsisdsp_pkg","src")]
  9. if sys.platform == 'win32':
  10. cflags = ["-DWIN",config.cflags,"-DUNALIGNED_SUPPORT_DISABLE"]
  11. # Custom because a customized arm_math.h is required to build on windows
  12. # since the visual compiler and the win platform are
  13. # not supported by default in arm_math.h
  14. else:
  15. cflags = ["-Wno-unused-variable","-Wno-implicit-function-declaration",config.cflags]
  16. transform = glob.glob(os.path.join(ROOT,"Source","TransformFunctions","*.c"))
  17. transform.remove(os.path.join(ROOT,"Source","TransformFunctions","arm_dct4_init_q15.c"))
  18. transform.remove(os.path.join(ROOT,"Source","TransformFunctions","arm_rfft_init_q15.c"))
  19. transform.remove(os.path.join(ROOT,"Source","TransformFunctions","TransformFunctions.c"))
  20. support = glob.glob(os.path.join(ROOT,"Source","SupportFunctions","*.c"))
  21. support.remove(os.path.join(ROOT,"Source","SupportFunctions","SupportFunctions.c"))
  22. fastmath = glob.glob(os.path.join(ROOT,"Source","FastMathFunctions","*.c"))
  23. fastmath.remove(os.path.join(ROOT,"Source","FastMathFunctions","FastMathFunctions.c"))
  24. filtering = glob.glob(os.path.join(ROOT,"Source","FilteringFunctions","*.c"))
  25. filtering.remove(os.path.join(ROOT,"Source","FilteringFunctions","FilteringFunctions.c"))
  26. matrix = glob.glob(os.path.join(ROOT,"Source","MatrixFunctions","*.c"))
  27. matrix.remove(os.path.join(ROOT,"Source","MatrixFunctions","MatrixFunctions.c"))
  28. statistics = glob.glob(os.path.join(ROOT,"Source","StatisticsFunctions","*.c"))
  29. statistics.remove(os.path.join(ROOT,"Source","StatisticsFunctions","StatisticsFunctions.c"))
  30. complexf = glob.glob(os.path.join(ROOT,"Source","ComplexMathFunctions","*.c"))
  31. complexf.remove(os.path.join(ROOT,"Source","ComplexMathFunctions","ComplexMathFunctions.c"))
  32. basic = glob.glob(os.path.join(ROOT,"Source","BasicMathFunctions","*.c"))
  33. basic.remove(os.path.join(ROOT,"Source","BasicMathFunctions","BasicMathFunctions.c"))
  34. controller = glob.glob(os.path.join(ROOT,"Source","ControllerFunctions","*.c"))
  35. controller.remove(os.path.join(ROOT,"Source","ControllerFunctions","ControllerFunctions.c"))
  36. modulesrc = glob.glob(os.path.join("cmsisdsp_pkg","src","*.c"))
  37. module1 = Extension(config.extensionName,
  38. sources = (support
  39. + fastmath
  40. + filtering
  41. + matrix
  42. + statistics
  43. + complexf
  44. + basic
  45. + controller
  46. + transform
  47. + modulesrc
  48. )
  49. ,
  50. include_dirs = includes + [numpy.get_include()],
  51. #extra_compile_args = ["-Wno-unused-variable","-Wno-implicit-function-declaration",config.cflags]
  52. extra_compile_args = cflags
  53. )
  54. setup (name = config.setupName,
  55. version = '0.0.1',
  56. description = config.setupDescription,
  57. ext_modules = [module1],
  58. author = 'Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved.',
  59. url="https://github.com/ARM-software/CMSIS_5",
  60. classifiers=[
  61. "Programming Language :: Python",
  62. "License :: OSI Approved :: Apache Software License",
  63. "Operating System :: OS Independent",
  64. ])