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