blob: 142c7592d124007b1e3803598ec4cbb23f9aa04b [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"))
Christophe Favergeon116bc4d2020-08-06 11:00:40 +020037matrix.remove(os.path.join(ROOT,"Source","MatrixFunctions","MatrixFunctionsF16.c"))
Christophe Favergeon53f828f2019-03-25 13:42:44 +010038
39statistics = glob.glob(os.path.join(ROOT,"Source","StatisticsFunctions","*.c"))
40statistics.remove(os.path.join(ROOT,"Source","StatisticsFunctions","StatisticsFunctions.c"))
Christophe Favergeon18a5fbc2020-08-07 11:18:02 +020041statistics.remove(os.path.join(ROOT,"Source","StatisticsFunctions","StatisticsFunctionsF16.c"))
Christophe Favergeon53f828f2019-03-25 13:42:44 +010042
43complexf = glob.glob(os.path.join(ROOT,"Source","ComplexMathFunctions","*.c"))
44complexf.remove(os.path.join(ROOT,"Source","ComplexMathFunctions","ComplexMathFunctions.c"))
Christophe Favergeon626af7e2020-08-05 07:28:13 +020045complexf.remove(os.path.join(ROOT,"Source","ComplexMathFunctions","ComplexMathFunctionsF16.c"))
Christophe Favergeon53f828f2019-03-25 13:42:44 +010046
47basic = glob.glob(os.path.join(ROOT,"Source","BasicMathFunctions","*.c"))
48basic.remove(os.path.join(ROOT,"Source","BasicMathFunctions","BasicMathFunctions.c"))
Christophe Favergeon2f12ed82020-07-22 09:10:21 +020049basic.remove(os.path.join(ROOT,"Source","BasicMathFunctions","BasicMathFunctionsF16.c"))
Christophe Favergeon53f828f2019-03-25 13:42:44 +010050
51controller = glob.glob(os.path.join(ROOT,"Source","ControllerFunctions","*.c"))
52controller.remove(os.path.join(ROOT,"Source","ControllerFunctions","ControllerFunctions.c"))
53
Christophe Favergeon9e284082019-05-23 09:08:30 +020054common = glob.glob(os.path.join(ROOT,"Source","CommonTables","*.c"))
55common.remove(os.path.join(ROOT,"Source","CommonTables","CommonTables.c"))
Christophe Favergeon53f828f2019-03-25 13:42:44 +010056
Christophe Favergeon2f12ed82020-07-22 09:10:21 +020057interpolation = glob.glob(os.path.join(ROOT,"Source","InterpolationFunctions","*.c"))
58interpolation.remove(os.path.join(ROOT,"Source","InterpolationFunctions","InterpolationFunctions.c"))
Christophe Favergeonc7935882020-08-06 13:14:33 +020059interpolation.remove(os.path.join(ROOT,"Source","InterpolationFunctions","InterpolationFunctionsF16.c"))
Christophe Favergeon2f12ed82020-07-22 09:10:21 +020060
Christophe Favergeon9e284082019-05-23 09:08:30 +020061#modulesrc = glob.glob(os.path.join("cmsisdsp_pkg","src","*.c"))
62modulesrc = []
Christophe Favergeon9e284082019-05-23 09:08:30 +020063modulesrc.append(os.path.join("cmsisdsp_pkg","src","cmsismodule.c"))
Christophe Favergeon53f828f2019-03-25 13:42:44 +010064
65module1 = Extension(config.extensionName,
66 sources = (support
67 + fastmath
68 + filtering
69 + matrix
70 + statistics
71 + complexf
72 + basic
73 + controller
74 + transform
75 + modulesrc
Christophe Favergeon9e284082019-05-23 09:08:30 +020076 + common
Christophe Favergeon2f12ed82020-07-22 09:10:21 +020077 + interpolation
Christophe Favergeon53f828f2019-03-25 13:42:44 +010078 )
79 ,
80 include_dirs = includes + [numpy.get_include()],
81 #extra_compile_args = ["-Wno-unused-variable","-Wno-implicit-function-declaration",config.cflags]
82 extra_compile_args = cflags
83 )
84
85setup (name = config.setupName,
86 version = '0.0.1',
87 description = config.setupDescription,
88 ext_modules = [module1],
89 author = 'Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved.',
90 url="https://github.com/ARM-software/CMSIS_5",
91 classifiers=[
92 "Programming Language :: Python",
93 "License :: OSI Approved :: Apache Software License",
94 "Operating System :: OS Independent",
Chris Knorowski chris.knorowski@sensiml.com25124162019-08-19 12:37:17 -070095 ])