Commit d4987fc5 authored by Federico Allocati's avatar Federico Allocati
Browse files

Fixed defining of USE_SFERES and USE_TBB

parent fbf9c2b3
......@@ -6,24 +6,38 @@
Quick n dirty sferes2 detection
"""
import os, glob, types
from waflib.Configure import conf
def options(opt):
opt.add_option('--sferes', type='string', help='path to sferes2', dest='sferes')
opt.add_option('--sferes', type='string', help='path to sferes2', dest='sferes')
@conf
def check_sferes(conf):
if conf.options.sferes:
conf.env.INCLUDES_SFERES = [conf.options.sferes]
conf.env.LIBPATH_SFERES = [conf.options.sferes + '/build/default/sferes']
try:
res = conf.find_file('sferes/ea/ea.hpp', conf.env.INCLUDES_SFERES)
conf.define("USE_SFERES", 1)
except:
print 'SFERES not found'
return 1
def check_sferes(self, *k, **kw):
if self.options.sferes:
includes_sferes = [self.options.sferes]
libpath_sferes = [self.options.sferes + '/build/default/sferes']
else:
return
self.start_msg('Checking sferes includes')
try:
self.find_file('sferes/ea/ea.hpp', includes_sferes)
self.end_msg('ok')
except:
self.end_msg('not found', 'YELLOW')
return
self.start_msg('Checking sferes libs')
try:
self.find_file('libsferes2.a', libpath_sferes)
self.end_msg('ok')
except:
self.end_msg('not found', 'YELLOW')
return
self.env.STLIPATH_SFERES = libpath_sferes
self.env.STLIB_SFERES = ["libsferes2"]
self.env.INCLUDES_SFERES = includes_sferes
self.env.DEFINES_SFERES = ["USE_SFERES", "SFERES_FAST_DOMSORT"]
......@@ -6,29 +6,31 @@
Quick n dirty tbb detection
"""
import os, glob, types
from waflib.Configure import conf
def options(opt):
opt.add_option('--tbb', type='string', help='path to Intel TBB', dest='tbb')
opt.add_option('--tbb', type='string', help='path to Intel TBB', dest='tbb')
@conf
def check_tbb(conf):
conf.env.LIB_TBB = ['tbb']
if conf.options.tbb:
conf.env.INCLUDES_TBB = [conf.options.tbb + '/include']
conf.env.LIBPATH_TBB = [conf.options.tbb + '/lib']
else:
conf.env.INCLUDES_TBB = ['/usr/local/include',
'/usr/include']
conf.env.LIBPATH_TBB = ['/usr/local/lib/',
'/usr/lib']
try:
res = conf.find_file('tbb/parallel_for.h', conf.env.INCLUDES_TBB)
conf.define("USE_TBB", 1)
except:
print 'TBB not found'
def check_tbb(self, *k, **kw):
if self.options.tbb:
includes_tbb = [self.options.tbb + '/include']
libpath_tbb = [self.options.tbb + '/lib']
else:
includes_tbb = ['/usr/local/include', '/usr/include', '/opt/intel/tbb/include']
libpath_tbb = ['/usr/local/lib/', '/usr/lib', '/opt/intel/tbb/lib']
self.start_msg('Checking Intel Tbb includes')
try:
self.find_file('tbb/parallel_for.h', includes_tbb)
self.end_msg('ok')
except:
self.end_msg('not found', 'YELLOW')
return
self.env.LIBPATH_TBB = libpath_tbb
self.env.LIB_TBB = ['tbb']
self.env.INCLUDES_TBB = includes_tbb
self.env.DEFINES_TBB = ['USE_TBB']
......@@ -39,9 +39,9 @@ def configure(conf):
conf.load('compiler_c')
conf.load('eigen')
conf.load('tbb')
conf.load('mkl')
conf.load('sferes')
conf.load('openmp')
conf.load('mkl')
conf.load('xcode')
if conf.env.CXX_NAME in ["icc", "icpc"]:
......@@ -59,15 +59,10 @@ def configure(conf):
graph thread', min_version='1.39')
conf.check_eigen()
conf.check_tbb()
conf.check_sferes()
conf.check_openmp()
conf.check_mkl()
conf.check_sferes()
#conf.check_ode()
if conf.is_defined('USE_TBB'):
common_flags += " -DUSE_TBB"
if conf.is_defined('USE_SFERES'):
common_flags += " -DUSE_SFERES -DSFERES_FAST_DOMSORT"
if conf.env['CXXFLAGS_ODE']:
common_flags += ' ' + conf.env['CXXFLAGS_ODE']
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment