Commit 214292b4 authored by Kevin Modzelewski's avatar Kevin Modzelewski

Specify that lzma needs to be installed (doesn't really, but to keep things...

Specify that lzma needs to be installed (doesn't really, but to keep things simple), and try to support running pyston not from src/
parent 7eeb1d1e
......@@ -14,7 +14,7 @@ Benchmarks are not currently that meaningful since the supported set of benchmar
##### Contributing
Pyston welcomes any sorts of contributions; please see [CONTRIBUTING.md](https://github.com/dropbox/pyston/blob/master/CONTRIBUTING.md) for details.
Pyston welcomes any kind of contribution; please see [CONTRIBUTING.md](https://github.com/dropbox/pyston/blob/master/CONTRIBUTING.md) for details.
### Roadmap
......
......@@ -100,6 +100,7 @@ To install:
```
cd ~/pyston_deps
sudo apt-get install liblzma-dev
wget http://valgrind.org/downloads/valgrind-3.9.0.tar.bz2
tar xvf valgrind-3.9.0.tar.bz2
mkdir valgrind-3.9.0-install
......
......@@ -19,6 +19,9 @@
#include <cstring>
#include <sys/stat.h>
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/Path.h"
#include "core/options.h"
#include "core/stats.h"
#include "core/types.h"
......@@ -750,7 +753,15 @@ AST_Module* parse(const char* fn) {
#define LENGTH_SUFFIX_LENGTH 4
static void _reparse(const char* fn, const std::string &cache_fn) {
std::string cmdline = std::string("python -S codegen/parse_ast.py ") + fn;
llvm::SmallString<128> parse_ast_fn;
// TODO supposed to pass argv0, main_addr to this function:
parse_ast_fn = llvm::sys::fs::getMainExecutable(NULL, NULL);
assert(parse_ast_fn.size() && "could not find the path to the pyston src dir");
llvm::sys::path::remove_filename(parse_ast_fn);
llvm::sys::path::append(parse_ast_fn, "codegen/parse_ast.py");
std::string cmdline = std::string("python -S ") + parse_ast_fn.str().str() + " " + fn;
printf("%s\n", cmdline.c_str());
FILE *parser = popen(cmdline.c_str(), "r");
FILE *cache_fp = fopen(cache_fn.c_str(), "w");
assert(cache_fp);
......
Markdown is supported
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