wcb.py
Go to the documentation of this file.
1 # Aggregate all the waftools to make the main wscript a bit shorter.
2 # Note, this is specific to WC building
3 
4 import generic
5 import os.path as osp
6 mydir = osp.dirname(__file__)
7 
8 ## These are packages descriptions which fit the generic functions.
9 package_descriptions = dict(
10  ## These typically CAN be found by pkg-config
11  ZLib = dict(incs=['zlib.h'], libs=['z']),
12  FFTW = dict(incs=['fftw3.h'], libs=['fftw3f'], pcname='fftw3f'),
13  JsonCpp = dict(incs=["json/json.h"], libs=['jsoncpp']),
14  ## These can't always be found by pkg-config:
15  Eigen = dict(incs=["Eigen/Dense"]),
16  ## These likely can NOT be found by pkg-config:
17  Jsonnet = dict(incs=["libjsonnet++.h"], libs=['jsonnet++','jsonnet']),
18  TBB = dict(incs=["tbb/parallel_for.h"], libs=['tbb'], mandatory=False),
19 
20  # note, actually, pgk-config fails often. best to always use
21  # explicit --with-NAME.
22 )
23 
24 
25 def options(opt):
26 
27  # from here
28  opt.load('smplpkgs',tooldir=mydir)
29  opt.load('rootsys',tooldir=mydir)
30  opt.load('cuda',tooldir=mydir)
31  # opt.load('tbb',tooldir=mydir)
32 
33  for name in package_descriptions:
34  generic._options(opt, name)
35 
36  opt.add_option('--build-debug', default='-O2 -ggdb3',
37  help="Build with debug symbols")
38 
39 def configure(cfg):
40  print ('Compile options: %s' % cfg.options.build_debug)
41 
42  cfg.load('smplpkgs')
43 
44  for name, args in package_descriptions.items():
45  #print ("Configure: %s %s" % (name, args))
46  generic._configure(cfg, name, **args)
47  #print ("configured %s" % name)
48 
49  if cfg.options.with_cuda is False:
50  print ("sans CUDA")
51  else:
52  cfg.load('cuda')
53 
54  if cfg.options.with_root is False:
55  print ("sans ROOT")
56  else:
57  cfg.load('rootsys')
58  # cfg.load('tbb')
59  # boost is assumed built in to main waf/wcb program via
60  # ./waf-light --tools=doxygen,boost,bjam
61 
62 
def _configure(ctx, name, incs=(), libs=(), bins=(), pcname=None, mandatory=True)
Definition: generic.py:50
def configure(cfg)
Definition: cuda.py:34
def _options(opt, name)
Definition: generic.py:39