blob: 3fafbbf3f1a3f382c733fc3894c5a87781848ecb [file] [log] [blame]
Christophe Favergeona391d772021-02-10 10:56:33 +01001# Web UI for configuration of the CMSIS-DSP Build
2#
3# How to install
4# pip install streamlit
5#
6# How to use
Christophe Favergeon5bc9e872021-04-28 14:00:00 +02007# streamlit run cmsisdspconfig.py
Christophe Favergeona391d772021-02-10 10:56:33 +01008#
9import streamlit as st
10import textwrap
11import re
12
13
14st.set_page_config(page_title="CMSIS-DSP Configuration",layout="wide" )
15
16# Options requiring a special management
17NOTSTANDARD=["allTables","allInterpolations","allFFTs","Float16"]
18
19HELIUM=False
20
21config={}
22
Christophe Favergeon5bc9e872021-04-28 14:00:00 +020023# Used in UI
Christophe Favergeona391d772021-02-10 10:56:33 +010024config["allTables"] = True
25config["allFFTs"] = True
26config["allInterpolations"] = True
27config["MVEI"]=False
28config["MVEF"]=False
29config["NEON"]=False
30config["HELIUM"]=False
Christophe Favergeon74501362021-03-02 08:38:01 +010031config["HELIUMEXPERIMENTAL"]=False
Christophe Favergeona391d772021-02-10 10:56:33 +010032config["Float16"]=True
33config["HOST"]=False
34
35config["COS_F32"]=False
36config["COS_Q31"]=False
37config["COS_Q15"]=False
38config["SIN_F32"]=False
39config["SIN_Q31"]=False
40config["SIN_Q15"]=False
41config["SIN_COS_F32"]=False
42config["SIN_COS_Q31"]=False
43config["LMS_NORM_Q31"]=False
44config["LMS_NORM_Q15"]=False
45config["CMPLX_MAG_Q31"]=False
46config["CMPLX_MAG_Q15"]=False
47
Christophe Favergeon5bc9e872021-04-28 14:00:00 +020048config["CFFT_RADIX2_Q15"]=False
49config["CFFT_RADIX4_Q15"]=False
50config["CFFT_RADIX2_Q31"]=False
51config["CFFT_RADIX4_Q31"]=False
52
Christophe Favergeona391d772021-02-10 10:56:33 +010053config["BASICMATH"]=True
54config["COMPLEXMATH"]=True
55config["CONTROLLER"]=True
56config["FASTMATH"]=True
57config["FILTERING"]=True
58config["MATRIX"]=True
59config["STATISTICS"]=True
60config["SUPPORT"]=True
61config["TRANSFORM"]=True
62config["SVM"]=True
63config["BAYES"]=True
64config["DISTANCE"]=True
65config["INTERPOLATION"]=True
Christophe Favergeonaf1c54b2021-02-15 14:15:10 +010066config["QUATERNIONMATH"]=True
Christophe Favergeona391d772021-02-10 10:56:33 +010067
68config["LOOPUNROLL"]=True
69config["ROUNDING"]=False
70config["MATRIXCHECK"]=False
71config["AUTOVECTORIZE"] = False
72
Christophe Favergeon5bc9e872021-04-28 14:00:00 +020073# Used as options in command line
74# in case the UI option is worded differently
Christophe Favergeona391d772021-02-10 10:56:33 +010075realname={}
76realname["COS_F32"]="ARM_COS_F32"
77realname["COS_Q31"]="ARM_COS_Q31"
78realname["COS_Q15"]="ARM_COS_Q15"
79realname["SIN_F32"]="ARM_SIN_F32"
80realname["SIN_Q31"]="ARM_SIN_Q31"
81realname["SIN_Q15"]="ARM_SIN_Q15"
82realname["SIN_COS_F32"]="ARM_SIN_COS_F32"
83realname["SIN_COS_Q31"]="ARM_SIN_COS_Q31"
84realname["LMS_NORM_Q31"]="ARM_LMS_NORM_Q31"
85realname["LMS_NORM_Q15"]="ARM_LMS_NORM_Q15"
86realname["CMPLX_MAG_Q31"]="ARM_CMPLX_MAG_Q31"
87realname["CMPLX_MAG_Q15"]="ARM_CMPLX_MAG_Q15"
Christophe Favergeon5bc9e872021-04-28 14:00:00 +020088realname["CFFT_RADIX2_Q15"]="ARM_CFFT_RADIX2_Q15"
89realname["CFFT_RADIX4_Q15"]="ARM_CFFT_RADIX4_Q15"
90realname["CFFT_RADIX2_Q31"]="ARM_CFFT_RADIX2_Q31"
91realname["CFFT_RADIX4_Q31"]="ARM_CFFT_RADIX4_Q31"
Christophe Favergeona391d772021-02-10 10:56:33 +010092
93defaulton={}
94defaulton["LOOPUNROLL"]=True
95defaulton["BASICMATH"]=True
96defaulton["COMPLEXMATH"]=True
97defaulton["CONTROLLER"]=True
98defaulton["FASTMATH"]=True
99defaulton["FILTERING"]=True
100defaulton["MATRIX"]=True
101defaulton["STATISTICS"]=True
102defaulton["SUPPORT"]=True
103defaulton["TRANSFORM"]=True
104defaulton["SVM"]=True
105defaulton["BAYES"]=True
106defaulton["DISTANCE"]=True
107defaulton["INTERPOLATION"]=True
Christophe Favergeonaf1c54b2021-02-15 14:15:10 +0100108defaulton["QUATERNIONMATH"]=True
109
Christophe Favergeona391d772021-02-10 10:56:33 +0100110
111CFFTSIZE=[16,32,64,128,256,512,1024,2048,4096]
112CFFTDATATYPE=['F64','F32','F16','Q31','Q15']
113
114RFFTFASTSIZE=[32,64,128,256,512,1024,2048,4096]
115RFFTFASTDATATYPE=['F64','F32','F16']
116
117RFFTSIZE=[32,64,128,256,512,1024,2048,4096,8192]
118RFFTDATATYPE=['F32','Q31','Q15']
119
120DCTSIZE=[128,512,2048,8192]
121DCTDATATYPE=['F32','Q31','Q15']
122
123def joinit(iterable, delimiter):
124 # Intersperse a delimiter between element of a list
125 it = iter(iterable)
126 yield next(it)
127 for x in it:
128 yield delimiter
129 yield x
130
131def options(l):
132 return("".join(joinit(l," ")))
133
134def computeCmakeOptions(config):
135 global defaulton
136 cmake={}
137 if not config["allTables"]:
138 cmake["CONFIGTABLE"]=True
139 if config["allInterpolations"]:
140 cmake["ALLFAST"]=True
141 if config["allFFTs"]:
142 cmake["ALLFFT"]=True
143 if config["Float16"]:
144 cmake["FLOAT16"]=True
145 else:
146 cmake["DISABLEFLOAT16"]=True
147
148 for c in config:
149 if not (c in NOTSTANDARD):
150 if c in defaulton:
151 if not config[c]:
152 if c in realname:
153 cmake[realname[c]]=False
154 else:
155 cmake[c]=False
156 else:
157 if config[c]:
158 if c in realname:
159 cmake[realname[c]]=True
160 else:
161 cmake[c]=True
162 return cmake
163
164def removeDuplicates(l):
165 return list(dict.fromkeys(l))
166
167def genCMakeOptions(config):
168 r=[]
169 cmake = computeCmakeOptions(config)
170 for c in cmake:
171 if cmake[c]:
172 r.append("-D%s=ON" % c)
173 else:
174 r.append("-D%s=OFF" % c)
175 return(removeDuplicates(r),cmake)
176
177def test(cmake,s):
178 global defaulton
179 if s in defaulton and not (s in cmake):
180 return True
181 return(s in cmake and cmake[s])
182
183def cfftCF32Config(cmake,size):
184 result=[]
185 if test(cmake,"CFFT_F32_%d" % size):
186 a="-DARM_TABLE_TWIDDLECOEF_F32_%d" % size
187 if HELIUM:
188 b = "-DARM_TABLE_BITREVIDX_FXT_%d" % size
189 else:
190 b = "-DARM_TABLE_BITREVIDX_FLT_%d" % size
191 result=[a,b]
192 return(result)
193
194def cfftCF16Config(cmake,size):
195 result=[]
196 if test(cmake,"CFFT_F16_%d" % size):
197 result =["-DARM_TABLE_TWIDDLECOEF_F16_%d" % size]
198 result.append("-DARM_TABLE_BITREVIDX_FXT_%d" % size)
199 result.append("-DARM_TABLE_BITREVIDX_FLT_%d" % size)
200 return(result)
201
202def cfftCF64Config(cmake,size):
203 result=[]
204 if test(cmake,"CFFT_F64_%d" % size):
205 result =["-DARM_TABLE_TWIDDLECOEF_F64_%d" % size]
206 result.append("-DARM_TABLE_BITREVIDX_FLT64_%d" % size)
207 return(result)
208
209
210def cfftCFixedConfig(cmake,dt,size):
211 result=[]
212 if test(cmake,"CFFT_%s_%d" % (dt,size)):
213 a="-DARM_TABLE_TWIDDLECOEF_%s_%d" % (dt,size)
214 b = "-DARM_TABLE_BITREVIDX_FXT_%d" % size
215 result=[a,b]
216 return(result)
217
218def crfftFastCF64Config(cmake,size):
219 result=[]
220 s1 = size >> 1
221 if test(cmake,"RFFT_FAST_F64_%d" % size):
222 result =[]
223 result.append("-DARM_TABLE_TWIDDLECOEF_F64_%d" % s1)
224 result.append("-DARM_TABLE_BITREVIDX_FLT64_%d" % s1)
225 result.append("-DARM_TABLE_TWIDDLECOEF_RFFT_F64_%d" % size)
226 result.append("-DARM_TABLE_TWIDDLECOEF_F64_%d" % s1)
227
228 return(result)
229
230def crfftFastCF32Config(cmake,size):
231 result=[]
232 s1 = size >> 1
233 if test(cmake,"RFFT_FAST_F32_%d" % size):
234 result =[]
235 result.append("-DARM_TABLE_TWIDDLECOEF_F32_%d" % s1)
236 result.append("-DARM_TABLE_BITREVIDX_FLT_%d" % s1)
237 result.append("-DARM_TABLE_TWIDDLECOEF_RFFT_F32_%d" % size)
238
239 return(result)
240
241def crfftFastCF16Config(cmake,size):
242 result=[]
243 s1 = size >> 1
244 if test(cmake,"RFFT_FAST_F16_%d" % size):
245 result =[]
246 result.append("-DARM_TABLE_TWIDDLECOEF_F16_%d" % s1)
247 result.append("-DARM_TABLE_BITREVIDX_FLT_%d" % s1)
248 result.append("-DARM_TABLE_BITREVIDX_FXT_%d" % s1)
249 result.append("-DARM_TABLE_TWIDDLECOEF_RFFT_F16_%d" % size)
250
251 return(result)
252
253# Deprecated RFFT used in DCT
254def crfftF32Config(cmake,size):
255 result=[]
256 s1 = size >> 1
257 if test(cmake,"RFFT_FAST_F16_%d" % size):
258 result =[]
259 result.append("-DARM_TABLE_REALCOEF_F32")
260 result.append("-ARM_TABLE_BITREV_%d" % s1)
261 result.append("-ARM_TABLE_TWIDDLECOEF_F32_%d" % s1)
262
263 return(result)
264
265
266def crfftFixedConfig(cmake,dt,size):
267 result=[]
268 s1 = size >> 1
269 if test(cmake,"RFFT_%s_%d" % (dt,size)):
270 result =[]
271 result.append("-DARM_TABLE_REALCOEF_%s" % dt)
272 result.append("-DARM_TABLE_TWIDDLECOEF_%s_%d" % (dt,s1))
273 result.append("-DARM_TABLE_BITREVIDX_FXT_%d" % s1)
274
275 return(result)
276
277
278def dctConfig(cmake,dt,size):
279 result=[]
280 if test(cmake,"DCT4_%s_%d" % (dt,size)):
281 result =[]
282 result.append("-DARM_TABLE_DCT4_%s_%d" % (dt,size))
283 result.append("-DARM_TABLE_REALCOEF_F32")
284 result.append("-DARM_TABLE_BITREV_1024" )
285 result.append("-DARM_TABLE_TWIDDLECOEF_%s_4096" % dt)
286
287 return(result)
288
289# Convert cmake options to make flags
290def interpretCmakeOptions(cmake):
291 r=[]
292 if test(cmake,"CONFIGTABLE"):
293 r.append("-DARM_DSP_CONFIG_TABLES")
294 # In Make configuration we build all modules.
295 # So the code for FFT and FAST maths may be included
296 # so we allow the table to be included if they are needed.
297 r.append("-DARM_FAST_ALLOW_TABLES")
298 r.append("-DARM_FFT_ALLOW_TABLES")
299 for size in CFFTSIZE:
300 r += cfftCF32Config(cmake,size)
301 r += cfftCF16Config(cmake,size)
302 r += cfftCF64Config(cmake,size)
303 r += cfftCFixedConfig(cmake,"Q31",size)
304 r += cfftCFixedConfig(cmake,"Q15",size)
305
306 for size in RFFTFASTSIZE:
307 r += crfftFastCF64Config(cmake,size)
308 r += crfftFastCF32Config(cmake,size)
309 r += crfftFastCF16Config(cmake,size)
310
311 for size in RFFTSIZE:
312 r += crfftFixedConfig(cmake,"F32",size)
313 r += crfftFixedConfig(cmake,"Q31",size)
314 r += crfftFixedConfig(cmake,"Q15",size)
315
316 for size in DCTSIZE:
317 r += dctConfig(cmake,"F32",size)
318 r += dctConfig(cmake,"Q31",size)
319 r += dctConfig(cmake,"Q15",size)
320
321
322
323 if test(cmake,"ALLFAST"):
324 r.append("-DARM_ALL_FAST_TABLES")
325 if test(cmake,"ALLFFT"):
326 r.append("-DARM_ALL_FFT_TABLES")
327
328 if test(cmake,"LOOPUNROLL"):
329 r.append("-DARM_MATH_LOOPUNROLL")
330 if test(cmake,"ROUNDING"):
331 r.append("-DARM_MATH_ROUNDING")
332 if test(cmake,"MATRIXCHECK"):
333 r.append("-DARM_MATH_MATRIX_CHECK")
334 if test(cmake,"AUTOVECTORIZE"):
335 r.append("-DARM_MATH_AUTOVECTORIZE")
336 if test(cmake,"DISABLEFLOAT16"):
337 r.append("-DDISABLEFLOAT16")
338 if test(cmake,"NEON"):
339 r.append("-DARM_MATH_NEON")
340 r.append("-DARM_MATH_NEON_EXPERIMENTAL")
341 if test(cmake,"HOST"):
342 r.append("-D__GNUC_PYTHON__")
343
344 if test(cmake,"ARM_COS_F32"):
345 r.append("-DARM_TABLE_SIN_F32")
346 if test(cmake,"ARM_COS_Q31"):
347 r.append("-DARM_TABLE_SIN_Q31")
348 if test(cmake,"ARM_COS_Q15"):
349 r.append("-DARM_TABLE_SIN_Q15")
350
351 if test(cmake,"ARM_SIN_F32"):
352 r.append("-DARM_TABLE_SIN_F32")
353 if test(cmake,"ARM_SIN_Q31"):
354 r.append("-DARM_TABLE_SIN_Q31")
355 if test(cmake,"ARM_SIN_Q15"):
356 r.append("-DARM_TABLE_SIN_Q15")
357
358 if test(cmake,"ARM_SIN_COS_F32"):
359 r.append("-DARM_TABLE_SIN_F32")
360 if test(cmake,"ARM_SIN_COS_Q31"):
361 r.append("-DARM_TABLE_SIN_Q31")
362
363 if test(cmake,"ARM_LMS_NORM_Q31"):
364 r.append("-DARM_TABLE_RECIP_Q31")
365
366 if test(cmake,"ARM_LMS_NORM_Q15"):
367 r.append("-DARM_TABLE_RECIP_Q15")
368
369 if test(cmake,"ARM_CMPLX_MAG_Q31"):
370 r.append("-DARM_TABLE_FAST_SQRT_Q31_MVE")
371
372 if test(cmake,"ARM_CMPLX_MAG_Q15"):
373 r.append("-DARM_TABLE_FAST_SQRT_Q15_MVE")
374
375 if test(cmake,"MVEI"):
376 r.append("-DARM_MATH_MVEI")
377
378 if test(cmake,"MVEF"):
379 r.append("-DARM_MATH_MVEF")
380
Christophe Favergeon74501362021-03-02 08:38:01 +0100381 if test(cmake,"HELIUMEXPERIMENTAL"):
382 r.append("-DARM_MATH_HELIUM_EXPERIMENTAL")
383
Christophe Favergeona391d772021-02-10 10:56:33 +0100384 if test(cmake,"HELIUM") or test(cmake,"MVEF") or test(cmake,"MVEI"):
385 r.append("-IPrivateInclude")
386
387 if test(cmake,"NEON") or test(cmake,"NEONEXPERIMENTAL"):
388 r.append("-IComputeLibrary/Include")
389
Christophe Favergeon5bc9e872021-04-28 14:00:00 +0200390 if test(cmake,"ARM_CFFT_RADIX2_Q15") or test(cmake,"ARM_CFFT_RADIX4_Q15"):
391 r.append("-DARM_TABLE_TWIDDLECOEF_Q15_4096")
392 r.append("-DARM_TABLE_BITREV_1024")
393
394 if test(cmake,"ARM_CFFT_RADIX2_Q31") or test(cmake,"ARM_CFFT_RADIX4_Q31"):
395 r.append("-DARM_TABLE_TWIDDLECOEF_Q31_4096")
396 r.append("-DARM_TABLE_BITREV_1024")
397
Christophe Favergeona391d772021-02-10 10:56:33 +0100398 return (removeDuplicates(r))
399
400def genMakeOptions(config):
401 cmake = computeCmakeOptions(config)
402 r=interpretCmakeOptions(cmake)
403 return(r,cmake)
404
405
406def check(config,s,name=None,comment=None):
407 if comment is not None:
408 st.sidebar.text(comment)
409 if name is None:
410 config[s]=st.sidebar.checkbox(s,value=config[s])
411 else:
412 config[s]=st.sidebar.checkbox(name,value=config[s])
413 return(config[s])
414
415def genconfig(config,transform,sizes,datatypes):
416 global realname
417 for size in sizes:
418 for dt in datatypes:
419 s="%s_%s_%s" % (transform,dt,size)
420 config[s] = False
421 realname[s] = s
422
423def hasDCTF32(config):
424 result=False
425 for size in DCTSIZE:
426 s="DCT4_F32_%s" % size
427 if config[s]:
428 result = True
429 return(result)
430
431def multiselect(config,name,options):
432 default=[]
433 for r in options:
434 if config[r]:
435 default.append(r)
436 result=st.sidebar.multiselect(name,options,default=default)
437 for r in options:
438 config[r] = False
439 for r in result:
440 config[r] = True
441
442def genui(config,transform,sizes,datatypes):
443 keepF32 = True
444 # RFFT F32 is deprecated and needed only for DCT4
445 if transform == "RFFT":
446 keepF32 = hasDCTF32(config)
447 selected=st.sidebar.multiselect("Sizes",sizes)
448 for size in selected:
449 options=[]
450 for dt in datatypes:
451 if dt != "F32" or keepF32:
452 s="%s_%s_%s" % (transform,dt,size)
453 options.append(s)
454 multiselect(config,"Nb = %d" % size,options)
455
456
457def configMake(config):
458 st.sidebar.header('Table Configuration')
459 st.sidebar.info("Several options to include only the tables needed in an app and minimize code size.")
460 if not check(config,"allTables","All tables included"):
461
462 if not check(config,"allFFTs","All FFT tables included"):
463 st.sidebar.markdown("#### CFFT")
464 genui(config,"CFFT",CFFTSIZE,CFFTDATATYPE)
465
466 st.sidebar.info("Following transforms are using the CFFT. You need to enable the needed CFFTs above.")
467
468 st.sidebar.markdown("#### RFFT FAST")
469 genui(config,"RFFT_FAST",RFFTFASTSIZE,RFFTFASTDATATYPE)
470 st.sidebar.markdown("#### DCT4")
471 genui(config,"DCT4",DCTSIZE,DCTDATATYPE)
472 st.sidebar.markdown("#### RFFT")
473 genui(config,"RFFT",RFFTSIZE,RFFTDATATYPE)
Christophe Favergeon5bc9e872021-04-28 14:00:00 +0200474
475 st.sidebar.markdown("#### Radix2 and Radix4 CFFT")
476 st.sidebar.info("Those functions are deprecated")
477 multiselect(config,"Radix",["CFFT_RADIX2_Q15","CFFT_RADIX4_Q15","CFFT_RADIX2_Q31","CFFT_RADIX4_Q31"])
478
Christophe Favergeona391d772021-02-10 10:56:33 +0100479
480
481
482
483 if not check(config,"allInterpolations",'All interpolation tables included'):
484 selected=st.sidebar.multiselect("Functions",["Cosine","Sine","SineCosine","Normalized LMS"])
485 for s in selected:
486 if s == "Cosine":
487 multiselect(config,"Cosine",["COS_F32","COS_Q31","COS_Q15"])
488 if s == "Sine":
489 multiselect(config,"Sine",["SIN_F32","SIN_Q31","SIN_Q15"])
490 if s == "SineCosine":
491 multiselect(config,"SineCosine",["SIN_COS_F32","SIN_COS_Q31"])
492 if s == "Normalized LMS":
493 multiselect(config,"Normalized LMS",["LMS_NORM_Q31","LMS_NORM_Q15"])
494
495 if config["MVEI"]:
496 st.sidebar.markdown("#### Complex Magnitude")
497 multiselect(config,"Complex Magnitude",["CMPLX_MAG_Q31","CMPLX_MAG_Q15"])
498
499
500
501def configCMake(config):
502 multiselect(config,"Folders",["BASICMATH",
503 "COMPLEXMATH",
504 "CONTROLLER",
505 "FASTMATH",
506 "FILTERING",
507 "MATRIX",
508 "STATISTICS",
509 "SUPPORT",
510 "TRANSFORM",
511 "SVM",
512 "BAYES",
513 "DISTANCE",
Christophe Favergeonaf1c54b2021-02-15 14:15:10 +0100514 "INTERPOLATION","QUATERNIONMATH"])
Christophe Favergeona391d772021-02-10 10:56:33 +0100515 configMake(config)
516
517genconfig(config,"CFFT",CFFTSIZE,CFFTDATATYPE)
518genconfig(config,"RFFT_FAST",RFFTFASTSIZE,RFFTFASTDATATYPE)
519genconfig(config,"RFFT",RFFTSIZE,RFFTDATATYPE)
520genconfig(config,"DCT4",DCTSIZE,DCTDATATYPE)
521
522st.title('CMSIS-DSP Configuration')
523
524st.warning("It is a work in progress. Only a small subset of the combinations has been tested.")
525
526st.sidebar.header('Feature Configuration')
527st.sidebar.info("To build on host. All features will be enabled.")
528forHost=check(config,"HOST")
529
530if not forHost:
531 st.sidebar.info("Enable or disable float16 support")
532 check(config,"Float16")
533
534 st.sidebar.info("Some configurations for the CMSIS-DSP code.")
535 check(config,"LOOPUNROLL")
536 st.sidebar.text("Decrease performances when selected:")
537 check(config,"ROUNDING")
538 check(config,"MATRIXCHECK")
539
Christophe Favergeon74501362021-03-02 08:38:01 +0100540 st.sidebar.header('Vector extensions')
Christophe Favergeona391d772021-02-10 10:56:33 +0100541 st.sidebar.info("Enable vector code. It is not automatic for Neon. Use of Helium will enable new options to select some interpolation tables.")
542 archi=st.sidebar.selectbox("Vector",('None','Helium','Neon'))
543 if archi == 'Neon':
544 config["NEON"]=True
545 if archi == 'Helium':
546 multiselect(config,"MVE configuration",["MVEI","MVEF"])
547 HELIUM=True
Christophe Favergeon74501362021-03-02 08:38:01 +0100548 st.sidebar.info("When checked some experimental versions will be enabled and may be less performant than scalar version depending on the architecture.")
549 check(config,"HELIUMEXPERIMENTAL")
Christophe Favergeona391d772021-02-10 10:56:33 +0100550 if archi != 'None':
551 st.sidebar.info("When autovectorization is on, pure C code will be compiled. The version with C intrinsics won't be compiled.")
552 check(config,"AUTOVECTORIZE")
553
554
555
556st.sidebar.header('Build Method')
557
558st.sidebar.info("With cmake, some folders can be removed from the build.")
559selected=st.sidebar.selectbox('Select', ("Make","Cmake"),index=1)
560
561
562
563if selected == "Make":
564 if not forHost:
565 configMake(config)
566 result,cmake=genMakeOptions(config)
567else:
568 if not forHost:
569 configCMake(config)
570 result,cmake=genCMakeOptions(config)
571
572st.header('Build options for %s command line' % selected)
573
574if selected == "Make":
575 if test(cmake,"FLOAT16"):
576 st.info("Float16 is selected. You may need to pass compiler specific options for the compiler to recognize the float16 type.")
577
578mode=st.selectbox("Mode",["txt","MDK","sh","bat"])
579
580if mode=="txt":
581 st.code(textwrap.fill(options(result)))
582
583if mode=="MDK":
584 opts=options(result)
585 includes=""
586 maybeincludes=re.findall(r'\-I([^\s]+)',opts)
587 # Managed in MDK pack file
588 #if maybeincludes:
589 # includes = maybeincludes
590 # st.text("Following include directories must be added")
591 # st.code(includes)
592 opts=re.sub(r'\-D','',opts)
593 opts=re.sub(r'\-I[^\s]+','',opts)
594 st.text("MDK Preprocessor Symbols ")
595 st.code(opts)
596
597
598if mode=="sh":
599 lines=options(result).split()
600 txt=""
601 for l in lines:
602 txt += " %s \\\n" % l
603 txt += "\n"
604 st.code(txt)
605
606if mode=="bat":
607 lines=options(result).split()
608 txt=""
609 for l in lines:
610 txt += " %s ^\n" % l
611 txt += "\n"
612 st.code(txt)
613