Commit a991cfe3 authored by Jean-Baptiste Mouret's avatar Jean-Baptiste Mouret
Browse files

improve support for OSX

parent 083a546c
......@@ -85,18 +85,18 @@ struct Params {
};
struct DirectParams {
struct opt_nloptnograd {
struct opt_nloptnograd : public defaults::opt_nloptnograd {
BO_DYN_PARAM(int, iterations);
};
};
struct BobyqaParams {
struct opt_nloptnograd {
struct BobyqaParams{
struct opt_nloptnograd : public defaults::opt_nloptnograd {
BO_DYN_PARAM(int, iterations);
};
};
struct BobyqaParams_HP {
struct opt_nloptnograd {
struct opt_nloptnograd : public defaults::opt_nloptnograd {
BO_DYN_PARAM(int, iterations);
};
};
......
......@@ -81,13 +81,13 @@ struct Params {
};
struct DirectParams {
struct opt_nloptnograd {
struct opt_nloptnograd : public defaults::opt_nloptnograd {
BO_DYN_PARAM(int, iterations);
};
};
struct BobyqaParams {
struct opt_nloptnograd {
struct opt_nloptnograd : public defaults::opt_nloptnograd {
BO_DYN_PARAM(int, iterations);
};
};
......
......@@ -70,6 +70,15 @@ def add_create_options(opt):
opt.add_option('--init_randomsampling_samples', type='int', dest='init_randomsampling_samples', help='Number of samples used for the initialization [default: 10]')
opt.add_option('--stop_maxiterations_iterations', type='int', dest='stop_maxiterations_iterations', help='Number of iterations performed before stopping the optimization [default: 190]')
# check if a lib exists for both osx (darwin) and GNU/linux
def check_lib(self, name, path):
if self.env['DEST_OS']=='darwin':
libname = name + '.dylib'
else:
libname = name + '.so'
res = self.find_file(libname, path)
lib = res[:-len(libname)-1]
return res, lib
def create_variants(bld, source, uselib_local,
uselib, variants, includes=". ../",
......
......@@ -54,6 +54,7 @@ Quick n dirty intel mkl detection
import os, glob, types
from waflib.Configure import conf
import limbo
def options(opt):
opt.add_option('--mkl', type='string', help='path to Intel Math Kernel Library', dest='mkl')
......@@ -63,19 +64,20 @@ def options(opt):
def check_mkl(conf):
if conf.options.mkl:
includes_mkl = [conf.options.mkl + '/include']
libpath_mkl = [conf.options.mkl + '/lib/intel64']
libpath_mkl = [conf.options.mkl + '/lib/intel64', conf.options.mkl + '/lib/']
else:
includes_mkl = ['/usr/local/include', '/usr/include', '/opt/intel/mkl/include']
libpath_mkl = ['/usr/local/lib/', '/usr/lib', '/opt/intel/mkl/lib/intel64', '/usr/lib/x86_64-linux-gnu/']
libpath_mkl = ['/usr/local/lib/', '/usr/lib', '/opt/intel/mkl/lib/intel64', '/usr/lib/x86_64-linux-gnu/', '/opt/intel/mkl/lib']
conf.start_msg('Checking Intel MKL includes (optional)')
try:
res = conf.find_file('mkl.h', includes_mkl)
conf.end_msg('ok')
conf.start_msg('Checking Intel MKL libs (optional)')
res = res and conf.find_file('libmkl_core.so', libpath_mkl)
limbo.check_lib(conf, 'libmkl_core', libpath_mkl)
conf.end_msg('ok')
except:
except Exception, e:
print e
conf.end_msg('Not found', 'RED')
return
conf.env.LIB_MKL_SEQ = ["mkl_intel_lp64", "mkl_core", "mkl_sequential", "pthread", "m"]
......
......@@ -53,7 +53,7 @@ Quick n dirty tbb detection
"""
from waflib.Configure import conf
import limbo
def options(opt):
opt.add_option('--tbb', type='string', help='path to Intel TBB', dest='tbb')
......@@ -81,12 +81,7 @@ def check_tbb(self, *k, **kw):
self.start_msg('Checking Intel TBB libs (optional)')
try:
if self.env['DEST_OS']=='darwin':
res = self.find_file('libtbb.dylib', libpath_tbb)
lib = res[:-len('libtbb.dylib')-1]
else:
res = self.find_file('libtbb.so', libpath_tbb)
lib = res[:-len('libtbb.so')-1]
res, lib = limbo.check_lib(self, 'libtbb', libpath_tbb)
self.end_msg(lib)
except:
self.end_msg('Not found in %s' % str(libpath_tbb), 'YELLOW')
......
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