eigen.py
Go to the documentation of this file.
1 import os
2 import os.path as osp
3 from waflib.Configure import conf
4 
5 def options(opt):
6  opt = opt.add_option_group('Eigen Options')
7  opt.add_option('--with-eigen', type='string',
8  help="give Eigen3 installation location")
9 
10 
11 @conf
12 def check_eigen(ctx, mandatory=True):
13  instdir = ctx.options.with_eigen
14 
15  if instdir is None or instdir.lower() in ['yes','true','on']:
16  ctx.start_msg('Checking for Eigen in PKG_CONFIG_PATH')
17  # note: Eigen puts its eigen3.pc file under share as there is
18  # no lib. Be sure your PKG_CONFIG_PATH reflects this.
19  ctx.check_cfg(package='eigen3', uselib_store='EIGEN', args='--cflags --libs', mandatory=mandatory)
20  elif instdir.lower() in ['no','off','false']:
21  return
22  else:
23  ctx.start_msg('Checking for Eigen in %s' % instdir)
24  ctx.env.INCLUDES_EIGEN = [ osp.join(instdir,'include/eigen3') ]
25 
26  ctx.check(header_name="Eigen/Dense", use='EIGEN', mandatory=mandatory)
27  if len(ctx.env.INCLUDES_EIGEN):
28  ctx.end_msg(ctx.env.INCLUDES_EIGEN[0])
29  else:
30  ctx.end_msg('Eigen3 not found')
31 
32 def configure(cfg):
33  cfg.check_eigen()
def check_eigen(ctx, mandatory=True)
Definition: eigen.py:12
def options(opt)
Definition: eigen.py:5
def configure(cfg)
Definition: eigen.py:32