blob: a8c707e50cd2318e7ac070e11d5b91e4e62edc63 [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"))
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
Christophe Favergeon9e284082019-05-23 09:08:30 +020048common = glob.glob(os.path.join(ROOT,"Source","CommonTables","*.c"))
49common.remove(os.path.join(ROOT,"Source","CommonTables","CommonTables.c"))
Christophe Favergeon53f828f2019-03-25 13:42:44 +010050
Christophe Favergeon9e284082019-05-23 09:08:30 +020051#modulesrc = glob.glob(os.path.join("cmsisdsp_pkg","src","*.c"))
52modulesrc = []
Christophe Favergeon9e284082019-05-23 09:08:30 +020053modulesrc.append(os.path.join("cmsisdsp_pkg","src","cmsismodule.c"))
Christophe Favergeon53f828f2019-03-25 13:42:44 +010054
55module1 = Extension(config.extensionName,
56 sources = (support
57 + fastmath
58 + filtering
59 + matrix
60 + statistics
61 + complexf
62 + basic
63 + controller
64 + transform
65 + modulesrc
Christophe Favergeon9e284082019-05-23 09:08:30 +020066 + common
Christophe Favergeon53f828f2019-03-25 13:42:44 +010067 )
68 ,
69 include_dirs = includes + [numpy.get_include()],
70 #extra_compile_args = ["-Wno-unused-variable","-Wno-implicit-function-declaration",config.cflags]
71 extra_compile_args = cflags
72 )
73
74setup (name = config.setupName,
75 version = '0.0.1',
76 description = config.setupDescription,
77 ext_modules = [module1],
78 author = 'Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved.',
79 url="https://github.com/ARM-software/CMSIS_5",
80 classifiers=[
81 "Programming Language :: Python",
82 "License :: OSI Approved :: Apache Software License",
83 "Operating System :: OS Independent",
Chris Knorowski chris.knorowski@sensiml.com25124162019-08-19 12:37:17 -070084 ])