From d7e5507eb0ba59db706b95e78e75f3678864415b Mon Sep 17 00:00:00 2001 From: dhuth Date: Mon, 6 Apr 2015 18:46:00 -0600 Subject: bugfix in configure script --- configure.ac | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index f4ccc5a..e88b407 100644 --- a/configure.ac +++ b/configure.ac @@ -19,21 +19,21 @@ AM_PATH_PYTHON([2.7],[ [`${PYTHON} -c "from distutils import sysconfig; print(sysconfig.get_python_inc())"`]) AC_SUBST([PYTHON_LIBDIR], [`${PYTHON} -c "from distutils import sysconfig; print(sysconfig.get_config_var('LIBDIR'))"`]) - AC_SUBST([with_python],[yes])],[ - AC_SUBST([with_python],[no])]) + AC_SUBST([with_python],["yes"])],[ + AC_SUBST([with_python],["no"])]) AC_ARG_ENABLE([cuda],[ AS_HELP_STRING([--enable-cuda],[builds cudachill])],[ AS_IF([test "x$enableval" != xno],[ AC_SUBST([enable_cuda],[yes])],[])]) -AM_CONDITIONAL([CUDACHILL_OPT],[test "$enable_cuda" = yes]) +AM_CONDITIONAL([CUDACHILL_OPT],[test "x$enable_cuda" == xyes]) AC_ARG_ENABLE([coverage],[ AS_HELP_STRING([--enable-coverage],[enables coverage testing])],[ - AS_IF([test "x$enableval" != xno],[ + AS_IF(["x$enableval" != xno],[ AC_SUBST([enable_coverage],[yes]) AC_SUBST([CFLAGS],["-g -fprofile-arcs -ftest-coverage"]) AC_SUBST([CPPFLAGS],["-g -fprofile-arcs -ftest-coverage"])],[])]) @@ -65,23 +65,23 @@ AC_ARG_WITH([omega],[ AC_ARG_WITH([interface],[ AS_HELP_STRING([--with-interface],[select interface language])],[ AC_SUBST([interface_lang],[$withval])],[ - AC_SUBST([interface_lang],["default"])]) + AC_SUBST([interface_lang],[default])]) -AS_IF([test "$interface_lang" = default],[ - AS_IF([test "$enable_cuda" != no],[ +AS_IF([test "x$interface_lang" == xdefault],[ + AS_IF([test "x$enable_cuda" != xno],[ AC_SUBST([use_python],[no]) AC_SUBST([use_lua],[yes]) ],[ AC_SUBST([use_python],[no]) - AC_SUBST([use_lua],[no])])]) + AC_SUBST([use_lua],[no])])],[]) -AS_IF([test "$interface_lang" = lua],[ - AC_SUBST([use_lua],[yes])]) -AS_IF([test "$interface_lang" = python],[ - AC_SUBST([use_python],[yes])]) +AS_IF([test "x$interface_lang" == xlua],[ + AC_SUBST([use_lua],[yes])],[]) +AS_IF([test "x$interface_lang" == xpython],[ + AC_SUBST([use_python],[yes])],[]) -AM_CONDITIONAL([PYTHON_OPT],[test "$use_python" = yes]) -AM_CONDITIONAL([LUA_OPT],[test "$use_lua" = yes]) +AM_CONDITIONAL([PYTHON_OPT],[test "x$use_python" == xyes]) +AM_CONDITIONAL([LUA_OPT],[test "x$use_lua" == xyes]) AC_CONFIG_HEADERS([include/config.h]) AC_CONFIG_FILES([Makefile]) -- cgit v1.2.3-70-g09d2 From 994df9233cd1171a3f18ea575acd58adc105ff2e Mon Sep 17 00:00:00 2001 From: dhuth Date: Thu, 9 Apr 2015 16:08:49 -0600 Subject: fixed chill_run.cc --- chill_run.cc | 2 +- configure.ac | 26 +++++---- test-chill/testchill/__main__.py | 31 ++++------- test-chill/testchill/chill.py | 110 ++++++++++++++++----------------------- 4 files changed, 73 insertions(+), 96 deletions(-) (limited to 'configure.ac') diff --git a/chill_run.cc b/chill_run.cc index ba4de9d..45d2345 100644 --- a/chill_run.cc +++ b/chill_run.cc @@ -376,7 +376,7 @@ int main( int argc, char* argv[] ) #endif #endif #ifdef BUILD_ROSE - //finalize_loop(lnum_start, lnum_end); + finalize_loop(lnum_start, lnum_end); //((IR_roseCode*)(ir_cide))->commit_loop(myloop, lnum); ((IR_roseCode*)(ir_code))->finalizeRose(); //#elif BUILD_SUIF diff --git a/configure.ac b/configure.ac index e88b407..6f79d1b 100644 --- a/configure.ac +++ b/configure.ac @@ -38,12 +38,6 @@ AC_ARG_ENABLE([coverage],[ AC_SUBST([CFLAGS],["-g -fprofile-arcs -ftest-coverage"]) AC_SUBST([CPPFLAGS],["-g -fprofile-arcs -ftest-coverage"])],[])]) - -AC_ARG_WITH([lua],[ - AS_HELP_STRING([--with-lua],[set lua home])],[ - AC_SUBST([LUAHOME], [$withval])],[ - AC_SUBST([LUAHOME], ["${LUAHOME}"])]) - AC_ARG_WITH([rose],[ AS_HELP_STRING([--with-rose],[set rose home])],[ AC_SUBST([ROSEHOME], [$withval]) @@ -61,12 +55,24 @@ AC_ARG_WITH([omega],[ AC_SUBST([OMEGAHOME], [$withval])],[ AC_SUBST([OMEGAHOME], ["$(pwd)/omega"])]) - -AC_ARG_WITH([interface],[ - AS_HELP_STRING([--with-interface],[select interface language])],[ - AC_SUBST([interface_lang],[$withval])],[ +AC_ARG_WITH([python],[ + AS_HELP_STRING([--with-python],[set python as the interface languge])],[ + AC_SUBST([interface_lang],[python]) + ],[ AC_SUBST([interface_lang],[default])]) +AC_ARG_WITH([lua],[ + AS_HELP_STRING([--with-lua],[set lua as the interface langauge.])],[ + AC_SUBST([LUAHOME], ["${LUAHOME}"]) + AC_SUBST([interfae_lang], [lua]) + ],[ + AC_SUBST([LUAHOME], ["${LUAHOME}"])]) + +#AC_ARG_WITH([interface],[ +# AS_HELP_STRING([--with-interface],[select interface language])],[ +# AC_SUBST([interface_lang],[$withval])],[ +# AC_SUBST([interface_lang],[default])]) + AS_IF([test "x$interface_lang" == xdefault],[ AS_IF([test "x$enable_cuda" != xno],[ AC_SUBST([use_python],[no]) diff --git a/test-chill/testchill/__main__.py b/test-chill/testchill/__main__.py index 8af5b9c..01fee78 100644 --- a/test-chill/testchill/__main__.py +++ b/test-chill/testchill/__main__.py @@ -9,7 +9,6 @@ import textwrap from . import chill from . import gcov -from . import omega from . import test from . import util @@ -26,7 +25,6 @@ def make_local(argsns, arg_parser): argsns.bin_dir = os.path.join(os.getcwd(), '.staging/bin') argsns.chill_tc_dir = os.path.join(os.getcwd(), 'test-cases') # formally from the commandline argsns.chill_dir = os.path.abspath(argsns.chill_dir) - argsns.omega_dir = os.path.abspath(argsns.omega_dir) argsns.chill_build_coverage = argsns.coverage_set is not None #TODO: make arg passed to local. argsns.chill_test_coverage = argsns.coverage_set is not None @@ -35,11 +33,10 @@ def make_local(argsns, arg_parser): util.shell('cp', [os.path.join(argsns.chill_dir, 'examples/cuda-chill/cudaize.lua'), argsns.wd]) util.shell('cp', [os.path.join(argsns.chill_dir, 'examples/cuda-chill/cudaize.py'), argsns.wd]) - chill_version = argsns.chill_version - for config in chill.ChillConfig.configs(argsns.omega_dir, argsns.chill_dir, argsns.bin_dir, version=chill_version): + for config in chill.ChillConfig.configs(argsns.chill_dir, argsns.bin_dir): build_testcase = chill.BuildChillTestCase(config, options={'coverage': argsns.chill_build_coverage}, coverage_set=argsns.coverage_set) yield build_testcase - batch_file = os.path.join(argsns.chill_tc_dir, config.name() + '.tclist') + batch_file = os.path.join(argsns.chill_tc_dir, config.name + '.tclist') for tc in make_batch_testcaselist(argsns, arg_parser, batch_file): yield tc @@ -116,12 +113,10 @@ def make_runchill_testcase(argsns): argsns.chill_script_lang = chill.ChillConfig.ext_to_script_lang(chill_script.split('.')[-1]) config = chill.ChillConfig( - omega_dir = os.path.abspath(argsns.omega_dir) if argsns.omega_dir != None else None, chill_dir = os.path.abspath(argsns.chill_dir) if argsns.chill_dir != None else None, bin_dir = os.path.abspath(argsns.bin_dir) if argsns.bin_dir != None else None, build_cuda = argsns.build_cuda, - script_lang = argsns.chill_script_lang, - version = argsns.chill_version) + script_lang = argsns.chill_script_lang) return chill.RunChillTestCase(config, chill_script, chill_src, wd=wd, options=options, coverage_set=coverage_set) @@ -131,7 +126,6 @@ def make_buildchill_testcase(argsns): @param argsns Command line arguments """ assert argsns.chill_dir != None - assert argsns.omega_dir != None coverage_set = argsns.coverage_set @@ -139,12 +133,10 @@ def make_buildchill_testcase(argsns): options['coverage'] = argsns.chill_build_coverage config = chill.ChillConfig( - omega_dir = os.path.abspath(argsns.omega_dir) if argsns.omega_dir != None else None, chill_dir = os.path.abspath(argsns.chill_dir) if argsns.chill_dir != None else None, bin_dir = os.path.abspath(argsns.bin_dir) if argsns.bin_dir != None else None, build_cuda = argsns.build_cuda, - script_lang = argsns.chill_script_lang, - version = argsns.chill_version) + script_lang = argsns.chill_script_lang) return chill.BuildChillTestCase(config, options=options, coverage_set=coverage_set) @@ -173,12 +165,12 @@ def add_local_args(arg_parser): @param arg_parser The local ArgumentParser object """ arg_parser.add_argument('chill_dir', metavar='chill-home', default='../') - arg_parser.add_argument('-v', '--chill-branch', dest='chill_version', default='dev', choices=['release','dev']) + #arg_parser.add_argument('-v', '--chill-branch', dest='chill_version', default='dev', choices=['release','dev']) # - Testing should consider all interface languages. Will uncomment if testing takes too long # arg_parser.add_argument('-i', '--interface-lang', nargs=1, action='append', dest='chill_script_lang_list', choices=['script','lua','python']) # arg_parser.add_argument('-t', '--testcase-dir', dest='chill_tc_dir', default=os.path.join(os.getcwd(), 'test-cases/')) - arg_parser.set_defaults(wd=os.path.join(os.getcwd(), '.staging/wd')) # - These don't seem to work - arg_parser.set_defaults(bin_dir=os.path.join(os.getcwd(), '.staging/bin')) # - + arg_parser.set_defaults(wd=os.path.join(os.getcwd(), '.staging/wd')) + arg_parser.set_defaults(bin_dir=os.path.join(os.getcwd(), '.staging/bin')) @util.callonce def add_repo_args(arg_parser): @@ -207,7 +199,6 @@ def add_chill_common_args(arg_parser): Common chill command line arguments. @param arg_parser The ArgumentParser object """ - arg_parser.add_argument('-v', '--chill-branch', dest='chill_version', default='dev', choices=['release','dev']) cuda_group = arg_parser.add_mutually_exclusive_group() cuda_group.add_argument('-u', '--target-cuda', action='store_const', const=True, dest='build_cuda', default=False, help='Test cuda-chill. (Default is chill)') cuda_group.add_argument('-c', '--target-c', action='store_const', const=False, dest='build_cuda', default=False, help='Test chill. (Default is chill)') @@ -303,7 +294,7 @@ def add_commands(arg_parser): """ command_group = arg_parser.add_subparsers(title='commands') add_local_command(command_group) - add_repo_command(command_group) + #add_repo_command(command_group) add_chill_command(command_group) add_buildchill_command(command_group) add_batch_command(command_group) @@ -315,9 +306,8 @@ def add_global_args(arg_parser): @param arg_parser The ArgumentParser object """ arg_parser.add_argument('-w', '--working-dir', dest='wd', default=os.getcwd(), help='The working directory. (Defaults to the current directory)', metavar='working-directory') - arg_parser.add_argument('-R', '--rose-home', dest='rose_dir', default=os.getenv('ROSEHOME'), help='Rose home directory. (Defaults to ROSEHOME)', metavar='rose-home') + arg_parser.add_argument('-R', '--rose-home', dest='rose_dir', default=os.getenv('ROSEHOME'), help='Rose home directory. (Defaults to ROSEHOME)', metavar='rose-home') arg_parser.add_argument('-C', '--chill-home', dest='chill_dir', default=os.path.join(os.getcwd(), '..'), help='Chill home directory. (Defaults to CHILLHOME)', metavar='chill-home') - arg_parser.add_argument('-O', '--omega-home', dest='omega_dir', default=os.path.join(os.getcwd(), '../omega'), help='Omega home directory. (Defaults to ../omega)', metavar='omega-home') arg_parser.add_argument('-b', '--binary-dir', dest='bin_dir', default=None, help='Binary directory.', metavar='bin-dir') @util.callonce @@ -331,8 +321,7 @@ def make_argparser(): To test a local working copy of chill (from the development branch): -------------------------------------------------------------------- - - Set $OMEGAHOME and compile omega. - - Run `python -m testchill local ` + - Run `python -m testchill local` '''), epilog='EPILOG', diff --git a/test-chill/testchill/chill.py b/test-chill/testchill/chill.py index 05f3b4f..0e30149 100644 --- a/test-chill/testchill/chill.py +++ b/test-chill/testchill/chill.py @@ -11,46 +11,16 @@ from . import cpp_validate class ChillConfig(object): - _config_map = dict(('-'.join(map(str,k)),v) for k,v in [ - (('dev',False,'script'), ('chill', 'depend-chill', 'chill', '')), - (('dev',False,'lua'), ('chill-lua', 'depend-chill', 'chill', 'SCRIPT_LANG=lua')), - (('dev',False,'python'), ('chill-python', 'depend-chill', 'chill', 'SCRIPT_LANG=python')), - (('dev',True,'lua'), ('cuda-chill', 'depend-cuda-chill', 'cuda-chill', '')), - (('dev',True,'python'), ('cuda-chill-python', 'depend-cuda-chill', 'cuda-chill', 'SCRIPT_LANG=python')), - (('release',False,'script'), ('chill-release', 'depend', 'chill', '')), - (('release',True,'lua'), ('cuda-chill-release', 'depend-cuda-chill', 'cuda-chill', '')) - ]) - - def __init__(self, omega_dir=None, chill_dir=None, bin_dir=None, build_cuda=False, script_lang=None, version='dev'): - self.version = version + def __init__(self, chill_dir=None, bin_dir=None, build_cuda=False, script_lang=None): self.build_cuda = build_cuda self.script_lang = script_lang - self.omega_dir = omega_dir self.chill_dir = chill_dir self.bin_dir = bin_dir if self.script_lang is None: self.script_lang = self.default_script_lang() - def _get(self, index): - return ChillConfig._config_map[self.version + '-' + str(self.build_cuda) + '-' + self.script_lang][index] - def default_script_lang(self): - if self.build_cuda: - return 'lua' - else: - return 'script' - - def name(self): - return self._get(0) - - def make_depend_target(self): - return self._get(1) - - def make_target(self): - return self._get(2) - - def make_args(self): - return self._get(3) + return 'python' def _buildfunc(self, cc, link=True): if not link: @@ -87,38 +57,51 @@ class ChillConfig(object): else: return self._buildfunc('gcc') - def env(self): - chill_env = {'OMEGAHOME':self.omega_dir} - if self.version == 'release' and self.build_cuda: - chill_env['CUDACHILL']='true' - return chill_env + @property + def config_args(self): + args = [] + if self.build_cuda: + args += ['--enable-cuda'] + if self.script_lang is not None: + args += ['--with-' + self.script_lang] + return args + + @property + def buildname(self): + if self.build_cuda: + return 'cudachill' + else: + return 'chill' + + @property + def name(self): + if self.buildname == 'cudachill': + return 'cuda-chill-' + self.script_lang + else: + return 'chill-' + self.script_lang @staticmethod def ext_to_script_lang(ext): return {'script':'script', 'lua':'lua', 'py':'python'}[ext] @staticmethod - def configs(omega_dir, chill_dir, bin_dir, build_cuda=None, script_lang=None, version=None): + def configs(chill_dir, bin_dir, build_cuda=None, script_lang=None): all_configs = [ - (False, 'script', 'dev'), - (False, 'script', 'release'), - (False, 'lua', 'dev'), - (False, 'python', 'dev'), - (True, 'lua', 'dev'), - (True, 'lua', 'release'), - (True, 'python', 'dev')] + (False, 'script'), + (False, 'lua'), + (False, 'python'), + (True, 'lua'), + (True, 'python')] pred_list = [lambda x: True] if not build_cuda is None: pred_list += [lambda x: x[0] == build_cuda] if not script_lang is None: pred_list += [lambda x: x[1] == script_lang] - if not version is None: - pred_list += [lambda x: x[2] == version] cond = lambda x: all(p(x) for p in pred_list) - return iter(ChillConfig(omega_dir, chill_dir, bin_dir, *conf) for conf in filter(cond, all_configs)) + return iter(ChillConfig(chill_dir, bin_dir, *conf) for conf in filter(cond, all_configs)) # - - # @@ -143,18 +126,15 @@ class BuildChillTestCase(test.TestCase): if config.script_lang == None: config.script_lang = config.default_script_lang() self.config = config - super(BuildChillTestCase,self).__init__(self.config.name()) + super(BuildChillTestCase,self).__init__(self.config.name) self._set_options(options, coverage_set) def _set_options(self, options, coverage_set): self.options = dict(BuildChillTestCase.default_options) self.options.update(options) - self.build_env = self.config.env() - self.build_args = self.config.make_args() if self.options['coverage']: - self.build_args += ' "TEST_COVERAGE=1"' - coverage_set.addprogram(self.config.name(), self.config.chill_dir) + coverage_set.addprogram(self.config.name, self.config.chill_dir) def setUp(self): """ @@ -172,12 +152,14 @@ class BuildChillTestCase(test.TestCase): """ Build chill """ - depend_target = self.config.make_depend_target() - target = self.config.make_target() util.shell('make', ['clean'], wd=self.config.chill_dir) - util.shell('make', ['veryclean'], wd=self.config.chill_dir) - util.shell('make', [depend_target] + [self.build_args], env=self.build_env, wd=self.config.chill_dir) - util.shell('make', [target] + [self.build_args], env=self.build_env, wd=self.config.chill_dir) + util.shell('./configure', self.config.config_args, wd=self.config.chill_dir) + util.shell('make', [], wd=self.config.chill_dir) + + #util.shell('make', ['clean'], wd=self.config.chill_dir) + #util.shell('make', ['veryclean'], wd=self.config.chill_dir) + #util.shell('make', [depend_target] + [self.build_args], env=self.build_env, wd=self.config.chill_dir) + #util.shell('make', [target] + [self.build_args], env=self.build_env, wd=self.config.chill_dir) return self.make_pass() def tearDown(self): @@ -187,9 +169,9 @@ class BuildChillTestCase(test.TestCase): """ if self.test_result.passed(): if self.config.bin_dir: - util.shell('mv', [os.path.join(self.config.chill_dir, self.config.make_target()), os.path.join(self.config.bin_dir, self.config.name())]) - elif not self.config.make_target() == self.config.name(): - util.shell('mv', [os.path.join(self.config.chill_dir, self.config.make_target()), os.path.join(self.config.chill_dir, self.config.name())]) + util.shell('mv', [os.path.join(self.config.chill_dir, self.config.buildname), os.path.join(self.config.bin_dir, self.config.name)]) + elif not self.config.buildname == name: + util.shell('mv', [os.path.join(self.config.chill_dir, self.config.buildname), os.path.join(self.config.chill_dir, self.config.name)]) # - - # @@ -225,14 +207,14 @@ class RunChillTestCase(test.SequencialTestCase): assert isinstance(config, ChillConfig) - super(RunChillTestCase,self).__init__(config.name() + ':' + os.path.basename(chill_script)) + super(RunChillTestCase,self).__init__(config.name + ':' + os.path.basename(chill_script)) self.config = config self.wd = wd if (wd != None) else os.getcwd() self.chill_src_path = os.path.abspath(chill_src) self.chill_script_path = os.path.abspath(chill_script) - self.chill_bin = os.path.join(self.config.bin_dir, self.config.name()) + self.chill_bin = os.path.join(self.config.bin_dir, self.config.name) self.chill_src = os.path.basename(self.chill_src_path) self.chill_script = os.path.basename(self.chill_script_path) self.chill_gensrc = self._get_gensrc(self.chill_src) @@ -291,7 +273,7 @@ class RunChillTestCase(test.SequencialTestCase): util.shell('rm', ['-f', self.chill_script], wd=self.wd) util.shell('rm', ['-f', self.chill_gensrc], wd=self.wd) if self.options['coverage'] and self.coverage_set is not None: - self.coverage_set.addcoverage(self.config.name(), self.name) + self.coverage_set.addcoverage(self.config.name, self.name) # - - # # - Chill Tests - # -- cgit v1.2.3-70-g09d2 From 2bebca1c3fe897fb681e1853d7d565ecb0be8b52 Mon Sep 17 00:00:00 2001 From: dhuth Date: Mon, 13 Apr 2015 11:53:47 -0600 Subject: -- --- chill_run.cc | 9 +- configure.ac | 41 +++-- graph.hh | 2 +- test-chill/Makefile | 381 +++++++++++++++++++++++------------------- test-chill/testchill/chill.py | 3 +- 5 files changed, 248 insertions(+), 188 deletions(-) (limited to 'configure.ac') diff --git a/chill_run.cc b/chill_run.cc index 45d2345..a3c9180 100644 --- a/chill_run.cc +++ b/chill_run.cc @@ -359,6 +359,7 @@ int main( int argc, char* argv[] ) #endif #ifdef BUILD_ROSE ((IR_cudaroseCode *)(ir_code))->commit_loop(myloop, lnum); + ((IR_roseCode*)(ir_code))->finalizeRose(); #elif BUILD_SUIF ((IR_cudasuifCode *)(ir_code))->commit_loop(myloop, lnum); #endif @@ -374,14 +375,16 @@ int main( int argc, char* argv[] ) lnum_end = get_loop_num_end(L); DEBUG_PRINT("calling ROSE code gen? loop num %d - %d\n", lnum_start, lnum_end); #endif -#endif + #ifdef BUILD_ROSE finalize_loop(lnum_start, lnum_end); //((IR_roseCode*)(ir_cide))->commit_loop(myloop, lnum); ((IR_roseCode*)(ir_code))->finalizeRose(); - //#elif BUILD_SUIF - //((IR_suifCode*)(ir_code))->commit_loop(myloop, lnum); + #elif BUILD_SUIF + ((IR_suifCode*)(ir_code))->commit_loop(myloop, lnum); #endif + +#endif delete ir_code; } #ifdef PYTHON diff --git a/configure.ac b/configure.ac index 6f79d1b..f40c87c 100644 --- a/configure.ac +++ b/configure.ac @@ -19,35 +19,46 @@ AM_PATH_PYTHON([2.7],[ [`${PYTHON} -c "from distutils import sysconfig; print(sysconfig.get_python_inc())"`]) AC_SUBST([PYTHON_LIBDIR], [`${PYTHON} -c "from distutils import sysconfig; print(sysconfig.get_config_var('LIBDIR'))"`]) - AC_SUBST([with_python],["yes"])],[ - AC_SUBST([with_python],["no"])]) + AC_SUBST([python_builds],[yes])],[ + AC_SUBST([python_builds],[no])]) +#AC_ARG_ENABLE([cuda],[ +# AS_HELP_STRING([--enable-cuda],[builds cudachill])],[ +# AS_IF([test "x$enableval" != xno],[ +# AC_SUBST([enable_cuda],[yes])])]) + AC_ARG_ENABLE([cuda],[ - AS_HELP_STRING([--enable-cuda],[builds cudachill])],[ + AS_HELP_STRING([--enable-cuda],[builds cudachill]) + ],[ AS_IF([test "x$enableval" != xno],[ - AC_SUBST([enable_cuda],[yes])],[])]) + AC_SUBST([enable_cuda],[yes])])]) + AM_CONDITIONAL([CUDACHILL_OPT],[test "x$enable_cuda" == xyes]) AC_ARG_ENABLE([coverage],[ - AS_HELP_STRING([--enable-coverage],[enables coverage testing])],[ - + AS_HELP_STRING([--enable-coverage],[enables coverage testing]) + ],[ AS_IF(["x$enableval" != xno],[ AC_SUBST([enable_coverage],[yes]) AC_SUBST([CFLAGS],["-g -fprofile-arcs -ftest-coverage"]) AC_SUBST([CPPFLAGS],["-g -fprofile-arcs -ftest-coverage"])],[])]) AC_ARG_WITH([rose],[ - AS_HELP_STRING([--with-rose],[set rose home])],[ + AS_HELP_STRING([--with-rose],[set rose home]) + ],[ AC_SUBST([ROSEHOME], [$withval]) - AC_DEFINE([BUILD_ROSE],[],[Use ROSE])],[ + AC_DEFINE([BUILD_ROSE],[],[Use ROSE]) + ],[ AC_SUBST([ROSEHOME], ["${ROSEHOME}"]) AC_DEFINE([BUILD_ROSE],[],[Use ROSE])]) AC_ARG_WITH([boost],[ - AS_HELP_STRING([--with-boost],[set boost home])],[ - AC_SUBST([BOOSTHOME], [$withval])],[ + AS_HELP_STRING([--with-boost],[set boost home]) + ],[ + AC_SUBST([BOOSTHOME], [$withval]) + ],[ AC_SUBST([BOOSTHOME], ["${BOOSTHOME}"])]) AC_ARG_WITH([omega],[ @@ -56,7 +67,8 @@ AC_ARG_WITH([omega],[ AC_SUBST([OMEGAHOME], ["$(pwd)/omega"])]) AC_ARG_WITH([python],[ - AS_HELP_STRING([--with-python],[set python as the interface languge])],[ + AS_HELP_STRING([--with-python],[set python as the interface languge]) + ],[ AC_SUBST([interface_lang],[python]) ],[ AC_SUBST([interface_lang],[default])]) @@ -68,13 +80,18 @@ AC_ARG_WITH([lua],[ ],[ AC_SUBST([LUAHOME], ["${LUAHOME}"])]) +AC_ARG_WITH([script],[ + AS_HELP_STRING([--with-script],[set the legacy scripting language as the interface language (CHiLL only)]), + ],[ + AC_SUBST([interface_lang],[default])]) + #AC_ARG_WITH([interface],[ # AS_HELP_STRING([--with-interface],[select interface language])],[ # AC_SUBST([interface_lang],[$withval])],[ # AC_SUBST([interface_lang],[default])]) AS_IF([test "x$interface_lang" == xdefault],[ - AS_IF([test "x$enable_cuda" != xno],[ + AS_IF([test "x$enable_cuda" == xyes],[ AC_SUBST([use_python],[no]) AC_SUBST([use_lua],[yes]) ],[ diff --git a/graph.hh b/graph.hh index 504c147..a7b80e9 100644 --- a/graph.hh +++ b/graph.hh @@ -76,7 +76,7 @@ template std::ostream& operator<<(std::ostream &os, const Graph &g) { for (int i = 0; i < g.vertex.size(); i++) for (typename Graph::EdgeList::const_iterator j = g.vertex[i].second.begin(); j != g.vertex[i].second.end(); j++) { - os << i+1 << "->" << j->first+1 << ":"; + os << "s" << i << "->" << j->first << ":"; for (typename std::vector::const_iterator k = j->second.begin(); k != j->second.end(); k++) os << " " << *k; os << std::endl; diff --git a/test-chill/Makefile b/test-chill/Makefile index d7238e8..7f2c8b5 100644 --- a/test-chill/Makefile +++ b/test-chill/Makefile @@ -1,210 +1,251 @@ -### ### -### SVN variables ### -### ### -SVN_USER=dhuth - -### ### -### Notification ### -### (not implemented yet) ### -NOTIFY_ON_FAILURE=False - - - -### Derived variables from config ### -CHILLHOME?=$(STAGING_DIR)/chill -SVN_CHILL=svn+ssh://$(SVN_USER)@shell.cs.utah.edu/uusoc/facility/res/hallresearch/svn_repo/resRepo/projects/chill -SVN_CHILL_DEV=$(SVN_CHILL)/branches/cuda-chill-rose -SVN_CHILL_RELEASE=$(SVN_CHILL)/release -CHILL_DEV_SRC=$(STAGING_DIR)/chill-dev -CHILL_RELEASE_SRC=$(STAGING_DIR)/chill-release -OMEGAHOME?=$(STAGING_DIR)/omega -SVN_OMEGA=svn+ssh://$(SVN_USER)@shell.cs.utah.edu/uusoc/facility/res/hallresearch/svn_repo/resRepo/projects/omega -SVN_OMEGA_DEV=$(SVN_OMEGA)/branches/cuda-omega-rose -SVN_OMEGA_RELEASE=$(SVN_OMEGA)/release -OMEGA_DEV_SRC=$(STAGING_DIR)/omega-dev -OMEGA_RELEASE_SRC=$(STAGING_DIR)/omega-release - - -### Staging ### -STAGING_DIR=$(shell pwd)/.staging -STAGING_DIR_BIN=$(STAGING_DIR)/bin -STAGING_DIR_WD=$(STAGING_DIR)/wd - - -### Local ### -UNIT_TEST_DIR=$(shell pwd)/unit-tests/ -CHILL_DEV_TESTCASE_DIR=$(shell pwd)/test-cases/chill -CHILL_DEV_TESTCASES_SCRIPT=$(shell find $(CHILL_DEV_TESTCASE_DIR) -name "*.script") -CHILL_DEV_TESTCASES_STDOUT=$(patsubst %.script,%.stdout,$(CHILL_DEV_TESTCASES_SCRIPT)) - -### Python environment variables ### -PYTHON_2:=$(shell which python) -PYTHON_3:=$(shell which python3) - -ifneq ($(PYTHON_3),) -PYTHON_3_VERSION=$(shell $(PYTHON_3) -c "import sysconfig; print(sysconfig.get_config_var('VERSION'))") + +.SUFFIXES: +.PHONY: all depend depend-cuda-chill clean veryclean cuda-chill +.PHONY: chill + +CC = g++ +CFLAGS = -g -Wno-write-strings +DEPENDENCE_CFLAGS = -M +OMEGAHOME=./omega + +ifdef TEST_COVERAGE + CFLAGS := $(CFLAGS) -fprofile-arcs -ftest-coverage endif -PYTHON_2_VERSION=$(shell $(PYTHON_2) -c "import sysconfig; print sysconfig.get_config_var('VERSION')") -PYTHON_VERSION=$(firstword $(PYTHON_3_VERSION) $(PYTHON_2_VERSION)) -PYTHON=$(shell which python$(PYTHON_VERSION)) -### ---------------------------- ### - - -EXPORT=export CHILL_DEV_SRC=$(CHILL_DEV_SRC); \ - export CHILL_RELEASE_SRC=$(CHILL_RELEASE_SRC); \ - export OMEGA_DEV_SRC=$(OMEGA_DEV_SRC); \ - export OMEGA_RELEASE_SRC=$(OMEGA_RELEASE_SRC); \ - export STAGING_DIR_BIN=$(STAGING_DIR_BIN); \ - export STAGING_DIR_WD=$(STAGING_DIR_WD); - -### deump environment ### -# define quiet to shut this part up # -ifndef quiet -$(info notify on failure? $(NOTIFY_ON_FAILURE)) -$(info staging directory $(STAGING_DIR)) -$(info binary directory $(STAGING_DIR_BIN)) -$(info working directory $(STAGING_DIR_WD)) -$(info omega home $(OMEGAHOME)) -$(info chill home $(CHILLHOME)) -$(info chill svn dev repo $(SVN_CHILL_DEV)) -$(info chill svn release repo $(SVN_CHILL_RELEASE)) -$(info chill dev src $(CHILL_DEV_SRC)) -$(info chill release src $(CHILL_RELEASE_SRC)) -$(info omega svn dev repo $(SVN_OMEGA_DEV)) -$(info omega svn release repo $(SVN_OMEGA_RELEASE)) -$(info omega dev src $(OMEGA_DEV_SRC)) -$(info omega release src $(OMEGA_RELEASE_SRC)) -$(info python $(PYTHON)) -$(info unit tests $(UNIT_TEST_DIR)) -#$(info chill-dev test cases $(CHILL_DEV_TESTCASES_SCRIPT)) -#$(info chill-dev test case stdouts $(CHILL_DEV_TESTCASES_STDOUT)) + +# TODO auto-generate using config.h generated by autoconf? +CHILLVERSION = "\"0.2.0\"" +PYTHON=python #=$(shell `which python` ) +PYVERSION=$(shell $(PYTHON) -c "import sys; print(sys.version[:3])") # 2.6 +PYTHONVER = python$(PYVERSION) +PYTHONINCLUDE = $(shell $(PYTHON) -c "from distutils import sysconfig; print(sysconfig.get_python_inc())") +PYTHONLIBDIR = $(shell $(PYTHON) -c "from distutils import sysconfig; print(sysconfig.get_config_var('LIBDIR'))") +PYTHONCONFIG = $(shell $(PYTHON) -c "from distutils import sysconfig; print(sysconfig.get_config_var('LIBPL'))") +# SCRIPT_LANG = lua <-- supplied by the command line + + +# this creates a LUAHOME even if you don't have such a directory +ifeq ($(strip $(wildcard $(LUAHOME))),) +LUAHOME = $(HOME)/lua endif -### ----------------- ### +LUA_PATH = -L${LUAHOME}/lib -DIRTY_EXTS=pyc o log pickle -DIRTY_FILES=$(foreach de,$(DIRTY_EXTS),$(shell find . -name "*.$(de)")) -DIRTY_DIRS=$(shell find . -name '__pycache__' -and -type d) $(STAGING_DIR) pylang coverage_report -CORE_TESTS:=_extract util gcov _cpp_validate_env cpp_validate test __main__ -OMEGA_TESTS:=omega -CHILL_TESTS:=chill +# where do include files live +INC_PATH = -I${PYTHONINCLUDE} -I${OMEGAHOME}/include -I${LUAHOME}/include -CORE_TESTS:=$(addsuffix .py,$(addprefix unit-tests/test_,$(CORE_TESTS))) -OMEGA_TESTS:=$(addsuffix .py,$(addprefix unit-tests/test_,$(OMEGA_TESTS))) -CHILL_TESTS:=$(addsuffix .py,$(addprefix unit-tests/test_,$(CHILL_TESTS))) +# where do libraries live +LIB_PATH = -L${OMEGAHOME}/code_gen/obj -L${OMEGAHOME}/omega_lib/obj +# seemingly not needed -L${PYTHONCONFIG} -### The all target ### -.PHONY: all -all: - $(MAKE) clean quiet=1 - $(MAKE) install quiet=1 -### This will install the chill_test module ### -.PHONY: install -install: pylang - $(PYTHON) makeparser.py - #TODO: maybe run a setup or something +CORE_LIBS = -lm -lcodegen -lomega +RUNNER_LIBS = -llua -ldl -lreadline -lhistory -lpthread -ldl -lutil -lm -l${PYTHONVER} +TDLHOME = ${ROSEHOME}/libltdl +BOOST_DATE_TIME_LIB = -lboost_date_time +BOOST_FILESYSTEM_LIB = -lboost_filesystem +BOOST_LDFLAGS = -L${BOOSTHOME}/lib +BOOST_PROGRAM_OPTIONS_LIB = -lboost_program_options +BOOST_REGEX_LIB = -lboost_regex +BOOST_SYSTEM_LIB = -lboost_system +BOOST_THREAD_LIB = -lboost_thread +BOOST_WAVE_LIB = -lboost_wave -### This will uninstall teh chill_test module ### -.PHONY: uninstall -uninstall: - #TODO: can python modules be uninstalled? +ROSE_LIBS = -lrose $(BOOST_LDFLAGS) $(BOOST_DATE_TIME_LIB)\ + $(BOOST_THREAD_LIB) $(BOOST_FILESYSTEM_LIB) $(BOOST_PROGRAM_OPTIONS_LIB)\ + $(BOOST_REGEX_LIB) $(BOOST_SYSTEM_LIB) $(BOOST_SERIALIZATION_LIB) \ + $(BOOST_WAVE_LIB) -lrt -ldl +# Source files common to both chill and cuda-chill +CORE_SRCS = dep.cc omegatools.cc irtools.cc loop.cc loop_basic.cc loop_datacopy.cc loop_unroll.cc loop_tile.cc loop_extra.cc +LIB_SRCS = $(CORE_SRCS) -### Simply removes all files listed in DIRTY_FILES ### -.PHONY: clean -clean: - rm -rf $(DIRTY_FILES) - rm -rf $(DIRTY_DIRS) +# files that will be generated by bison, flex, and make that need to be removed at clean. +GENERATED_SRCS = parser.tab.hh parser.tab.cc parse_expr.yy.cc parse_expr.ll.hh parse_expr.tab.cc parse_expr.tab.hh Makefile.deps +# object files that are specific to lua or python builds. -- This is used so that SCRIPT_LANG does not need to be specified during clean +ORPHAN_OBJS = chill_run_util.o chillmodule.o parse_expr.tab.o parse_expr.yy.o + +# files used in chill and cuda-chill interfaces +ifeq ($(SCRIPT_LANG),lua) + RUNNER_SRCS = chill_run.cc chill_env.cc +else + ifeq ($(SCRIPT_LANG),python) + RUNNER_SRCS = chill_run.cc chillmodule.cc + else + RUNNER_SRCS = chill_run.cc chill_env.cc + endif +endif + +# files used in chill but not cuda-chill +IR_CHILL_SRCS = ir_rose.cc ir_rose_utils.cc +ifeq ($(SCRIPT_LANG),lua) + YACC_SRCS = parse_expr.yy.cc parse_expr.tab.cc + CHILL_RUNNER_SRCS = chill_run_util.cc + CHILL_SRCS = $(CORE_SRCS) $(IR_CHILL_SRCS) $(CHILL_RUNNER_SRCS) $(RUNNER_SRCS) +else + ifeq ($(SCRIPT_LANG),python) + YACC_SRCS = parse_expr.yy.cc parse_expr.tab.cc + CHILL_RUNNER_SRCS = chill_run_util.cc + CHILL_SRCS = $(CORE_SRCS) $(IR_CHILL_SRCS) $(CHILL_RUNNER_SRCS) $(RUNNER_SRCS) + else + YACC_SRCS = lex.yy.cc parser.tab.cc + CHILL_RUNNER_SRCS = + CHILL_SRCS = $(CORE_SRCS) $(IR_CHILL_SRCS) $(YACC_SRCS) $(RUNNER_SRCS) + endif +endif + +# source files for cuda-chill but not chill +CUDACHILL_ONLY_SRCS = mem_mapping_utils.cc loop_cuda_rose.cc +IR_CUDACHILL_SRCS = ir_rose.cc ir_rose_utils.cc ir_cudarose.cc ir_cuda_rose_utils.cc +CUDACHILL_RUNNER_SRCS = +CUDACHILL_SRCS = $(CORE_SRCS) $(CUDACHILL_ONLY_SRCS) $(IR_CUDACHILL_SRCS) $(RUNNER_SRCS) $(CUDACHILL_RUNNER_SRCS) + +# set interface language flags +ifeq ($(SCRIPT_LANG),lua) + RUNNER_EXTRA_CFLAGS = -DLUA +else + ifeq ($(SCRIPT_LANG),python) + RUNNER_EXTRA_CFLAGS = -DPYTHON + endif +endif + +depend-cuda-chill: CFLAGS := $(CFLAGS) -DCUDACHILL +cuda-chill: CFLAGS := $(CFLAGS) -DCUDACHILL + +ALL_SRCS = $(CORE_SRCS) $(YACC_SRCS) $(IR_CHILL_SRCS) $(CUDACHILL_ONLY_SRCS) $(IR_CUDACHILL_SRCS) $(RUNNER_SRCS) $(CHILL_RUNNER_SRCS) $(CUDACHILL_RUNNER_SRCS) +ALL_OBJS = $(ALL_SRCS:.cc=.o) $(ORPHAN_OBJS) + +RUNNER_DEFINES = -DLUA_USE_LINUX -DCHILL_BUILD_VERSION=$(CHILLVERSION) -DCHILL_BUILD_DATE="\"$(CHILL_BUILD_DATE)\"" + + +YACC_EXTRA_CFLAGS = + +##################################################################### +# compiler intermediate code specific definitions +##################################################################### -pylang: - git clone https://github.com/dhuth/pylang.git pylang-tmp - $(PYTHON) pylang-tmp/make_grammar_parsers.py - cp -r pylang-tmp/pylang pylang - rm -rf pylang-tmp -### Test the test harness ### -.PHONY: test -test: $(STAGING_DIR_BIN) $(OMEGA_DEV_SRC) $(OMEGA_RELEASE_SRC) $(CHILL_DEV_SRC) $(CHILL_RELEASE_SRC) - @echo "-----------------------------------------------------------" - @echo "Note: This target tests the test suite it's self, not chill" - @echo "To test chill, run python -m testchill ..." - @echo "-----------------------------------------------------------" - - $(EXPORT) $(PYTHON) -m unittest $(OMEGA_TESTS) $(CORE_TESTS) $(CHILL_TESTS) - @ rm -rf $(STAGING_DIR) +#LIBS := $(LIBS) $(ROSE_LIBS) +LIB_PATH := $(LIB_PATH) -L${ROSEHOME}/lib -L${TDLHOME} +#LIB_SRCS := $(LIB_SRCS) # $(IR_SRCS) +INC_PATH := $(INC_PATH) -I${ROSEHOME}/include -I${BOOSTHOME}/include +YACC_EXTRA_CFLAGS := -DBUILD_ROSE +RUNNER_EXTRA_CFLAGS := $(RUNNER_EXTRA_CFLAGS) -DBUILD_ROSE -.PHONY: test-chill -test-chill: $(STAGING_DIR_BIN) $(OMEGA_DEV_SRC) $(OMEGA_RELEASE_SRC) $(CHILL_DEV_SRC) $(CHILL_RELEASE_SRC) - - $(EXPORT) $(PYTHON) -m unittest $(OMEGA_TESTS) $(CHILL_TESTS) - @ rm -rf $(STAGING_DIR) +##################################################################### +# build rules +##################################################################### +YACC_OBJS = $(YACC_SRCS:.cc=.o) +RUNNER_OBJS = $(RUNNER_SRCS:.cc=.o) +CHILL_RUNNER_OBJS = $(CHILL_RUNNER_SRCS:.cc=.o) +CUDACHILL_RUNNER_OBJS = $(CUDACHILL_RUNNER_SRCS:.cc=.o) +LIB_OBJS = $(LIB_SRCS:.cc=.o) +IR_CHILL_OBJS = $(IR_CHILL_SRCS:.cc=.o) +IR_CUDACHILL_OBJS = $(IR_CUDACHILL_SRCS:.cc=.o) +CUDACHILL_ONLY_OBJS = $(CUDACHILL_ONLY_SRCS:.cc=.o) -.PHONY: test-omega -test-omega: $(STAGING_DIR_BIN) $(OMEGA_DEV_SRC) $(OMEGA_RELEASE_SRC) - - $(EXPORT) $(PYTHON) -m unittest $(OMEGA_TESTS) - @ rm -rf $(STAGING_DIR) +CHILL_OBJS = $(CHILL_SRCS:.cc=.o) +CUDACHILL_OBJS = $(CUDACHILL_SRCS:.cc=.o) -.PHONY: test-core -test-core: $(STAGING_DIR_BIN) $(OMEGA_DEV_SRC) $(OMEGA_RELEASE_SRC) $(CHILL_DEV_SRC) $(CHILL_RELEASE_SRC) make-omega - - $(EXPORT) $(PYTHON) -m unittest $(CORE_TESTS) - @ rm -rf $(STAGING_DIR) +all: + $(MAKE) depend-chill + $(MAKE) chill + $(MAKE) depend-cuda-chill + $(MAKE) cuda-chill + + +# can't these be combined to a superset of all source files? +depend: depend-cuda-chill + +depend-chill: $(LIB_SRCS) $(RUNNER_SRCS) $(CHILL_RUNNER_SRCS) $(YACC_SRCS) + $(CC) $(DEPENDENCE_CFLAGS) $(INC_PATH) $(LIB_SRCS) $(RUNNER_SRCS) $(CHILL_RUNNER_SRCS) $(YACC_SRCS) > Makefile.deps + +depend-cuda-chill: $(LIB_SRCS) $(RUNNER_SRCS) $(CUDACHILL_RUNNER_SRCS) + $(CC) $(DEPENDENCE_CFLAGS) $(INC_PATH) $(LIB_SRCS) $(RUNNER_SRCS) $(CUDACHILL_RUNNER_SRCS) > Makefile.deps + +libchill_xform.a: $(LIB_OBJS) $(IR_CHILL_OBJS) + ar -rs $@ $(LIB_OBJS) $(IR_CHILL_OBJS) + +libcudachill_xform.a: $(LIB_OBJS) $(IR_CUDACHILL_OBJS) $(CUDACHILL_ONLY_OBJS) + ar -rs $@ $(LIB_OBJS) $(IR_CUDACHILL_OBJS) $(CUDACHILL_ONLY_OBJS) + +%.o: %.cc + $(CC) $(CFLAGS) $(INC_PATH) $< -c -o $@ + + +clean: + @rm -fr $(ALL_OBJS) $(YACC_SRCS) $(GENERATED_SRCS) + +veryclean: + @rm -fr $(ALL_OBJS) $(YACC_SRCS) libchill_xform.a libcudachill_xform.a chill cuda-chill + + +cuda-chill: libcudachill_xform.a $(CUDACHILL_RUNNER_OBJS) $(RUNNER_OBJS) + $(CC) $(CFLAGS) $(LIB_PATH) $(LUA_PATH) $(CUDACHILL_RUNNER_OBJS) $(RUNNER_OBJS) $< $(CORE_LIBS) $(ROSE_LIBS) $(RUNNER_LIBS) -o $@ + +ifeq ($(SCRIPT_LANG),lua) +chill: libchill_xform.a $(CHILL_RUNNER_OBJS) $(RUNNER_OBJS) $(YACC_OBJS) + $(CC) $(CFLAGS) $(LIB_PATH) $(LUA_PATH) $(YACC_OBJS) $(CHILL_RUNNER_OBJS) $(RUNNER_OBJS) $< $(CORE_LIBS) $(ROSE_LIBS) $(RUNNER_LIBS) -o $@ +else +ifeq ($(SCRIPT_LANG),python) +chill: libchill_xform.a $(CHILL_RUNNER_OBJS) $(RUNNER_OBJS) $(YACC_OBJS) + $(CC) $(CFLAGS) $(LIB_PATH) $(YACC_OBJS) $(CHILL_RUNNER_OBJS) $(RUNNER_OBJS) $< $(CORE_LIBS) $(ROSE_LIBS) $(RUNNER_LIBS) -o $@ + +else +chill: libchill_xform.a $(YACC_OBJS) + $(CC) $(CFLAGS) $(LIB_PATH) $(YACC_OBJS) $< $(CORE_LIBS) $(ROSE_LIBS) -o $@ +endif +endif -.PHONY: -test-core-%: $(STAGING_DIR_BIN) - - $(EXPORT) $(PYTHON) -m unittest unit-tests/test_$*.py +lex.yy.cc: parser.ll parser.tab.hh + flex++ parser.ll +lex.yy.o: lex.yy.cc + $(CC) $(CFLAGS) -c $< -o $@ -.PHONY: test-debug -debug: - @### NOTHING ### +parser.tab.hh parser.tab.cc: parser.yy + bison -t -d $< +parser.tab.o: parser.tab.cc + $(CC) $(CFLAGS) $(YACC_EXTRA_CFLAGS) $(INC_PATH) -DCHILL_BUILD_DATE="\"$(CHILL_BUILD_DATE)\"" -c $< -o $@ -### benchmarking (don't use if your're not me) ### -$(CHILL_DEV_TESTCASES_STDOUT): %.stdout: %.script - $(EXPORT) cd $(STAGING_DIR_WD); $(STAGING_DIR_BIN)/chill $< > $@ +parse_expr.tab.cc: parse_expr.yy + bison -t -d parse_expr.yy -.PHONY: benchmark-dev -benchmark-dev: test-chill $(CHILL_DEV_TESTCASES_STDOUT) - # do nothing +parse_expr.tab.o: parse_expr.tab.cc + $(CC) $(CFLAGS) $(YACC_CFLAGS) $(INC_PATH) -o $@ -c parse_expr.tab.cc +parse_expr.yy.cc: parse_expr.tab.cc parse_expr.ll + flex -o parse_expr.yy.cc parse_expr.ll -### checking out and making directories ### -$(STAGING_DIR_BIN): - mkdir -p $(STAGING_DIR_BIN) - mkdir -p $(STAGING_DIR_WD) +parse_expr.yy.o: parse_expr.yy.cc + $(CC) $(CFLAGS) $(YACC_CFLAGS) $(INC_PATH) -o $@ -c parse_expr.yy.cc -$(CHILL_DEV_SRC): $(OMEGA_DEV_SRC) $(STAGING_DIR_BIN) - svn export $(SVN_CHILL_DEV) $(CHILL_DEV_SRC) +$(RUNNER_SRCS:.cc=.o): %.o: %.cc + $(CC) $(CFLAGS) $(RUNNER_EXTRA_CFLAGS) $(INC_PATH) $(RUNNER_DEFINES) $< -c -o $@ -$(CHILL_RELEASE_SRC): $(OMEGA_RELEASE_SRC) $(STAGIN_DIR_BIN) - svn export $(SVN_CHILL_RELEASE) $(CHILL_RELEASE_SRC) +$(CHILL_RUNNER_SRCS:.cc=.o): %.o: %.cc + $(CC) $(CFLAGS) $(RUNNER_EXTRA_CFLAGS) $(INC_PATH) $(RUNNER_DEFINES) $< -c -o $@ -$(OMEGA_DEV_SRC): $(STAGING_DIR_BIN) - svn export $(SVN_OMEGA_DEV) $(OMEGA_DEV_SRC) - #cd $(OMEGA_DEV_SRC); $(MAKE) depend - #cd $(OMEGA_DEV_SRC); $(MAKE) +$(CUDACHILL_RUNNER_SRCS:.cc=.o): %.o %.cc + $(CC) $(CFLAGS) $(RUNNER_EXTRA_CFLAGS) $(INC_PATH) $(RUNNER_DEFINES) $< -c -o $@ -$(OMEGA_RELEASE_SRC): $(STAGING_DIR_BIN) - svn export $(SVN_OMEGA_RELEASE) $(OMEGA_RELEASE_SRC) - #cd $(OMEGA_RELEASE_SRC); $(MAKE) depend - #cd $(OMEGA_RELEASE_SRC): $(MAKE) -.PHONY: make-omega -make-omega: - cd $(OMEGA_DEV_SRC); $(MAKE) depend - cd $(OMEGA_DEV_SRC); $(MAKE) - cd $(OMEGA_RELEASE_SRC); $(MAKE) depend - cd $(OMEGA_RELEASE_SRC); $(MAKE) +$(IR_SRCS:.cc=.o): %.o: %.cc + $(CC) -Wno-write-strings $(CFLAGS) $(INC_PATH) $< -c -o $@ + +ifeq ($(shell test -f Makefile.deps && echo "true"), true) +include Makefile.deps +endif -#$(STAGING_DIR): -# mkdir -p $(STAGING_DIR) +CHILL_BUILD_DATE = $(shell date +%m/%d/%Y) diff --git a/test-chill/testchill/chill.py b/test-chill/testchill/chill.py index 0e30149..833d524 100644 --- a/test-chill/testchill/chill.py +++ b/test-chill/testchill/chill.py @@ -146,13 +146,12 @@ class BuildChillTestCase(test.TestCase): util.shell('rm', ['-f', '*.gcda'], wd=self.config.chill_dir) util.shell('make clean', wd=self.config.chill_dir) - util.shell('make veryclean', wd=self.config.chill_dir) def run(self): """ Build chill """ - util.shell('make', ['clean'], wd=self.config.chill_dir) + util.shell('make', ['distclean'], wd=self.config.chill_dir) util.shell('./configure', self.config.config_args, wd=self.config.chill_dir) util.shell('make', [], wd=self.config.chill_dir) -- cgit v1.2.3-70-g09d2 From b530622a9b2261b1e8a9c5202285d3928c97b893 Mon Sep 17 00:00:00 2001 From: dhuth Date: Mon, 13 Apr 2015 12:03:33 -0600 Subject: Revert "--" This reverts commit 2bebca1c3fe897fb681e1853d7d565ecb0be8b52. --- chill_run.cc | 9 +- configure.ac | 41 ++--- graph.hh | 2 +- test-chill/Makefile | 381 +++++++++++++++++++----------------------- test-chill/testchill/chill.py | 3 +- 5 files changed, 188 insertions(+), 248 deletions(-) (limited to 'configure.ac') diff --git a/chill_run.cc b/chill_run.cc index a3c9180..45d2345 100644 --- a/chill_run.cc +++ b/chill_run.cc @@ -359,7 +359,6 @@ int main( int argc, char* argv[] ) #endif #ifdef BUILD_ROSE ((IR_cudaroseCode *)(ir_code))->commit_loop(myloop, lnum); - ((IR_roseCode*)(ir_code))->finalizeRose(); #elif BUILD_SUIF ((IR_cudasuifCode *)(ir_code))->commit_loop(myloop, lnum); #endif @@ -375,16 +374,14 @@ int main( int argc, char* argv[] ) lnum_end = get_loop_num_end(L); DEBUG_PRINT("calling ROSE code gen? loop num %d - %d\n", lnum_start, lnum_end); #endif - +#endif #ifdef BUILD_ROSE finalize_loop(lnum_start, lnum_end); //((IR_roseCode*)(ir_cide))->commit_loop(myloop, lnum); ((IR_roseCode*)(ir_code))->finalizeRose(); - #elif BUILD_SUIF - ((IR_suifCode*)(ir_code))->commit_loop(myloop, lnum); + //#elif BUILD_SUIF + //((IR_suifCode*)(ir_code))->commit_loop(myloop, lnum); #endif - -#endif delete ir_code; } #ifdef PYTHON diff --git a/configure.ac b/configure.ac index f40c87c..6f79d1b 100644 --- a/configure.ac +++ b/configure.ac @@ -19,46 +19,35 @@ AM_PATH_PYTHON([2.7],[ [`${PYTHON} -c "from distutils import sysconfig; print(sysconfig.get_python_inc())"`]) AC_SUBST([PYTHON_LIBDIR], [`${PYTHON} -c "from distutils import sysconfig; print(sysconfig.get_config_var('LIBDIR'))"`]) - AC_SUBST([python_builds],[yes])],[ - AC_SUBST([python_builds],[no])]) + AC_SUBST([with_python],["yes"])],[ + AC_SUBST([with_python],["no"])]) -#AC_ARG_ENABLE([cuda],[ -# AS_HELP_STRING([--enable-cuda],[builds cudachill])],[ -# AS_IF([test "x$enableval" != xno],[ -# AC_SUBST([enable_cuda],[yes])])]) - AC_ARG_ENABLE([cuda],[ - AS_HELP_STRING([--enable-cuda],[builds cudachill]) - ],[ + AS_HELP_STRING([--enable-cuda],[builds cudachill])],[ AS_IF([test "x$enableval" != xno],[ - AC_SUBST([enable_cuda],[yes])])]) - + AC_SUBST([enable_cuda],[yes])],[])]) AM_CONDITIONAL([CUDACHILL_OPT],[test "x$enable_cuda" == xyes]) AC_ARG_ENABLE([coverage],[ - AS_HELP_STRING([--enable-coverage],[enables coverage testing]) - ],[ + AS_HELP_STRING([--enable-coverage],[enables coverage testing])],[ + AS_IF(["x$enableval" != xno],[ AC_SUBST([enable_coverage],[yes]) AC_SUBST([CFLAGS],["-g -fprofile-arcs -ftest-coverage"]) AC_SUBST([CPPFLAGS],["-g -fprofile-arcs -ftest-coverage"])],[])]) AC_ARG_WITH([rose],[ - AS_HELP_STRING([--with-rose],[set rose home]) - ],[ + AS_HELP_STRING([--with-rose],[set rose home])],[ AC_SUBST([ROSEHOME], [$withval]) - AC_DEFINE([BUILD_ROSE],[],[Use ROSE]) - ],[ + AC_DEFINE([BUILD_ROSE],[],[Use ROSE])],[ AC_SUBST([ROSEHOME], ["${ROSEHOME}"]) AC_DEFINE([BUILD_ROSE],[],[Use ROSE])]) AC_ARG_WITH([boost],[ - AS_HELP_STRING([--with-boost],[set boost home]) - ],[ - AC_SUBST([BOOSTHOME], [$withval]) - ],[ + AS_HELP_STRING([--with-boost],[set boost home])],[ + AC_SUBST([BOOSTHOME], [$withval])],[ AC_SUBST([BOOSTHOME], ["${BOOSTHOME}"])]) AC_ARG_WITH([omega],[ @@ -67,8 +56,7 @@ AC_ARG_WITH([omega],[ AC_SUBST([OMEGAHOME], ["$(pwd)/omega"])]) AC_ARG_WITH([python],[ - AS_HELP_STRING([--with-python],[set python as the interface languge]) - ],[ + AS_HELP_STRING([--with-python],[set python as the interface languge])],[ AC_SUBST([interface_lang],[python]) ],[ AC_SUBST([interface_lang],[default])]) @@ -80,18 +68,13 @@ AC_ARG_WITH([lua],[ ],[ AC_SUBST([LUAHOME], ["${LUAHOME}"])]) -AC_ARG_WITH([script],[ - AS_HELP_STRING([--with-script],[set the legacy scripting language as the interface language (CHiLL only)]), - ],[ - AC_SUBST([interface_lang],[default])]) - #AC_ARG_WITH([interface],[ # AS_HELP_STRING([--with-interface],[select interface language])],[ # AC_SUBST([interface_lang],[$withval])],[ # AC_SUBST([interface_lang],[default])]) AS_IF([test "x$interface_lang" == xdefault],[ - AS_IF([test "x$enable_cuda" == xyes],[ + AS_IF([test "x$enable_cuda" != xno],[ AC_SUBST([use_python],[no]) AC_SUBST([use_lua],[yes]) ],[ diff --git a/graph.hh b/graph.hh index a7b80e9..504c147 100644 --- a/graph.hh +++ b/graph.hh @@ -76,7 +76,7 @@ template std::ostream& operator<<(std::ostream &os, const Graph &g) { for (int i = 0; i < g.vertex.size(); i++) for (typename Graph::EdgeList::const_iterator j = g.vertex[i].second.begin(); j != g.vertex[i].second.end(); j++) { - os << "s" << i << "->" << j->first << ":"; + os << i+1 << "->" << j->first+1 << ":"; for (typename std::vector::const_iterator k = j->second.begin(); k != j->second.end(); k++) os << " " << *k; os << std::endl; diff --git a/test-chill/Makefile b/test-chill/Makefile index 7f2c8b5..d7238e8 100644 --- a/test-chill/Makefile +++ b/test-chill/Makefile @@ -1,251 +1,210 @@ - -.SUFFIXES: -.PHONY: all depend depend-cuda-chill clean veryclean cuda-chill -.PHONY: chill - -CC = g++ -CFLAGS = -g -Wno-write-strings -DEPENDENCE_CFLAGS = -M -OMEGAHOME=./omega - -ifdef TEST_COVERAGE - CFLAGS := $(CFLAGS) -fprofile-arcs -ftest-coverage -endif - -# TODO auto-generate using config.h generated by autoconf? -CHILLVERSION = "\"0.2.0\"" -PYTHON=python #=$(shell `which python` ) -PYVERSION=$(shell $(PYTHON) -c "import sys; print(sys.version[:3])") # 2.6 -PYTHONVER = python$(PYVERSION) -PYTHONINCLUDE = $(shell $(PYTHON) -c "from distutils import sysconfig; print(sysconfig.get_python_inc())") -PYTHONLIBDIR = $(shell $(PYTHON) -c "from distutils import sysconfig; print(sysconfig.get_config_var('LIBDIR'))") -PYTHONCONFIG = $(shell $(PYTHON) -c "from distutils import sysconfig; print(sysconfig.get_config_var('LIBPL'))") -# SCRIPT_LANG = lua <-- supplied by the command line - - -# this creates a LUAHOME even if you don't have such a directory -ifeq ($(strip $(wildcard $(LUAHOME))),) -LUAHOME = $(HOME)/lua -endif -LUA_PATH = -L${LUAHOME}/lib - - -# where do include files live -INC_PATH = -I${PYTHONINCLUDE} -I${OMEGAHOME}/include -I${LUAHOME}/include - -# where do libraries live -LIB_PATH = -L${OMEGAHOME}/code_gen/obj -L${OMEGAHOME}/omega_lib/obj -# seemingly not needed -L${PYTHONCONFIG} - - - -CORE_LIBS = -lm -lcodegen -lomega -RUNNER_LIBS = -llua -ldl -lreadline -lhistory -lpthread -ldl -lutil -lm -l${PYTHONVER} - -TDLHOME = ${ROSEHOME}/libltdl - -BOOST_DATE_TIME_LIB = -lboost_date_time -BOOST_FILESYSTEM_LIB = -lboost_filesystem -BOOST_LDFLAGS = -L${BOOSTHOME}/lib -BOOST_PROGRAM_OPTIONS_LIB = -lboost_program_options -BOOST_REGEX_LIB = -lboost_regex -BOOST_SYSTEM_LIB = -lboost_system -BOOST_THREAD_LIB = -lboost_thread -BOOST_WAVE_LIB = -lboost_wave - -ROSE_LIBS = -lrose $(BOOST_LDFLAGS) $(BOOST_DATE_TIME_LIB)\ - $(BOOST_THREAD_LIB) $(BOOST_FILESYSTEM_LIB) $(BOOST_PROGRAM_OPTIONS_LIB)\ - $(BOOST_REGEX_LIB) $(BOOST_SYSTEM_LIB) $(BOOST_SERIALIZATION_LIB) \ - $(BOOST_WAVE_LIB) -lrt -ldl - - -# Source files common to both chill and cuda-chill -CORE_SRCS = dep.cc omegatools.cc irtools.cc loop.cc loop_basic.cc loop_datacopy.cc loop_unroll.cc loop_tile.cc loop_extra.cc -LIB_SRCS = $(CORE_SRCS) - -# files that will be generated by bison, flex, and make that need to be removed at clean. -GENERATED_SRCS = parser.tab.hh parser.tab.cc parse_expr.yy.cc parse_expr.ll.hh parse_expr.tab.cc parse_expr.tab.hh Makefile.deps -# object files that are specific to lua or python builds. -- This is used so that SCRIPT_LANG does not need to be specified during clean -ORPHAN_OBJS = chill_run_util.o chillmodule.o parse_expr.tab.o parse_expr.yy.o - -# files used in chill and cuda-chill interfaces -ifeq ($(SCRIPT_LANG),lua) - RUNNER_SRCS = chill_run.cc chill_env.cc -else - ifeq ($(SCRIPT_LANG),python) - RUNNER_SRCS = chill_run.cc chillmodule.cc - else - RUNNER_SRCS = chill_run.cc chill_env.cc - endif +### ### +### SVN variables ### +### ### +SVN_USER=dhuth + +### ### +### Notification ### +### (not implemented yet) ### +NOTIFY_ON_FAILURE=False + + + +### Derived variables from config ### +CHILLHOME?=$(STAGING_DIR)/chill +SVN_CHILL=svn+ssh://$(SVN_USER)@shell.cs.utah.edu/uusoc/facility/res/hallresearch/svn_repo/resRepo/projects/chill +SVN_CHILL_DEV=$(SVN_CHILL)/branches/cuda-chill-rose +SVN_CHILL_RELEASE=$(SVN_CHILL)/release +CHILL_DEV_SRC=$(STAGING_DIR)/chill-dev +CHILL_RELEASE_SRC=$(STAGING_DIR)/chill-release +OMEGAHOME?=$(STAGING_DIR)/omega +SVN_OMEGA=svn+ssh://$(SVN_USER)@shell.cs.utah.edu/uusoc/facility/res/hallresearch/svn_repo/resRepo/projects/omega +SVN_OMEGA_DEV=$(SVN_OMEGA)/branches/cuda-omega-rose +SVN_OMEGA_RELEASE=$(SVN_OMEGA)/release +OMEGA_DEV_SRC=$(STAGING_DIR)/omega-dev +OMEGA_RELEASE_SRC=$(STAGING_DIR)/omega-release + + +### Staging ### +STAGING_DIR=$(shell pwd)/.staging +STAGING_DIR_BIN=$(STAGING_DIR)/bin +STAGING_DIR_WD=$(STAGING_DIR)/wd + + +### Local ### +UNIT_TEST_DIR=$(shell pwd)/unit-tests/ +CHILL_DEV_TESTCASE_DIR=$(shell pwd)/test-cases/chill +CHILL_DEV_TESTCASES_SCRIPT=$(shell find $(CHILL_DEV_TESTCASE_DIR) -name "*.script") +CHILL_DEV_TESTCASES_STDOUT=$(patsubst %.script,%.stdout,$(CHILL_DEV_TESTCASES_SCRIPT)) + +### Python environment variables ### +PYTHON_2:=$(shell which python) +PYTHON_3:=$(shell which python3) + +ifneq ($(PYTHON_3),) +PYTHON_3_VERSION=$(shell $(PYTHON_3) -c "import sysconfig; print(sysconfig.get_config_var('VERSION'))") endif - -# files used in chill but not cuda-chill -IR_CHILL_SRCS = ir_rose.cc ir_rose_utils.cc -ifeq ($(SCRIPT_LANG),lua) - YACC_SRCS = parse_expr.yy.cc parse_expr.tab.cc - CHILL_RUNNER_SRCS = chill_run_util.cc - CHILL_SRCS = $(CORE_SRCS) $(IR_CHILL_SRCS) $(CHILL_RUNNER_SRCS) $(RUNNER_SRCS) -else - ifeq ($(SCRIPT_LANG),python) - YACC_SRCS = parse_expr.yy.cc parse_expr.tab.cc - CHILL_RUNNER_SRCS = chill_run_util.cc - CHILL_SRCS = $(CORE_SRCS) $(IR_CHILL_SRCS) $(CHILL_RUNNER_SRCS) $(RUNNER_SRCS) - else - YACC_SRCS = lex.yy.cc parser.tab.cc - CHILL_RUNNER_SRCS = - CHILL_SRCS = $(CORE_SRCS) $(IR_CHILL_SRCS) $(YACC_SRCS) $(RUNNER_SRCS) - endif +PYTHON_2_VERSION=$(shell $(PYTHON_2) -c "import sysconfig; print sysconfig.get_config_var('VERSION')") +PYTHON_VERSION=$(firstword $(PYTHON_3_VERSION) $(PYTHON_2_VERSION)) +PYTHON=$(shell which python$(PYTHON_VERSION)) +### ---------------------------- ### + + +EXPORT=export CHILL_DEV_SRC=$(CHILL_DEV_SRC); \ + export CHILL_RELEASE_SRC=$(CHILL_RELEASE_SRC); \ + export OMEGA_DEV_SRC=$(OMEGA_DEV_SRC); \ + export OMEGA_RELEASE_SRC=$(OMEGA_RELEASE_SRC); \ + export STAGING_DIR_BIN=$(STAGING_DIR_BIN); \ + export STAGING_DIR_WD=$(STAGING_DIR_WD); + +### deump environment ### +# define quiet to shut this part up # +ifndef quiet +$(info notify on failure? $(NOTIFY_ON_FAILURE)) +$(info staging directory $(STAGING_DIR)) +$(info binary directory $(STAGING_DIR_BIN)) +$(info working directory $(STAGING_DIR_WD)) +$(info omega home $(OMEGAHOME)) +$(info chill home $(CHILLHOME)) +$(info chill svn dev repo $(SVN_CHILL_DEV)) +$(info chill svn release repo $(SVN_CHILL_RELEASE)) +$(info chill dev src $(CHILL_DEV_SRC)) +$(info chill release src $(CHILL_RELEASE_SRC)) +$(info omega svn dev repo $(SVN_OMEGA_DEV)) +$(info omega svn release repo $(SVN_OMEGA_RELEASE)) +$(info omega dev src $(OMEGA_DEV_SRC)) +$(info omega release src $(OMEGA_RELEASE_SRC)) +$(info python $(PYTHON)) +$(info unit tests $(UNIT_TEST_DIR)) +#$(info chill-dev test cases $(CHILL_DEV_TESTCASES_SCRIPT)) +#$(info chill-dev test case stdouts $(CHILL_DEV_TESTCASES_STDOUT)) endif +### ----------------- ### -# source files for cuda-chill but not chill -CUDACHILL_ONLY_SRCS = mem_mapping_utils.cc loop_cuda_rose.cc -IR_CUDACHILL_SRCS = ir_rose.cc ir_rose_utils.cc ir_cudarose.cc ir_cuda_rose_utils.cc -CUDACHILL_RUNNER_SRCS = -CUDACHILL_SRCS = $(CORE_SRCS) $(CUDACHILL_ONLY_SRCS) $(IR_CUDACHILL_SRCS) $(RUNNER_SRCS) $(CUDACHILL_RUNNER_SRCS) - -# set interface language flags -ifeq ($(SCRIPT_LANG),lua) - RUNNER_EXTRA_CFLAGS = -DLUA -else - ifeq ($(SCRIPT_LANG),python) - RUNNER_EXTRA_CFLAGS = -DPYTHON - endif -endif - -depend-cuda-chill: CFLAGS := $(CFLAGS) -DCUDACHILL -cuda-chill: CFLAGS := $(CFLAGS) -DCUDACHILL - -ALL_SRCS = $(CORE_SRCS) $(YACC_SRCS) $(IR_CHILL_SRCS) $(CUDACHILL_ONLY_SRCS) $(IR_CUDACHILL_SRCS) $(RUNNER_SRCS) $(CHILL_RUNNER_SRCS) $(CUDACHILL_RUNNER_SRCS) -ALL_OBJS = $(ALL_SRCS:.cc=.o) $(ORPHAN_OBJS) - -RUNNER_DEFINES = -DLUA_USE_LINUX -DCHILL_BUILD_VERSION=$(CHILLVERSION) -DCHILL_BUILD_DATE="\"$(CHILL_BUILD_DATE)\"" - - -YACC_EXTRA_CFLAGS = - -##################################################################### -# compiler intermediate code specific definitions -##################################################################### - +DIRTY_EXTS=pyc o log pickle +DIRTY_FILES=$(foreach de,$(DIRTY_EXTS),$(shell find . -name "*.$(de)")) +DIRTY_DIRS=$(shell find . -name '__pycache__' -and -type d) $(STAGING_DIR) pylang coverage_report +CORE_TESTS:=_extract util gcov _cpp_validate_env cpp_validate test __main__ +OMEGA_TESTS:=omega +CHILL_TESTS:=chill -#LIBS := $(LIBS) $(ROSE_LIBS) -LIB_PATH := $(LIB_PATH) -L${ROSEHOME}/lib -L${TDLHOME} -#LIB_SRCS := $(LIB_SRCS) # $(IR_SRCS) -INC_PATH := $(INC_PATH) -I${ROSEHOME}/include -I${BOOSTHOME}/include -YACC_EXTRA_CFLAGS := -DBUILD_ROSE -RUNNER_EXTRA_CFLAGS := $(RUNNER_EXTRA_CFLAGS) -DBUILD_ROSE +CORE_TESTS:=$(addsuffix .py,$(addprefix unit-tests/test_,$(CORE_TESTS))) +OMEGA_TESTS:=$(addsuffix .py,$(addprefix unit-tests/test_,$(OMEGA_TESTS))) +CHILL_TESTS:=$(addsuffix .py,$(addprefix unit-tests/test_,$(CHILL_TESTS))) - -##################################################################### -# build rules -##################################################################### - -YACC_OBJS = $(YACC_SRCS:.cc=.o) -RUNNER_OBJS = $(RUNNER_SRCS:.cc=.o) -CHILL_RUNNER_OBJS = $(CHILL_RUNNER_SRCS:.cc=.o) -CUDACHILL_RUNNER_OBJS = $(CUDACHILL_RUNNER_SRCS:.cc=.o) -LIB_OBJS = $(LIB_SRCS:.cc=.o) -IR_CHILL_OBJS = $(IR_CHILL_SRCS:.cc=.o) -IR_CUDACHILL_OBJS = $(IR_CUDACHILL_SRCS:.cc=.o) -CUDACHILL_ONLY_OBJS = $(CUDACHILL_ONLY_SRCS:.cc=.o) - -CHILL_OBJS = $(CHILL_SRCS:.cc=.o) -CUDACHILL_OBJS = $(CUDACHILL_SRCS:.cc=.o) +### The all target ### +.PHONY: all +all: + $(MAKE) clean quiet=1 + $(MAKE) install quiet=1 -all: - $(MAKE) depend-chill - $(MAKE) chill - $(MAKE) depend-cuda-chill - $(MAKE) cuda-chill +### This will install the chill_test module ### +.PHONY: install +install: pylang + $(PYTHON) makeparser.py + #TODO: maybe run a setup or something -# can't these be combined to a superset of all source files? -depend: depend-cuda-chill -depend-chill: $(LIB_SRCS) $(RUNNER_SRCS) $(CHILL_RUNNER_SRCS) $(YACC_SRCS) - $(CC) $(DEPENDENCE_CFLAGS) $(INC_PATH) $(LIB_SRCS) $(RUNNER_SRCS) $(CHILL_RUNNER_SRCS) $(YACC_SRCS) > Makefile.deps +### This will uninstall teh chill_test module ### +.PHONY: uninstall +uninstall: + #TODO: can python modules be uninstalled? -depend-cuda-chill: $(LIB_SRCS) $(RUNNER_SRCS) $(CUDACHILL_RUNNER_SRCS) - $(CC) $(DEPENDENCE_CFLAGS) $(INC_PATH) $(LIB_SRCS) $(RUNNER_SRCS) $(CUDACHILL_RUNNER_SRCS) > Makefile.deps -libchill_xform.a: $(LIB_OBJS) $(IR_CHILL_OBJS) - ar -rs $@ $(LIB_OBJS) $(IR_CHILL_OBJS) -libcudachill_xform.a: $(LIB_OBJS) $(IR_CUDACHILL_OBJS) $(CUDACHILL_ONLY_OBJS) - ar -rs $@ $(LIB_OBJS) $(IR_CUDACHILL_OBJS) $(CUDACHILL_ONLY_OBJS) +### Simply removes all files listed in DIRTY_FILES ### +.PHONY: clean +clean: + rm -rf $(DIRTY_FILES) + rm -rf $(DIRTY_DIRS) -%.o: %.cc - $(CC) $(CFLAGS) $(INC_PATH) $< -c -o $@ +pylang: + git clone https://github.com/dhuth/pylang.git pylang-tmp + $(PYTHON) pylang-tmp/make_grammar_parsers.py + cp -r pylang-tmp/pylang pylang + rm -rf pylang-tmp -clean: - @rm -fr $(ALL_OBJS) $(YACC_SRCS) $(GENERATED_SRCS) +### Test the test harness ### +.PHONY: test +test: $(STAGING_DIR_BIN) $(OMEGA_DEV_SRC) $(OMEGA_RELEASE_SRC) $(CHILL_DEV_SRC) $(CHILL_RELEASE_SRC) + @echo "-----------------------------------------------------------" + @echo "Note: This target tests the test suite it's self, not chill" + @echo "To test chill, run python -m testchill ..." + @echo "-----------------------------------------------------------" + - $(EXPORT) $(PYTHON) -m unittest $(OMEGA_TESTS) $(CORE_TESTS) $(CHILL_TESTS) + @ rm -rf $(STAGING_DIR) -veryclean: - @rm -fr $(ALL_OBJS) $(YACC_SRCS) libchill_xform.a libcudachill_xform.a chill cuda-chill +.PHONY: test-chill +test-chill: $(STAGING_DIR_BIN) $(OMEGA_DEV_SRC) $(OMEGA_RELEASE_SRC) $(CHILL_DEV_SRC) $(CHILL_RELEASE_SRC) + - $(EXPORT) $(PYTHON) -m unittest $(OMEGA_TESTS) $(CHILL_TESTS) + @ rm -rf $(STAGING_DIR) -cuda-chill: libcudachill_xform.a $(CUDACHILL_RUNNER_OBJS) $(RUNNER_OBJS) - $(CC) $(CFLAGS) $(LIB_PATH) $(LUA_PATH) $(CUDACHILL_RUNNER_OBJS) $(RUNNER_OBJS) $< $(CORE_LIBS) $(ROSE_LIBS) $(RUNNER_LIBS) -o $@ -ifeq ($(SCRIPT_LANG),lua) -chill: libchill_xform.a $(CHILL_RUNNER_OBJS) $(RUNNER_OBJS) $(YACC_OBJS) - $(CC) $(CFLAGS) $(LIB_PATH) $(LUA_PATH) $(YACC_OBJS) $(CHILL_RUNNER_OBJS) $(RUNNER_OBJS) $< $(CORE_LIBS) $(ROSE_LIBS) $(RUNNER_LIBS) -o $@ -else -ifeq ($(SCRIPT_LANG),python) -chill: libchill_xform.a $(CHILL_RUNNER_OBJS) $(RUNNER_OBJS) $(YACC_OBJS) - $(CC) $(CFLAGS) $(LIB_PATH) $(YACC_OBJS) $(CHILL_RUNNER_OBJS) $(RUNNER_OBJS) $< $(CORE_LIBS) $(ROSE_LIBS) $(RUNNER_LIBS) -o $@ +.PHONY: test-omega +test-omega: $(STAGING_DIR_BIN) $(OMEGA_DEV_SRC) $(OMEGA_RELEASE_SRC) + - $(EXPORT) $(PYTHON) -m unittest $(OMEGA_TESTS) + @ rm -rf $(STAGING_DIR) -else -chill: libchill_xform.a $(YACC_OBJS) - $(CC) $(CFLAGS) $(LIB_PATH) $(YACC_OBJS) $< $(CORE_LIBS) $(ROSE_LIBS) -o $@ -endif -endif +.PHONY: test-core +test-core: $(STAGING_DIR_BIN) $(OMEGA_DEV_SRC) $(OMEGA_RELEASE_SRC) $(CHILL_DEV_SRC) $(CHILL_RELEASE_SRC) make-omega + - $(EXPORT) $(PYTHON) -m unittest $(CORE_TESTS) + @ rm -rf $(STAGING_DIR) -lex.yy.cc: parser.ll parser.tab.hh - flex++ parser.ll -lex.yy.o: lex.yy.cc - $(CC) $(CFLAGS) -c $< -o $@ +.PHONY: +test-core-%: $(STAGING_DIR_BIN) + - $(EXPORT) $(PYTHON) -m unittest unit-tests/test_$*.py -parser.tab.hh parser.tab.cc: parser.yy - bison -t -d $< -parser.tab.o: parser.tab.cc - $(CC) $(CFLAGS) $(YACC_EXTRA_CFLAGS) $(INC_PATH) -DCHILL_BUILD_DATE="\"$(CHILL_BUILD_DATE)\"" -c $< -o $@ +.PHONY: test-debug +debug: + @### NOTHING ### -parse_expr.tab.cc: parse_expr.yy - bison -t -d parse_expr.yy +### benchmarking (don't use if your're not me) ### +$(CHILL_DEV_TESTCASES_STDOUT): %.stdout: %.script + $(EXPORT) cd $(STAGING_DIR_WD); $(STAGING_DIR_BIN)/chill $< > $@ -parse_expr.tab.o: parse_expr.tab.cc - $(CC) $(CFLAGS) $(YACC_CFLAGS) $(INC_PATH) -o $@ -c parse_expr.tab.cc -parse_expr.yy.cc: parse_expr.tab.cc parse_expr.ll - flex -o parse_expr.yy.cc parse_expr.ll +.PHONY: benchmark-dev +benchmark-dev: test-chill $(CHILL_DEV_TESTCASES_STDOUT) + # do nothing -parse_expr.yy.o: parse_expr.yy.cc - $(CC) $(CFLAGS) $(YACC_CFLAGS) $(INC_PATH) -o $@ -c parse_expr.yy.cc -$(RUNNER_SRCS:.cc=.o): %.o: %.cc - $(CC) $(CFLAGS) $(RUNNER_EXTRA_CFLAGS) $(INC_PATH) $(RUNNER_DEFINES) $< -c -o $@ +### checking out and making directories ### +$(STAGING_DIR_BIN): + mkdir -p $(STAGING_DIR_BIN) + mkdir -p $(STAGING_DIR_WD) -$(CHILL_RUNNER_SRCS:.cc=.o): %.o: %.cc - $(CC) $(CFLAGS) $(RUNNER_EXTRA_CFLAGS) $(INC_PATH) $(RUNNER_DEFINES) $< -c -o $@ +$(CHILL_DEV_SRC): $(OMEGA_DEV_SRC) $(STAGING_DIR_BIN) + svn export $(SVN_CHILL_DEV) $(CHILL_DEV_SRC) -$(CUDACHILL_RUNNER_SRCS:.cc=.o): %.o %.cc - $(CC) $(CFLAGS) $(RUNNER_EXTRA_CFLAGS) $(INC_PATH) $(RUNNER_DEFINES) $< -c -o $@ +$(CHILL_RELEASE_SRC): $(OMEGA_RELEASE_SRC) $(STAGIN_DIR_BIN) + svn export $(SVN_CHILL_RELEASE) $(CHILL_RELEASE_SRC) +$(OMEGA_DEV_SRC): $(STAGING_DIR_BIN) + svn export $(SVN_OMEGA_DEV) $(OMEGA_DEV_SRC) + #cd $(OMEGA_DEV_SRC); $(MAKE) depend + #cd $(OMEGA_DEV_SRC); $(MAKE) -$(IR_SRCS:.cc=.o): %.o: %.cc - $(CC) -Wno-write-strings $(CFLAGS) $(INC_PATH) $< -c -o $@ +$(OMEGA_RELEASE_SRC): $(STAGING_DIR_BIN) + svn export $(SVN_OMEGA_RELEASE) $(OMEGA_RELEASE_SRC) + #cd $(OMEGA_RELEASE_SRC); $(MAKE) depend + #cd $(OMEGA_RELEASE_SRC): $(MAKE) -ifeq ($(shell test -f Makefile.deps && echo "true"), true) -include Makefile.deps -endif +.PHONY: make-omega +make-omega: + cd $(OMEGA_DEV_SRC); $(MAKE) depend + cd $(OMEGA_DEV_SRC); $(MAKE) + cd $(OMEGA_RELEASE_SRC); $(MAKE) depend + cd $(OMEGA_RELEASE_SRC); $(MAKE) -CHILL_BUILD_DATE = $(shell date +%m/%d/%Y) +#$(STAGING_DIR): +# mkdir -p $(STAGING_DIR) diff --git a/test-chill/testchill/chill.py b/test-chill/testchill/chill.py index 833d524..0e30149 100644 --- a/test-chill/testchill/chill.py +++ b/test-chill/testchill/chill.py @@ -146,12 +146,13 @@ class BuildChillTestCase(test.TestCase): util.shell('rm', ['-f', '*.gcda'], wd=self.config.chill_dir) util.shell('make clean', wd=self.config.chill_dir) + util.shell('make veryclean', wd=self.config.chill_dir) def run(self): """ Build chill """ - util.shell('make', ['distclean'], wd=self.config.chill_dir) + util.shell('make', ['clean'], wd=self.config.chill_dir) util.shell('./configure', self.config.config_args, wd=self.config.chill_dir) util.shell('make', [], wd=self.config.chill_dir) -- cgit v1.2.3-70-g09d2 From f0909ea6373f7f01271b1a6707e8022188d885fe Mon Sep 17 00:00:00 2001 From: dhuth Date: Mon, 13 Apr 2015 12:09:42 -0600 Subject: -- --- chill_run.cc | 9 ++++++--- configure.ac | 36 ++++++++++++++++++++++++------------ graph.hh | 2 +- test-chill/testchill/chill.py | 3 +-- 4 files changed, 32 insertions(+), 18 deletions(-) (limited to 'configure.ac') diff --git a/chill_run.cc b/chill_run.cc index 45d2345..a3c9180 100644 --- a/chill_run.cc +++ b/chill_run.cc @@ -359,6 +359,7 @@ int main( int argc, char* argv[] ) #endif #ifdef BUILD_ROSE ((IR_cudaroseCode *)(ir_code))->commit_loop(myloop, lnum); + ((IR_roseCode*)(ir_code))->finalizeRose(); #elif BUILD_SUIF ((IR_cudasuifCode *)(ir_code))->commit_loop(myloop, lnum); #endif @@ -374,14 +375,16 @@ int main( int argc, char* argv[] ) lnum_end = get_loop_num_end(L); DEBUG_PRINT("calling ROSE code gen? loop num %d - %d\n", lnum_start, lnum_end); #endif -#endif + #ifdef BUILD_ROSE finalize_loop(lnum_start, lnum_end); //((IR_roseCode*)(ir_cide))->commit_loop(myloop, lnum); ((IR_roseCode*)(ir_code))->finalizeRose(); - //#elif BUILD_SUIF - //((IR_suifCode*)(ir_code))->commit_loop(myloop, lnum); + #elif BUILD_SUIF + ((IR_suifCode*)(ir_code))->commit_loop(myloop, lnum); #endif + +#endif delete ir_code; } #ifdef PYTHON diff --git a/configure.ac b/configure.ac index 6f79d1b..dd89225 100644 --- a/configure.ac +++ b/configure.ac @@ -19,35 +19,46 @@ AM_PATH_PYTHON([2.7],[ [`${PYTHON} -c "from distutils import sysconfig; print(sysconfig.get_python_inc())"`]) AC_SUBST([PYTHON_LIBDIR], [`${PYTHON} -c "from distutils import sysconfig; print(sysconfig.get_config_var('LIBDIR'))"`]) - AC_SUBST([with_python],["yes"])],[ - AC_SUBST([with_python],["no"])]) + AC_SUBST([python_builds],[yes])],[ + AC_SUBST([python_builds],[no])]) +#AC_ARG_ENABLE([cuda],[ +# AS_HELP_STRING([--enable-cuda],[builds cudachill])],[ +# AS_IF([test "x$enableval" != xno],[ +# AC_SUBST([enable_cuda],[yes])])]) + AC_ARG_ENABLE([cuda],[ - AS_HELP_STRING([--enable-cuda],[builds cudachill])],[ + AS_HELP_STRING([--enable-cuda],[builds cudachill]) + ],[ AS_IF([test "x$enableval" != xno],[ - AC_SUBST([enable_cuda],[yes])],[])]) + AC_SUBST([enable_cuda],[yes])])]) + AM_CONDITIONAL([CUDACHILL_OPT],[test "x$enable_cuda" == xyes]) AC_ARG_ENABLE([coverage],[ - AS_HELP_STRING([--enable-coverage],[enables coverage testing])],[ - + AS_HELP_STRING([--enable-coverage],[enables coverage testing]) + ],[ AS_IF(["x$enableval" != xno],[ AC_SUBST([enable_coverage],[yes]) AC_SUBST([CFLAGS],["-g -fprofile-arcs -ftest-coverage"]) AC_SUBST([CPPFLAGS],["-g -fprofile-arcs -ftest-coverage"])],[])]) AC_ARG_WITH([rose],[ - AS_HELP_STRING([--with-rose],[set rose home])],[ + AS_HELP_STRING([--with-rose],[set rose home]) + ],[ AC_SUBST([ROSEHOME], [$withval]) - AC_DEFINE([BUILD_ROSE],[],[Use ROSE])],[ + AC_DEFINE([BUILD_ROSE],[],[Use ROSE]) + ],[ AC_SUBST([ROSEHOME], ["${ROSEHOME}"]) AC_DEFINE([BUILD_ROSE],[],[Use ROSE])]) AC_ARG_WITH([boost],[ - AS_HELP_STRING([--with-boost],[set boost home])],[ - AC_SUBST([BOOSTHOME], [$withval])],[ + AS_HELP_STRING([--with-boost],[set boost home]) + ],[ + AC_SUBST([BOOSTHOME], [$withval]) + ],[ AC_SUBST([BOOSTHOME], ["${BOOSTHOME}"])]) AC_ARG_WITH([omega],[ @@ -56,7 +67,8 @@ AC_ARG_WITH([omega],[ AC_SUBST([OMEGAHOME], ["$(pwd)/omega"])]) AC_ARG_WITH([python],[ - AS_HELP_STRING([--with-python],[set python as the interface languge])],[ + AS_HELP_STRING([--with-python],[set python as the interface languge]) + ],[ AC_SUBST([interface_lang],[python]) ],[ AC_SUBST([interface_lang],[default])]) @@ -74,7 +86,7 @@ AC_ARG_WITH([lua],[ # AC_SUBST([interface_lang],[default])]) AS_IF([test "x$interface_lang" == xdefault],[ - AS_IF([test "x$enable_cuda" != xno],[ + AS_IF([test "x$enable_cuda" == xyes],[ AC_SUBST([use_python],[no]) AC_SUBST([use_lua],[yes]) ],[ diff --git a/graph.hh b/graph.hh index 504c147..5d0ff66 100644 --- a/graph.hh +++ b/graph.hh @@ -76,7 +76,7 @@ template std::ostream& operator<<(std::ostream &os, const Graph &g) { for (int i = 0; i < g.vertex.size(); i++) for (typename Graph::EdgeList::const_iterator j = g.vertex[i].second.begin(); j != g.vertex[i].second.end(); j++) { - os << i+1 << "->" << j->first+1 << ":"; + os << "s" << i << "->" << "s" << j->first << ":"; for (typename std::vector::const_iterator k = j->second.begin(); k != j->second.end(); k++) os << " " << *k; os << std::endl; diff --git a/test-chill/testchill/chill.py b/test-chill/testchill/chill.py index 0e30149..833d524 100644 --- a/test-chill/testchill/chill.py +++ b/test-chill/testchill/chill.py @@ -146,13 +146,12 @@ class BuildChillTestCase(test.TestCase): util.shell('rm', ['-f', '*.gcda'], wd=self.config.chill_dir) util.shell('make clean', wd=self.config.chill_dir) - util.shell('make veryclean', wd=self.config.chill_dir) def run(self): """ Build chill """ - util.shell('make', ['clean'], wd=self.config.chill_dir) + util.shell('make', ['distclean'], wd=self.config.chill_dir) util.shell('./configure', self.config.config_args, wd=self.config.chill_dir) util.shell('make', [], wd=self.config.chill_dir) -- cgit v1.2.3-70-g09d2 From 99c7763aa1b7893e60b96d46ff39e5a22925738e Mon Sep 17 00:00:00 2001 From: dhuth Date: Tue, 28 Apr 2015 15:11:37 -0600 Subject: bug fix in test-chill and configure.ac --- configure.ac | 2 +- test-chill/testchill/__main__.py | 90 ++++++++++++++++++++-------------------- test-chill/testchill/chill.py | 2 +- 3 files changed, 46 insertions(+), 48 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index dd89225..6174151 100644 --- a/configure.ac +++ b/configure.ac @@ -76,7 +76,7 @@ AC_ARG_WITH([python],[ AC_ARG_WITH([lua],[ AS_HELP_STRING([--with-lua],[set lua as the interface langauge.])],[ AC_SUBST([LUAHOME], ["${LUAHOME}"]) - AC_SUBST([interfae_lang], [lua]) + AC_SUBST([interface_lang], [lua]) ],[ AC_SUBST([LUAHOME], ["${LUAHOME}"])]) diff --git a/test-chill/testchill/__main__.py b/test-chill/testchill/__main__.py index 01fee78..86415c3 100644 --- a/test-chill/testchill/__main__.py +++ b/test-chill/testchill/__main__.py @@ -40,52 +40,52 @@ def make_local(argsns, arg_parser): for tc in make_batch_testcaselist(argsns, arg_parser, batch_file): yield tc -def make_repo(argsns, arg_parser): +#def make_repo(argsns, arg_parser): """ Make the repo test case list. A convinience function for testing chill from the repsitory. @params argsns Command line arguments @params arg_parser The ArgumentParser object """ - util.mkdir_p(os.path.join(os.getcwd(), '.staging'), temp=True) - argsns.bin_dir = os.path.join(os.getcwd(), '.staging/bin') - argsns.repo_dir = os.path.join(os.getcwd(), '.staging/repo') - argsns.chill_tc_dir = os.path.join(os.getcwd(), 'test-cases') # formally from the commandline - argsns.wd = os.path.join(os.getcwd(), '.staging/wd') - - util.mkdir_p(argsns.bin_dir) - util.mkdir_p(argsns.repo_dir) - util.mkdir_p(argsns.wd) - - #TODO: Should these be hard coded? - repo_root = 'shell.cs.utah.edu/uusoc/facility/res/hallresearch/svn_repo/resRepo/projects' - for version in ['release', 'dev']: - new_args = util.copy(argsns) - if version == 'dev': - chill_repo = 'svn+ssh://{}@{}/chill/branches/cuda-chill-rose'.format(new_args.svnuser, repo_root) - chill_repo_name = 'chill' - omega_repo = 'svn+ssh://{}@{}/omega/branches/cuda-omega-rose'.format(new_args.svnuser, repo_root) - omega_repo_name = 'omega' - elif version == 'release': - chill_repo = 'svn+ssh://{}@{}/chill/release'.format(new_args.svnuser, repo_root) - chill_repo_name = 'chill-release' - omega_repo = 'svn+ssh://{}@{}/omega/release'.format(new_args.svnuser, repo_root) - omega_repo_name = 'omega-release' - new_args.omega_dir = os.path.join(new_args.repo_dir, omega_repo_name) - new_args.chill_dir = os.path.join(new_args.repo_dir, chill_repo_name) - util.shell('svn', ['export', '--force', omega_repo, new_args.omega_dir]) - util.shell('svn', ['export', '--force', chill_repo, new_args.chill_dir]) - util.shell('cp', [os.path.join(new_args.chill_dir, 'examples/cuda-chill/cudaize.lua'), new_args.wd]) - if version == 'dev': - util.shell('cp', [os.path.join(new_args.chill_dir, 'examples/cuda-chill/cudaize.py'), new_args.wd]) - # do omega: (just build it for now) - yield omega.BuildOmegaTestCase(new_args.omega_dir ,version) - # do chill - for config in chill.ChillConfig.configs(new_args.omega_dir, new_args.chill_dir, new_args.bin_dir, version=version): - yield chill.BuildChillTestCase(config, coverage_set=argsns.coverage_set) - batch_file = os.path.join(argsns.chill_tc_dir, config.name() + '.tclist') - if os.path.exists(batch_file): - for tc in make_batch_testcaselist(new_args, arg_parser, batch_file): - yield tc +# util.mkdir_p(os.path.join(os.getcwd(), '.staging'), temp=True) +# argsns.bin_dir = os.path.join(os.getcwd(), '.staging/bin') +# argsns.repo_dir = os.path.join(os.getcwd(), '.staging/repo') +# argsns.chill_tc_dir = os.path.join(os.getcwd(), 'test-cases') # formally from the commandline +# argsns.wd = os.path.join(os.getcwd(), '.staging/wd') +# +# util.mkdir_p(argsns.bin_dir) +# util.mkdir_p(argsns.repo_dir) +# util.mkdir_p(argsns.wd) +# +# #TODO: Should these be hard coded? +# repo_root = 'shell.cs.utah.edu/uusoc/facility/res/hallresearch/svn_repo/resRepo/projects' +# for version in ['release', 'dev']: +# new_args = util.copy(argsns) +# if version == 'dev': +# chill_repo = 'svn+ssh://{}@{}/chill/branches/cuda-chill-rose'.format(new_args.svnuser, repo_root) +# chill_repo_name = 'chill' +# omega_repo = 'svn+ssh://{}@{}/omega/branches/cuda-omega-rose'.format(new_args.svnuser, repo_root) +# omega_repo_name = 'omega' +# elif version == 'release': +# chill_repo = 'svn+ssh://{}@{}/chill/release'.format(new_args.svnuser, repo_root) +# chill_repo_name = 'chill-release' +# omega_repo = 'svn+ssh://{}@{}/omega/release'.format(new_args.svnuser, repo_root) +# omega_repo_name = 'omega-release' +# new_args.omega_dir = os.path.join(new_args.repo_dir, omega_repo_name) +# new_args.chill_dir = os.path.join(new_args.repo_dir, chill_repo_name) +# util.shell('svn', ['export', '--force', omega_repo, new_args.omega_dir]) +# util.shell('svn', ['export', '--force', chill_repo, new_args.chill_dir]) +# util.shell('cp', [os.path.join(new_args.chill_dir, 'examples/cuda-chill/cudaize.lua'), new_args.wd]) +# if version == 'dev': +# util.shell('cp', [os.path.join(new_args.chill_dir, 'examples/cuda-chill/cudaize.py'), new_args.wd]) +# # do omega: (just build it for now) +# yield omega.BuildOmegaTestCase(new_args.omega_dir ,version) +# # do chill +# for config in chill.ChillConfig.configs(new_args.omega_dir, new_args.chill_dir, new_args.bin_dir, version=version): +# yield chill.BuildChillTestCase(config, coverage_set=argsns.coverage_set) +# batch_file = os.path.join(argsns.chill_tc_dir, config.name() + '.tclist') +# if os.path.exists(batch_file): +# for tc in make_batch_testcaselist(new_args, arg_parser, batch_file): +# yield tc def make_runchill_testcase(argsns): """ @@ -216,7 +216,7 @@ def add_chill_run_args(arg_parser): add_boolean_option(arg_parser, 'run-script', dest='chill_test_run_script', default=True, help_on='Run chill script.', help_off='Do not run chill script.') add_boolean_option(arg_parser, 'compile-gensrc', dest='chill_test_compile_gensrc', default=True, help_on='Compile generated source file', help_off='Do not compile generated source file.') add_boolean_option(arg_parser, 'check-run-script', dest='chill_test_check_run_script', default=False, help_on='Diff stdout from chill script against a benchmark.') - add_boolean_option(arg_parser, 'test-coverage', 'chill_test_coverage', default=True, help_on='Run chill and record code coverage (default).', help_off='Run chill normally without recording code coverage.') + add_boolean_option(arg_parser, 'test-coverage', 'chill_test_coverage', default=False, help_on='Run chill and record code coverage (default).', help_off='Run chill normally without recording code coverage.') @util.callonce def add_chill_build_args(arg_parser): @@ -224,7 +224,7 @@ def add_chill_build_args(arg_parser): Command line arguments specific to building chill and testing the build process @params arg_parser The ArgumentParser object """ - add_boolean_option(arg_parser, 'build-coverage', 'chill_build_coverage', default=True, help_on='Build chill for code coverage flags (default).', help_off='Build chill normally without code coverage flags.') + add_boolean_option(arg_parser, 'build-coverage', 'chill_build_coverage', default=False, help_on='Build chill for code coverage flags (default).', help_off='Build chill normally without code coverage flags.') @util.callonce def add_local_command(command_group): @@ -308,7 +308,7 @@ def add_global_args(arg_parser): arg_parser.add_argument('-w', '--working-dir', dest='wd', default=os.getcwd(), help='The working directory. (Defaults to the current directory)', metavar='working-directory') arg_parser.add_argument('-R', '--rose-home', dest='rose_dir', default=os.getenv('ROSEHOME'), help='Rose home directory. (Defaults to ROSEHOME)', metavar='rose-home') arg_parser.add_argument('-C', '--chill-home', dest='chill_dir', default=os.path.join(os.getcwd(), '..'), help='Chill home directory. (Defaults to CHILLHOME)', metavar='chill-home') - arg_parser.add_argument('-b', '--binary-dir', dest='bin_dir', default=None, help='Binary directory.', metavar='bin-dir') + arg_parser.add_argument('-b', '--binary-dir', dest='bin_dir', default=os.path.join(os.getcwd(), '..'), help='Binary directory.', metavar='bin-dir') @util.callonce def make_argparser(): @@ -351,11 +351,9 @@ def args_to_tclist(args=sys.argv[1:], arg_parser=make_argparser(), argsns=None, @util.callonce def main(): coverage = gcov.GcovSet() - #coverage=None results = list(test.run(args_to_tclist(coverage_set=coverage))) test.pretty_print_results(results) util.rmtemp() - #coverage.pretty_print() with open('coverage.pickle', 'wb') as f: pickle.dump(coverage, f, 2) diff --git a/test-chill/testchill/chill.py b/test-chill/testchill/chill.py index 833d524..b6d39cf 100644 --- a/test-chill/testchill/chill.py +++ b/test-chill/testchill/chill.py @@ -169,7 +169,7 @@ class BuildChillTestCase(test.TestCase): if self.test_result.passed(): if self.config.bin_dir: util.shell('mv', [os.path.join(self.config.chill_dir, self.config.buildname), os.path.join(self.config.bin_dir, self.config.name)]) - elif not self.config.buildname == name: + elif not self.config.buildname == self.config.name: util.shell('mv', [os.path.join(self.config.chill_dir, self.config.buildname), os.path.join(self.config.chill_dir, self.config.name)]) -- cgit v1.2.3-70-g09d2