wscript 2.04 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
#!/usr/bin/env python
# encoding: utf-8

VERSION='0.0.1'
APPNAME='limbo'

srcdir = '.'
blddir = 'build'

import copy
11
import os, sys,glob
12
import limbo
13
14
15
16
17
18

def options(opt):
        opt.load('compiler_cxx boost waf_unit_test')
        opt.load('compiler_c')
        opt.load('eigen')
        opt.load('tbb')
Jean-Baptiste Mouret's avatar
Jean-Baptiste Mouret committed
19
        opt.load('sferes')
20
	opt.load('limbo')
21
22
23
24
        opt.add_option('--exp', type='string', help='exp(s) to build, separate by comma', dest='exp')
        for i in glob.glob('exp/*'):
                opt.recurse(i)

25
26
27
28
29
def configure(conf):
    	conf.load('compiler_cxx boost waf_unit_test')
        conf.load('compiler_c')
        conf.load('eigen')
        conf.load('tbb')
Jean-Baptiste Mouret's avatar
Jean-Baptiste Mouret committed
30
        conf.load('sferes')
31

32
33
34
35
36
37
        if conf.options.exp:
                for i in conf.options.exp.split(','):
                        print 'Building exp: ' + i
                        conf.recurse('exp/' + i)


38
	common_flags = "-Wall -std=c++11"
39
40

	cxxflags = conf.env['CXXFLAGS']
Jean-Baptiste Mouret's avatar
Jean-Baptiste Mouret committed
41
42
	conf.check_boost(lib='serialization timer filesystem \
            system unit_test_framework program_options \
43
            graph mpi thread',
Jean-Baptiste Mouret's avatar
Jean-Baptiste Mouret committed
44
            min_version='1.35')
45
46
        conf.check_eigen()
        conf.check_tbb()
Jean-Baptiste Mouret's avatar
Jean-Baptiste Mouret committed
47
        conf.check_sferes()
48
49
50
        if conf.is_defined('USE_TBB'):
                common_flags += " -DUSE_TBB "

Jean-Baptiste Mouret's avatar
Jean-Baptiste Mouret committed
51
        if conf.is_defined('USE_SFERES'):
Jean-Baptiste Mouret's avatar
Jean-Baptiste Mouret committed
52
                common_flags += " -DUSE_SFERES -DSFERES_FAST_DOMSORT"
Jean-Baptiste Mouret's avatar
Jean-Baptiste Mouret committed
53

54
	# release
55
        opt_flags = common_flags + ' -O3 -msse2 -ggdb3 -g'
56
57
58
59
60
61
62
        conf.env['CXXFLAGS'] = cxxflags + opt_flags.split(' ')
        print conf.env['CXXFLAGS']

def build(bld):
	bld.recurse('src/limbo')
        bld.recurse('src/examples')
        bld.recurse('src/tests')
Jean-Baptiste Mouret's avatar
Jean-Baptiste Mouret committed
63
        bld.recurse('src/benchmarks')
64
65
66
67
        if bld.options.exp:
                for i in bld.options.exp.split(','):
                        print 'Building exp: ' + i
                        bld.recurse('exp/' + i)
68
69
        from waflib.Tools import waf_unit_test
        bld.add_post_fun(waf_unit_test.summary)
70
71
72
73
74
	

def shutdown (ctx):
    if ctx.options.qsub:
        limbo.qsub(ctx.options.qsub)