Skip to content

Commit

Permalink
Patch version 0.7.1 (#6)
Browse files Browse the repository at this point in the history
* Made test more meaningful. Update version number

* Fix issue with GDB-python not using virtual environment

- The problem is that GDB's python does not use the path from the
virtual environment. However, sys.path is populated in part by
$PYTHONPATH. So, by passing on sys.path into $PYTHONPATH before invoking
GDB, we can auto-populate sys.path to point GDB to the virtual
environment.

* Solve some packaging issues with python2 in gem5.

- Testing this in a clean VM is very helpful.
  • Loading branch information
iangneal authored Jan 20, 2020
1 parent 823a319 commit e861e41
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 11 deletions.
6 changes: 5 additions & 1 deletion lapidary/tools/GDBProcess.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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):
Expand Down
5 changes: 3 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
wheel
diff-match-patch
elftools
ipython
jinja2
matplotlib
Expand All @@ -8,4 +8,5 @@ pandas
pathlib
progressbar2
pyelftools
pyyaml
pyyaml
wheel
18 changes: 16 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -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()

Expand All @@ -10,15 +20,19 @@ 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',
long_description=long_description,
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=[
Expand Down
26 changes: 20 additions & 6 deletions test/src/test.c
Original file line number Diff line number Diff line change
@@ -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 <stdlib.h>
#include <stdint.h>
#include <stdio.h>

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;
}

0 comments on commit e861e41

Please sign in to comment.