blob: bda98b5b068b69fc5599c5a4433e40cf75af1434 [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"))
Christophe Favergeon626af7e2020-08-05 07:28:13 +020033filtering.remove(os.path.join(ROOT,"Source","FilteringFunctions","FilteringFunctionsF16.c"))
Christophe Favergeon53f828f2019-03-25 13:42:44 +010034
35matrix = glob.glob(os.path.join(ROOT,"Source","MatrixFunctions","*.c"))
36matrix.remove(os.path.join(ROOT,"Source","MatrixFunctions","MatrixFunctions.c"))
37
38statistics = glob.glob(os.path.join(ROOT,"Source","StatisticsFunctions","*.c"))
39statistics.remove(os.path.join(ROOT,"Source","StatisticsFunctions","StatisticsFunctions.c"))
40
41complexf = glob.glob(os.path.join(ROOT,"Source","ComplexMathFunctions","*.c"))
42complexf.remove(os.path.join(ROOT,"Source","ComplexMathFunctions","ComplexMathFunctions.c"))
Christophe Favergeon626af7e2020-08-05 07:28:13 +020043complexf.remove(os.path.join(ROOT,"Source","ComplexMathFunctions","ComplexMathFunctionsF16.c"))
Christophe Favergeon53f828f2019-03-25 13:42:44 +010044
45basic = glob.glob(os.path.join(ROOT,"Source","BasicMathFunctions","*.c"))
46basic.remove(os.path.join(ROOT,"Source","BasicMathFunctions","BasicMathFunctions.c"))
Christophe Favergeon2f12ed82020-07-22 09:10:21 +020047basic.remove(os.path.join(ROOT,"Source","BasicMathFunctions","BasicMathFunctionsF16.c"))
Christophe Favergeon53f828f2019-03-25 13:42:44 +010048
49controller = glob.glob(os.path.join(ROOT,"Source","ControllerFunctions","*.c"))
50controller.remove(os.path.join(ROOT,"Source","ControllerFunctions","ControllerFunctions.c"))
51
Christophe Favergeon9e284082019-05-23 09:08:30 +020052common = glob.glob(os.path.join(ROOT,"Source","CommonTables","*.c"))
53common.remove(os.path.join(ROOT,"Source","CommonTables","CommonTables.c"))
Christophe Favergeon53f828f2019-03-25 13:42:44 +010054
Christophe Favergeon2f12ed82020-07-22 09:10:21 +020055interpolation = glob.glob(os.path.join(ROOT,"Source","InterpolationFunctions","*.c"))
56interpolation.remove(os.path.join(ROOT,"Source","InterpolationFunctions","InterpolationFunctions.c"))
57
58
Christophe Favergeon9e284082019-05-23 09:08:30 +020059#modulesrc = glob.glob(os.path.join("cmsisdsp_pkg","src","*.c"))
60modulesrc = []
Christophe Favergeon9e284082019-05-23 09:08:30 +020061modulesrc.append(os.path.join("cmsisdsp_pkg","src","cmsismodule.c"))
Christophe Favergeon53f828f2019-03-25 13:42:44 +010062
63module1 = Extension(config.extensionName,
64 sources = (support
65 + fastmath
66 + filtering
67 + matrix
68 + statistics
69 + complexf
70 + basic
71 + controller
72 + transform
73 + modulesrc
Christophe Favergeon9e284082019-05-23 09:08:30 +020074 + common
Christophe Favergeon2f12ed82020-07-22 09:10:21 +020075 + interpolation
Christophe Favergeon53f828f2019-03-25 13:42:44 +010076 )
77 ,
78 include_dirs = includes + [numpy.get_include()],
79 #extra_compile_args = ["-Wno-unused-variable","-Wno-implicit-function-declaration",config.cflags]
80 extra_compile_args = cflags
81 )
82
83setup (name = config.setupName,
84 version = '0.0.1',
85 description = config.setupDescription,
86 ext_modules = [module1],
87 author = 'Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved.',
88 url="https://github.com/ARM-software/CMSIS_5",
89 classifiers=[
90 "Programming Language :: Python",
91 "License :: OSI Approved :: Apache Software License",
92 "Operating System :: OS Independent",
Chris Knorowski chris.knorowski@sensiml.com25124162019-08-19 12:37:17 -070093 ])