-
Notifications
You must be signed in to change notification settings - Fork 0
/
INSTALL
56 lines (40 loc) · 2.04 KB
/
INSTALL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
Instructions for building and installing pylibjit. Sorry about the mess.
You will need a standard Linux-ish environment, with Python 3.x (tested with
3.2 and newer), a GCC-like C compiler, and usual development stuff
(including, unfortunately, flex and bison). Your Python installation will
have to include Python's headers (Python.h in particular), which might live
in a package called python3-dev or similar.
1. Build and install libjit (the library that does actual code generation):
cd libjit
./configure # optionally: --prefix=/path/for/installation
make
make install # possibly as root
cd ..
If you specified your own --prefix above, you must tell your linker where to
find the dynamic library. For example (better solutions may exist):
# Add this to startup scripts if needed.
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/path/to/libjit/lib/
Even in the unlikely case that you already had libjit installed on your
system, you will need to install the modified version from this
distribution, and make sure below that this modified version is found by
pylibjit.
2. Build and install libjit-python (the Python wrapper for libjit):
cd libjit-python
# if libjit was installed in a non-standard location, edit setup.py to
# add that path to include_dirs and library_dirs
python3 setup.py build
# this will install a Python module named 'jit'
python3 setup.py install # use sudo, or use --user to install in home dir
cd ..
3. Install pylibjit (the actual Python-to-libjit compiler):
# in root directory
python3 setup.py install # use sudo, or use --user to install in home dir
4. Test:
cd examples
# Now the following commands should run without error, and the second
# one should be about 50 times faster than the first one (while printing
# the same result).
# The compiled version will dump various representations of the program
# to the standard output while it works; this is intended.
time python3 spectralnorm-interpret.py 1000
time python3 spectralnorm-compile.py 1000