Commit 4492dc98 authored by Kevin Modzelewski's avatar Kevin Modzelewski

Have the Makefile detect if the CPython-extension build step failed

Also make a note that the CPython development headers are necessary
for running the tests.
parent ae48a108
Pyston currently only supports installing from source; the following instructions have fairly tested on Ubuntu, somewhat tested as working on other *nix-y platforms, and are extensively verified as not working on Mac. (Please see issue #165 for discussion on enabling OSX support, which is pretty difficult.)
Pyston currently only supports installing from source; the following instructions have fairly tested as working on Ubuntu, and are extensively verified as not working on Mac. (Please see issue #165 for discussion on enabling OSX support, which is pretty difficult.)
The build instructions assume that you will put the Pyston source code in `~/pyston` and put the dependencies in `~/pyston_deps`. Barring any bugs, you should be free to put them anywhere you'd like, though the instructions in this file would have to be altered before following. Also, if you want to change the dependency dir, you'll have to change the value of the the `DEPS_DIR` variable in `src/Makefile`.
......@@ -112,51 +112,14 @@ sudo apt-get install libgmp3-dev
There are a number of optional dependencies that the build system knows about, but aren't strictly necessary for building and running Pyston. Most of them are related to developing and debugging:
### valgrind
Since Pyston uses a custom memory allocator, it makes use of the valgrind client hooks to help valgrind understand it. This means that you'll need a copy of the valgrind includes around; I also suggest that if you want to use valgrind, you use a recent version since there are some instructions that LLVM emits that somewhat-recent versions of valgrind don't understand.
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
cd valgrind-3.9.0
./configure --prefix=$HOME/pyston_deps/valgrind-3.9.0-install
make -j4
make install
sudo apt-get install libc6-dbg
cd ~/pyston/src
echo "ENABLE_VALGRIND := 1" >> Makefile.local
```
### Debug build of libunwind
Assuming you've already built the normal version above:
```
cd ~/pyston_deps
cp -rv libunwind-trunk libunwind-trunk-debug
mkdir libunwind-trunk-debug-install
cd libunwind-trunk-debug
CFLAGS="-g -O0" CXXFLAGS="-g -O0" ./configure --prefix=$HOME/pyston_deps/libunwind-trunk-debug-install --enable-shared=0 --enable-debug --enable-debug-frame
make -j4
make install
echo "USE_DEBUG_LIBUNWIND := 1" >> ~/pyston/src/Makefile.local
```
### CPython headers
This will link pyston_dbg and pyston_debug against the debug version of libunwind (the release pyston build will still link against the release libunwind); to enable debug output, set the UNW_DEBUG_LEVEL environment variable, ex to 13.
We have some extension module tests, in which we compile the extension module code for both Pyston and CPython.
### distcc
```
sudo apt-get install distcc distcc-pump
sudo apt-get install python-dev
```
You can then use distcc by doing `make USE_DISTCC=1`
### gtest
For running the unittests:
......@@ -189,12 +152,6 @@ TODO: GDB should be able to determine its data directory. maybe it should be in
from inside the source dir?
--->
### gperftools (-lprofiler)
```
download from http://code.google.com/p/gperftools/downloads/list
standard ./configure, make, make install
```
### gold
gold is highly recommended as a faster linker, and Pyston contains build-system support for automatically using gold if available. gold may already be installed on your system; you can check by typing `which gold`. If it's not installed already:
......@@ -219,6 +176,61 @@ sudo apt-get install linux-tools-`uname -r`
# may need to strip off the -generic from that last one
```
### distcc
```
sudo apt-get install distcc distcc-pump
```
You can then use distcc by doing `make USE_DISTCC=1`
# Misc tools
These are only useful in specific development situations:
### valgrind
Since Pyston uses a custom memory allocator, it makes use of the valgrind client hooks to help valgrind understand it. This means that you'll need a copy of the valgrind includes around; I also suggest that if you want to use valgrind, you use a recent version since there are some instructions that LLVM emits that somewhat-recent versions of valgrind don't understand.
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
cd valgrind-3.9.0
./configure --prefix=$HOME/pyston_deps/valgrind-3.9.0-install
make -j4
make install
sudo apt-get install libc6-dbg
cd ~/pyston/src
echo "ENABLE_VALGRIND := 1" >> Makefile.local
```
### Debug build of libunwind
Assuming you've already built the normal version above:
```
cd ~/pyston_deps
cp -rv libunwind-trunk libunwind-trunk-debug
mkdir libunwind-trunk-debug-install
cd libunwind-trunk-debug
CFLAGS="-g -O0" CXXFLAGS="-g -O0" ./configure --prefix=$HOME/pyston_deps/libunwind-trunk-debug-install --enable-shared=0 --enable-debug --enable-debug-frame
make -j4
make install
echo "USE_DEBUG_LIBUNWIND := 1" >> ~/pyston/src/Makefile.local
```
This will link pyston_dbg and pyston_debug against the debug version of libunwind (the release pyston build will still link against the release libunwind); to enable debug output, set the UNW_DEBUG_LEVEL environment variable, ex to 13.
### gperftools (-lprofiler)
```
download from http://code.google.com/p/gperftools/downloads/list
standard ./configure, make, make install
```
### ninja-based LLVM build
Ninja is supposed to be faster than make; I've only tried it very briefly, and it does seem to be faster when modifying LLVM files. May or may not be worth using; thought I'd jot down my notes though:
......
......@@ -910,7 +910,7 @@ ext_pyston: $(TEST_EXT_MODULE_NAMES:%=../test/test_extension/%.pyston.so)
.PHONY: ext_python
ext_python: $(TEST_EXT_MODULE_NAMES:%=../test/test_extension/*.c)
cd ../test/test_extension; python setup.py build; cd -
cd ../test/test_extension; python setup.py build
$(FROM_CPYTHON_SRCS:.c=.o): %.o: %.c $(BUILD_SYSTEM_DEPS)
$(ECHO) Compiling C file to $@
......
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