diff --git a/lapidary/tools/GDBProcess.py b/lapidary/tools/GDBProcess.py index 2713347..7b156ad 100755 --- a/lapidary/tools/GDBProcess.py +++ b/lapidary/tools/GDBProcess.py @@ -66,6 +66,10 @@ def __init__(self, arg_list, env['CHECKPOINT_COMPRESS'] = str(compress) env['CHECKPOINT_CONVERT'] = str(convert) env['CHECKPOINT_KEYFRAMES'] = str(keyframes) + # By setting the python path, we preserve the import paths of the + # virtual environment, as sys.path is populated in part from the + # $PYTHONPATH environment variable. + env['PYTHONPATH'] = ':'.join(sys.path) if ld_path is not None: assert ld_path.exists() @@ -74,7 +78,7 @@ def __init__(self, arg_list, self.env = env def run(self): - subprocess.run(self.args) + subprocess.run(self.args, env=self.env) def add_arguments(parser): diff --git a/requirements.txt b/requirements.txt index 628b0b4..7b2ce06 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ -wheel diff-match-patch +elftools ipython jinja2 matplotlib @@ -8,4 +8,5 @@ pandas pathlib progressbar2 pyelftools -pyyaml \ No newline at end of file +pyyaml +wheel diff --git a/setup.py b/setup.py index 9e6bd6e..a624375 100755 --- a/setup.py +++ b/setup.py @@ -1,7 +1,17 @@ #! /usr/bin/env python3 import setuptools +import shlex +import subprocess + +def install_python2_requirements(): + cmd = 'python2.7 -m pip install --user -r requirements2.txt' + args = shlex.split(cmd) + subprocess.call(args) + def main(): + install_python2_requirements() + with open('README.md', 'r') as f: long_description = f.read() @@ -10,7 +20,7 @@ def main(): setuptools.setup( name='lapidary', - version='0.7.0', + version='0.7.1', author='Ian Glen Neal', author_email='iangneal@umich.com', description='A tool for scalable Gem5 Simulation', @@ -18,7 +28,11 @@ def main(): long_description_content_type='text/markdown', url='https://github.com/efeslab/lapidary', packages=setuptools.find_packages(), - package_data={'lapidary': ['config/schema.yaml']}, + package_data={'lapidary': [ + 'config/schema.yaml', + 'checkpoint/get_brk.c', + 'checkpoint/get_fs_base.c' + ]}, setup_requires=['wheel'], install_requires=install_requires, classifiers=[ diff --git a/test/src/test.c b/test/src/test.c index c6b4554..11c3c65 100644 --- a/test/src/test.c +++ b/test/src/test.c @@ -1,13 +1,27 @@ +/** + * Test program for Lapidary simulations. + * + * Before you come yelling at me, yes, I know, this is not the best way to + * compute the fibonacci sequence. I just wanted a simple program that took + * several seconds to finish running so that realistic checkpoints could be + * created from it. + */ #include +#include #include -void ding(void) { printf("DING!\n"); } -void dong(void) { printf("DONG!\n"); } +uint64_t fib(uint64_t i) { + if (i <= 1) { + return i; + } + + return fib(i - 1) + fib(i - 2); +} int main(int argc, char **argv) { - ding(); - dong(); - ding(); - dong(); + for (uint64_t i = 0; i < 50; ++i) { + printf("fib(%lu) = %lu\n", i, fib(i)); + } + return 0; }