wscript 2.37 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
        opt.add_option('--exp', type='string', help='exp(s) to build, separate by comma', dest='exp')
Jean-Baptiste Mouret's avatar
Jean-Baptiste Mouret committed
22
23
        opt.add_option('--qsub', type='string', help='config file (json) to submit to torque', dest='qsub')
        opt.add_option('--oar', type='string', help='config file (json) to submit to oar', dest='oar')
Jean-Baptiste Mouret's avatar
Jean-Baptiste Mouret committed
24
        opt.load('xcode')
25
26
27
        for i in glob.glob('exp/*'):
                opt.recurse(i)

28
29
30
31
32
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
33
        conf.load('sferes')
Jean-Baptiste Mouret's avatar
Jean-Baptiste Mouret committed
34
        conf.load('xcode')
35

36
37
38
39
	if int(conf.env['CC_VERSION'][0]+conf.env['CC_VERSION'][1])<47:
                common_flags = "-Wall -std=c++0x "
        else:
                common_flags = "-Wall -std=c++11 "
40
41

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

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

Jean-Baptiste Mouret's avatar
Jean-Baptiste Mouret committed
55
        opt_flags = common_flags + ' -O3 -msse2  -g'
56
57
58
        conf.env['CXXFLAGS'] = cxxflags + opt_flags.split(' ')
        print conf.env['CXXFLAGS']

Jean-Baptiste Mouret's avatar
misc    
Jean-Baptiste Mouret committed
59
60
61
62
63
64
        if conf.options.exp:
                for i in conf.options.exp.split(','):
                        print 'configuring for exp: ' + i
                        conf.recurse('exp/' + i)


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

74
75
76
77

def shutdown (ctx):
    if ctx.options.qsub:
        limbo.qsub(ctx.options.qsub)
Jean-Baptiste Mouret's avatar
Jean-Baptiste Mouret committed
78
79
80
    if ctx.options.oar:
        limbo.oar(ctx.options.oar)