Skip to content

Commit

Permalink
增加Linux下的编译脚本(build.py)支持
Browse files Browse the repository at this point in the history
  • Loading branch information
uingrd committed Feb 8, 2022
1 parent fbc4ca0 commit 7de0bb0
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 15 deletions.
23 changes: 15 additions & 8 deletions CONV/build.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
import platform,os
if platform.system()=='Darwin': # MacOS
os.system('clang fast_fir.c -Wall -c -o export_code/fast_fir.o -fno-stack-protector')
os.system('clang export_code/fast_fir.o -Wall -o export_code/test_fir')
os.system('export_code/test_fir')

import sys,os
os.system('clang fast_conv_1d.c -Wall -c -o export_code/fast_conv_1d.o -fno-stack-protector')
os.system('clang export_code/fast_conv_1d.o -Wall -o export_code/test_conv_1d')
os.system('export_code/test_conv_1d')
else:
os.system('gcc fast_fir.c -Wall -c -o export_code/fast_fir.o -fno-stack-protector')
os.system('gcc export_code/fast_fir.o -Wall -o export_code/test_fir')
os.system('export_code/test_fir')

os.system('clang fast_fir.c -Wall -c -o export_code/fast_fir.o -fno-stack-protector')
os.system('clang export_code/fast_fir.o -Wall -o export_code/test_fir')
os.system('export_code/test_fir')

os.system('clang fast_conv_1d.c -Wall -c -o export_code/fast_conv_1d.o -fno-stack-protector')
os.system('clang export_code/fast_conv_1d.o -Wall -o export_code/test_conv_1d')
os.system('export_code/test_conv_1d')
os.system('gcc fast_conv_1d.c -Wall -c -o export_code/fast_conv_1d.o -fno-stack-protector')
os.system('gcc export_code/fast_conv_1d.o -Wall -o export_code/test_conv_1d')
os.system('export_code/test_conv_1d')
18 changes: 11 additions & 7 deletions MCM/build.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@

import sys,os

os.system('clang float_shift.c -Wall -c -o export_code/float_shift.o -fno-stack-protector')
os.system('clang export_code/auto_code.c -Wall -c -o export_code/auto_code.o -fno-stack-protector')
os.system('clang export_code/float_shift.o export_code/auto_code.o -Wall -o export_code/test')
os.system('export_code/test')
import platform,os
if platform.system()=='Darwin': # MacOS
os.system('clang float_shift.c -Wall -c -o export_code/float_shift.o -fno-stack-protector')
os.system('clang export_code/auto_code.c -Wall -c -o export_code/auto_code.o -fno-stack-protector')
os.system('clang export_code/float_shift.o export_code/auto_code.o -Wall -o export_code/test')
os.system('export_code/test')
else:
os.system('gcc float_shift.c -Wall -c -o export_code/float_shift.o -fno-stack-protector')
os.system('gcc export_code/auto_code.c -Wall -c -o export_code/auto_code.o -fno-stack-protector')
os.system('gcc export_code/float_shift.o export_code/auto_code.o -Wall -o export_code/test')
os.system('export_code/test')

0 comments on commit 7de0bb0

Please sign in to comment.