Commit 74779291 authored by Antoine Cully's avatar Antoine Cully
Browse files

add build_benchmark function in waf to be able to build the benchmark independentely

parent fafecfd8
......@@ -14,7 +14,7 @@ struct Params {
struct bayes_opt_boptimizer {
BO_PARAM(double, noise, 1e-10);
BO_PARAM(int, dump_period, -1);
BO_PARAM(int, hp_period, 1 );
BO_PARAM(int, hp_period, 1);
};
struct stop_maxiterations {
BO_PARAM(int, iterations, 190);
......@@ -29,7 +29,7 @@ struct Params {
struct init_randomsampling {
BO_PARAM(int, samples, 10);
};
struct SquaredExpARD: public defaults::SquaredExpARD {
struct SquaredExpARD : public defaults::SquaredExpARD {
};
struct mean_constant {
BO_PARAM(double, constant, 1);
......
......@@ -14,7 +14,7 @@ struct Params {
struct bayes_opt_boptimizer {
BO_PARAM(double, noise, 1e-10);
BO_PARAM(int, dump_period, -1);
BO_PARAM(int, hp_period, -1 );
BO_PARAM(int, hp_period, -1);
};
struct stop_maxiterations {
BO_PARAM(int, iterations, 190);
......
......@@ -18,7 +18,8 @@ def configure(conf):
conf.env.DEFINES_BAYESOPT = ['USE_BAYESOPT']
conf.get_env()['USE_BAYESOPT'] = True
def build(bld):
def build_benchmark(bld):
if bld.env.DEFINES_NLOPT == ['USE_NLOPT']:
bld.program(features='cxx',
......@@ -34,7 +35,7 @@ def build(bld):
target='benchmark_limbo_hp_opt',
uselib='BOOST EIGEN TBB SFERES NLOPT',
use='limbo')
#Quick and dirty way to add Bayesopt
#TODO make proper detection
......@@ -45,7 +46,7 @@ def build(bld):
target='benchmark_bayesopt',
uselib='BOOST EIGEN TBB NLOPT BAYESOPT',
use='')
bld(features='cxx cxxprogram',
source='bayesopt/hp_opt.cpp',
includes='.',
......
......@@ -6,7 +6,6 @@ def build(bld):
bld.recurse('examples')
if bld.options.tests:
bld.recurse('tests')
bld.recurse('benchmarks')
bld.stlib(source=' \
ehvi/ehvi_calculations.cc \
......
......@@ -106,6 +106,10 @@ def build_extensive_tests(ctx):
ctx.recurse('src/')
ctx.recurse('src/tests')
def build_benchmark(ctx):
ctx.recurse('src/benchmarks')
def run_extensive_tests(ctx):
for fullname in glob.glob('build/src/tests/combinations/*'):
if os.path.isfile(fullname) and os.access(fullname, os.X_OK):
......@@ -122,6 +126,8 @@ def submit_extensive_tests(ctx):
retcode = subprocess.call(s, shell=True, env=None)
print "oarsub returned:" + str(retcode)
def run_benchmark(ctx):
HEADER='\033[95m'
NC='\033[0m'
......@@ -161,3 +167,7 @@ def shutdown(ctx):
class BuildExtensiveTestsContext(BuildContext):
cmd = 'build_extensive_tests'
fun = 'build_extensive_tests'
class BuildBenchmark(BuildContext):
cmd = 'build_benchmark'
fun = 'build_benchmark'
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