blob: 242f088ad932420b3853dd13523a6133b728eb94 [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
Christophe Favergeonaefd2772020-01-08 09:01:17 +01009includes = [os.path.join(ROOT,"Include"),os.path.join(ROOT,"PrivateInclude"),os.path.join("cmsisdsp_pkg","src")]
Christophe Favergeon53f828f2019-03-25 13:42:44 +010010
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:
Chris Knorowski chris.knorowski@sensiml.com25124162019-08-19 12:37:17 -070017 cflags = ["-Wno-unused-variable","-Wno-implicit-function-declaration",config.cflags,"-D__GNUC_PYTHON__"]
Christophe Favergeon53f828f2019-03-25 13:42:44 +010018
19transform = glob.glob(os.path.join(ROOT,"Source","TransformFunctions","*.c"))
Christophe Favergeon9e284082019-05-23 09:08:30 +020020#transform.remove(os.path.join(ROOT,"Source","TransformFunctions","arm_dct4_init_q15.c"))
21#transform.remove(os.path.join(ROOT,"Source","TransformFunctions","arm_rfft_init_q15.c"))
Christophe Favergeon53f828f2019-03-25 13:42:44 +010022transform.remove(os.path.join(ROOT,"Source","TransformFunctions","TransformFunctions.c"))
Christophe Favergeon2f12ed82020-07-22 09:10:21 +020023transform.remove(os.path.join(ROOT,"Source","TransformFunctions","TransformFunctionsF16.c"))
Christophe Favergeon53f828f2019-03-25 13:42:44 +010024
25support = glob.glob(os.path.join(ROOT,"Source","SupportFunctions","*.c"))
26support.remove(os.path.join(ROOT,"Source","SupportFunctions","SupportFunctions.c"))
27
28fastmath = glob.glob(os.path.join(ROOT,"Source","FastMathFunctions","*.c"))
29fastmath.remove(os.path.join(ROOT,"Source","FastMathFunctions","FastMathFunctions.c"))
30
31filtering = glob.glob(os.path.join(ROOT,"Source","FilteringFunctions","*.c"))
32filtering.remove(os.path.join(ROOT,"Source","FilteringFunctions","FilteringFunctions.c"))
33
34matrix = glob.glob(os.path.join(ROOT,"Source","MatrixFunctions","*.c"))
35matrix.remove(os.path.join(ROOT,"Source","MatrixFunctions","MatrixFunctions.c"))
36
37statistics = glob.glob(os.path.join(ROOT,"Source","StatisticsFunctions","*.c"))
38statistics.remove(os.path.join(ROOT,"Source","StatisticsFunctions","StatisticsFunctions.c"))
39
40complexf = glob.glob(os.path.join(ROOT,"Source","ComplexMathFunctions","*.c"))
41complexf.remove(os.path.join(ROOT,"Source","ComplexMathFunctions","ComplexMathFunctions.c"))
42
43basic = glob.glob(os.path.join(ROOT,"Source","BasicMathFunctions","*.c"))
44basic.remove(os.path.join(ROOT,"Source","BasicMathFunctions","BasicMathFunctions.c"))
Christophe Favergeon2f12ed82020-07-22 09:10:21 +020045basic.remove(os.path.join(ROOT,"Source","BasicMathFunctions","BasicMathFunctionsF16.c"))
Christophe Favergeon53f828f2019-03-25 13:42:44 +010046
47controller = glob.glob(os.path.join(ROOT,"Source","ControllerFunctions","*.c"))
48controller.remove(os.path.join(ROOT,"Source","ControllerFunctions","ControllerFunctions.c"))
49
Christophe Favergeon9e284082019-05-23 09:08:30 +020050common = glob.glob(os.path.join(ROOT,"Source","CommonTables","*.c"))
51common.remove(os.path.join(ROOT,"Source","CommonTables","CommonTables.c"))
Christophe Favergeon53f828f2019-03-25 13:42:44 +010052
Christophe Favergeon2f12ed82020-07-22 09:10:21 +020053interpolation = glob.glob(os.path.join(ROOT,"Source","InterpolationFunctions","*.c"))
54interpolation.remove(os.path.join(ROOT,"Source","InterpolationFunctions","InterpolationFunctions.c"))
55
56
Christophe Favergeon9e284082019-05-23 09:08:30 +020057#modulesrc = glob.glob(os.path.join("cmsisdsp_pkg","src","*.c"))
58modulesrc = []
Christophe Favergeon9e284082019-05-23 09:08:30 +020059modulesrc.append(os.path.join("cmsisdsp_pkg","src","cmsismodule.c"))
Christophe Favergeon53f828f2019-03-25 13:42:44 +010060
61module1 = Extension(config.extensionName,
62 sources = (support
63 + fastmath
64 + filtering
65 + matrix
66 + statistics
67 + complexf
68 + basic
69 + controller
70 + transform
71 + modulesrc
Christophe Favergeon9e284082019-05-23 09:08:30 +020072 + common
Christophe Favergeon2f12ed82020-07-22 09:10:21 +020073 + interpolation
Christophe Favergeon53f828f2019-03-25 13:42:44 +010074 )
75 ,
76 include_dirs = includes + [numpy.get_include()],
77 #extra_compile_args = ["-Wno-unused-variable","-Wno-implicit-function-declaration",config.cflags]
78 extra_compile_args = cflags
79 )
80
81setup (name = config.setupName,
82 version = '0.0.1',
83 description = config.setupDescription,
84 ext_modules = [module1],
85 author = 'Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved.',
86 url="https://github.com/ARM-software/CMSIS_5",
87 classifiers=[
88 "Programming Language :: Python",
89 "License :: OSI Approved :: Apache Software License",
90 "Operating System :: OS Independent",
Chris Knorowski chris.knorowski@sensiml.com25124162019-08-19 12:37:17 -070091 ])