forked from opencb/hpg-aligner
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSConstruct
85 lines (68 loc) · 2.8 KB
/
SConstruct
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# Initialize the environment with path variables, CFLAGS, and so on
bioinfo_path = '#lib/hpg-libs/bioinfo-libs'
commons_path = '#lib/hpg-libs/common-libs'
#math_path = '#libs/math'
system_include = '/usr/include'
system_libs = '/usr/lib'
extrae_include = '/home/hmartinez/opt/extrae-2.5.1/include'
extrae_libs = '/home/hmartinez/opt/extrae-2.5.1/lib'
other_libs = '/home/hmartinez/opt/lib/'
other_include = '/home/hmartinez/opt/include/'
vars = Variables('buildvars.py')
compiler = ARGUMENTS.get('compiler', 'gcc')
env = Environment(tools = ['default', 'packaging'],
CC = compiler,
variables = vars,
CFLAGS = '-std=c99 -D_XOPEN_SOURCE=600 -D_GNU_SOURCE -fopenmp -D_REENTRANT',
CPPPATH = ['#', '#src', '#src/tools/bam', bioinfo_path, commons_path, "%s/commons/argtable" % commons_path, "%s/commons/config" % commons_path, system_include, '%s/libxml2' % system_include ],
LIBPATH = [commons_path, bioinfo_path, system_libs],
LIBS = ['xml2', 'm', 'z', 'curl', 'dl', 'bioinfo', 'common'],
LINKFLAGS = ['-fopenmp'])
if int(ARGUMENTS.get('debug', '0')) == 1:
debug = 1
env['CFLAGS'] += ' -O3 -g'
else:
debug = 0
env['CFLAGS'] += ' -O3'
if int(ARGUMENTS.get('verbose', '0')) == 1:
env['CFLAGS'] += ' -D_VERBOSE'
if int(ARGUMENTS.get('timing', '0')) == 1:
env['CFLAGS'] += ' -D_TIMING'
env['objects'] = []
# Targets
SConscript(['%s/SConscript' % bioinfo_path,
'%s/SConscript' % commons_path
], exports = ['env', 'debug', 'compiler'])
envprogram = env.Clone()
envprogram['CFLAGS'] += ' -DNODEBUG -mssse3 -DD_TIME_DEBUG'
bams = envprogram.Program('#bin/hpg-bam',
source = [Glob('src/tools/bam/*.c'),
Glob('src/tools/bam/aux/*.c'),
Glob('src/tools/bam/bfwork/*.c'),
Glob('src/tools/bam/recalibrate/*.c'),
Glob('src/tools/bam/aligner/*.c'),
"%s/libbioinfo.a" % bioinfo_path,
"%s/libcommon.a" % commons_path
]
)
aligner = envprogram.Program('#bin/hpg-aligner',
source = [Glob('src/*.c'),
Glob('src/tools/bam/aux/*.c'),
Glob('src/tools/bam/bfwork/*.c'),
Glob('src/tools/bam/recalibrate/*.c'),
Glob('src/tools/bam/aligner/*.c'),
Glob('src/build-index/*.c'),
Glob('src/dna/clasp_v1_1/*.c'),
Glob('src/dna/*.c'),
Glob('src/rna/*.c'),
Glob('src/bs/*.c'),
Glob('src/sa/*.c'),
"%s/libcommon.a" % commons_path,
"%s/libbioinfo.a" % bioinfo_path
]
)
Depends(aligner, bams)
'''
if 'debian' in COMMAND_LINE_TARGETS:
SConscript("deb/SConscript", exports = ['env'] )
'''