|
Build system for statically-linked Python.
This adds a new subdirectory, python_modules/ , and a mechanism for
creating a statically linked Python build. It is designed primarily for
PNaCl, where a lack of shared library support and the cost of
translation mean that a large Python stack requires a complex,
multi-step build process. This process can be summarized as such:
* Build a host python containing all necessary build-time dependencies
for the stack
* Build each individual module
* Collect object files and construct unified libpython2.7.a and
python.pexe
* Add a dynload module for statically linked modules
When not automated, this is prone to error and difficult to add or
remove additional modules. The system included here, while not perfect,
addresses this by enabling individual modules to be selected and built
ala carte, with a reubilding of python_static necessary to create the
unified python.pexe and libpython2.7.a. The libpython2.7.a output by
this can then be used as a link target for a python_ppapi-like module.
As examples, and as components of a scientific python stack, this
changelist includes:
* numpy (host and destination builds)
* cython (host-only build)
* setuptools (host-only build)
* matplotlib (dest-only build)
* sympy (dest-only build)
* ipython (dest-only build)
* pyzmq (dest-only build)
* h5py (dest-only build; requires hdf5, under separate CL review)
* jinja2 (dest-only build)
* pyppapi (dest-only build)
* six (dest-only build)
* distribute (dest-only build)
* nose (dest-only build)
* pyparsing (dest-only build)
* dateutil (dest-only build)
* markupsafe (dest-only build)
* yt (dest-only build)
This CL includes a port for the pyppapi module, which was developed in
support of this and which provides a Python API to communicate between
running Native Client modules and Chrome. This includes serialization
of NumPy arrays into typed arrays as well as other Python/JS
translations.
Python module ports act very similarly to standard naclports modules,
with two exceptions. The installation of the .py files has been moved
into the building phase and the collection of .o files occurs during
installation. Additionally, they utilize modules.libs and modules.list
files. The first of these files should append to the variable
PY_MOD_LINK to add on additional libraries for building the module, and
the second is a list of compiled modules (not object files) produced by
the python module which should be included in the symbol table in
libpython2.7.a. For instance, if the compiled C module "fastcode"
exists in a Python module and it requires linking against cfast, these
files would look like:
modules.list:
fastcode
modules.libs:
PY_MOD_LINK+=" -lcfast"
At present, this has been tested on PNaCl. To construct a Python build
with a number of modules, a command like this can be issues:
NACL_ARCH=pnacl make numpy sympy matplotlib python_static
The resultant installed libpython2.7.a will contain all of those
modules. Note that any pure-python modules auto-installed by setuptools
will be functional in the resultant python destination, but any
C-compiled python modules that have been auto-installed will simply
fail.
R=sbc@chromium.org, hamaji@chromium.org, kestert@google.com
BUG=
Committed: https://code.google.com/p/naclports/source/detail?r=1230
Total comments: 7
Total comments: 12
Total comments: 6
Total comments: 4
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+7621 lines, -6 lines) |
Patch |
|
M |
Makefile
|
View
|
1
2
3
4
5
6
7
8
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
build_tools/common.sh
|
View
|
1
2
3
4
5
6
7
8
9
10
|
4 chunks |
+45 lines, -3 lines |
0 comments
|
Download
|
|
M |
build_tools/naclports.py
|
View
|
1
2
3
4
5
6
7
8
9
10
|
2 chunks |
+11 lines, -2 lines |
0 comments
|
Download
|
|
A |
ports/python-static/Setup.local
|
View
|
1
2
3
4
5
6
7
8
|
1 chunk |
+102 lines, -0 lines |
0 comments
|
Download
|
|
A |
ports/python-static/build.sh
|
View
|
1
2
3
4
5
6
7
8
|
1 chunk |
+74 lines, -0 lines |
0 comments
|
Download
|
|
A |
ports/python-static/config.site
|
View
|
1
2
3
4
5
6
7
8
|
1 chunk |
+10 lines, -0 lines |
0 comments
|
Download
|
|
A |
ports/python-static/dynload_ppapi.c
|
View
|
1
2
3
4
5
6
7
8
|
1 chunk |
+21 lines, -0 lines |
0 comments
|
Download
|
|
A |
ports/python-static/nacl.patch
|
View
|
1
2
3
4
5
6
7
8
|
1 chunk |
+627 lines, -0 lines |
0 comments
|
Download
|
|
A |
ports/python-static/pkg_info
|
View
|
1
2
3
4
5
6
7
8
9
|
1 chunk |
+8 lines, -0 lines |
0 comments
|
Download
|
|
A |
ports/python_modules/cython/build.sh
|
View
|
1
2
3
4
5
6
7
8
|
1 chunk |
+29 lines, -0 lines |
0 comments
|
Download
|
|
A |
ports/python_modules/cython/pkg_info
|
View
|
1
2
3
4
5
6
7
8
|
1 chunk |
+8 lines, -0 lines |
0 comments
|
Download
|
|
A |
ports/python_modules/distribute/build.sh
|
View
|
1
2
3
4
5
6
|
1 chunk |
+16 lines, -0 lines |
0 comments
|
Download
|
|
A |
ports/python_modules/distribute/pkg_info
|
View
|
1
2
3
4
5
6
7
8
|
1 chunk |
+7 lines, -0 lines |
0 comments
|
Download
|
|
A |
ports/python_modules/h5py/build.sh
|
View
|
1
2
3
|
1 chunk |
+16 lines, -0 lines |
0 comments
|
Download
|
|
A |
ports/python_modules/h5py/modules.libs
|
View
|
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
|
A |
ports/python_modules/h5py/modules.list
|
View
|
|
1 chunk |
+22 lines, -0 lines |
0 comments
|
Download
|
|
A |
ports/python_modules/h5py/pkg_info
|
View
|
1
2
3
4
5
6
7
8
|
1 chunk |
+7 lines, -0 lines |
0 comments
|
Download
|
|
A |
ports/python_modules/ipython/build.sh
|
View
|
|
1 chunk |
+16 lines, -0 lines |
0 comments
|
Download
|
|
A |
ports/python_modules/ipython/nacl.patch
|
View
|
1
|
1 chunk |
+22 lines, -0 lines |
0 comments
|
Download
|
|
A |
ports/python_modules/ipython/pkg_info
|
View
|
1
2
3
4
5
6
7
8
|
1 chunk |
+8 lines, -0 lines |
0 comments
|
Download
|
|
A |
ports/python_modules/jinja2/build.sh
|
View
|
|
1 chunk |
+16 lines, -0 lines |
0 comments
|
Download
|
|
A |
ports/python_modules/jinja2/pkg_info
|
View
|
1
2
3
4
5
6
7
8
9
|
1 chunk |
+8 lines, -0 lines |
0 comments
|
Download
|
|
A |
ports/python_modules/markupsafe/build.sh
|
View
|
1
2
3
4
5
6
7
8
9
|
1 chunk |
+16 lines, -0 lines |
0 comments
|
Download
|
|
A |
ports/python_modules/markupsafe/pkg_info
|
View
|
1
2
3
4
5
6
7
8
9
|
1 chunk |
+8 lines, -0 lines |
0 comments
|
Download
|
|
A |
ports/python_modules/matplotlib/build.sh
|
View
|
|
1 chunk |
+17 lines, -0 lines |
0 comments
|
Download
|
|
A |
ports/python_modules/matplotlib/modules.libs
|
View
|
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
|
A |
ports/python_modules/matplotlib/modules.list
|
View
|
|
1 chunk |
+9 lines, -0 lines |
0 comments
|
Download
|
|
A |
ports/python_modules/matplotlib/nacl.patch
|
View
|
1
2
3
4
5
6
|
1 chunk |
+167 lines, -0 lines |
0 comments
|
Download
|
|
A |
ports/python_modules/matplotlib/pkg_info
|
View
|
1
2
3
4
5
6
7
8
|
1 chunk |
+8 lines, -0 lines |
0 comments
|
Download
|
|
A |
ports/python_modules/nose/build.sh
|
View
|
1
2
3
4
5
6
|
1 chunk |
+16 lines, -0 lines |
0 comments
|
Download
|
|
A |
ports/python_modules/nose/pkg_info
|
View
|
1
2
3
4
5
6
7
8
|
1 chunk |
+7 lines, -0 lines |
0 comments
|
Download
|
|
A |
ports/python_modules/numpy/build.sh
|
View
|
1
2
3
4
5
6
7
8
|
1 chunk |
+34 lines, -0 lines |
0 comments
|
Download
|
|
A |
ports/python_modules/numpy/modules.list
|
View
|
|
1 chunk |
+11 lines, -0 lines |
0 comments
|
Download
|
|
A |
ports/python_modules/numpy/nacl.patch
|
View
|
1
2
3
|
1 chunk |
+174 lines, -0 lines |
0 comments
|
Download
|
|
A |
ports/python_modules/numpy/pkg_info
|
View
|
1
2
3
4
5
6
7
8
|
1 chunk |
+8 lines, -0 lines |
0 comments
|
Download
|
|
A |
ports/python_modules/pyparsing/build.sh
|
View
|
1
2
3
4
5
6
|
1 chunk |
+16 lines, -0 lines |
0 comments
|
Download
|
|
A |
ports/python_modules/pyparsing/pkg_info
|
View
|
1
2
3
4
5
6
7
8
|
1 chunk |
+7 lines, -0 lines |
0 comments
|
Download
|
|
A |
ports/python_modules/pyppapi/build.sh
|
View
|
|
1 chunk |
+17 lines, -0 lines |
0 comments
|
Download
|
|
A |
ports/python_modules/pyppapi/modules.list
|
View
|
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
|
A |
ports/python_modules/pyppapi/pkg_info
|
View
|
1
2
3
4
5
6
7
8
|
1 chunk |
+7 lines, -0 lines |
0 comments
|
Download
|
|
A |
ports/python_modules/python-dateutil/build.sh
|
View
|
1
2
3
4
5
6
|
1 chunk |
+16 lines, -0 lines |
0 comments
|
Download
|
|
A |
ports/python_modules/python-dateutil/pkg_info
|
View
|
1
2
3
4
5
6
7
8
|
1 chunk |
+7 lines, -0 lines |
0 comments
|
Download
|
|
A |
ports/python_modules/python-host/build.sh
|
View
|
1
2
3
4
5
6
7
8
|
1 chunk |
+27 lines, -0 lines |
0 comments
|
Download
|
|
A |
ports/python_modules/python-host/nacl.patch
|
View
|
1
2
3
4
5
6
7
8
|
1 chunk |
+627 lines, -0 lines |
0 comments
|
Download
|
|
A |
ports/python_modules/python-host/pkg_info
|
View
|
1
2
3
4
5
6
7
8
|
1 chunk |
+8 lines, -0 lines |
0 comments
|
Download
|
|
A |
ports/python_modules/pyzmq/build.sh
|
View
|
|
1 chunk |
+17 lines, -0 lines |
0 comments
|
Download
|
|
A |
ports/python_modules/pyzmq/modules.libs
|
View
|
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
|
A |
ports/python_modules/pyzmq/modules.list
|
View
|
|
1 chunk |
+12 lines, -0 lines |
0 comments
|
Download
|
|
A |
ports/python_modules/pyzmq/nacl.patch
|
View
|
|
1 chunk |
+5159 lines, -0 lines |
0 comments
|
Download
|
|
A |
ports/python_modules/pyzmq/pkg_info
|
View
|
1
2
3
4
5
6
7
8
|
1 chunk |
+7 lines, -0 lines |
0 comments
|
Download
|
|
A |
ports/python_modules/setuptools/build.sh
|
View
|
1
2
3
4
5
6
7
8
|
1 chunk |
+29 lines, -0 lines |
0 comments
|
Download
|
|
A |
ports/python_modules/setuptools/pkg_info
|
View
|
1
2
3
4
5
6
7
8
|
1 chunk |
+7 lines, -0 lines |
0 comments
|
Download
|
|
A |
ports/python_modules/six/build.sh
|
View
|
1
2
3
4
5
6
|
1 chunk |
+16 lines, -0 lines |
0 comments
|
Download
|
|
A |
ports/python_modules/six/pkg_info
|
View
|
1
2
3
4
5
6
7
8
|
1 chunk |
+7 lines, -0 lines |
0 comments
|
Download
|
|
A |
ports/python_modules/sympy/build.sh
|
View
|
|
1 chunk |
+16 lines, -0 lines |
0 comments
|
Download
|
|
A |
ports/python_modules/sympy/pkg_info
|
View
|
1
2
3
4
5
6
7
8
|
1 chunk |
+7 lines, -0 lines |
0 comments
|
Download
|
|
A |
ports/python_modules/yt/build.sh
|
View
|
|
1 chunk |
+17 lines, -0 lines |
0 comments
|
Download
|
|
A |
ports/python_modules/yt/modules.list
|
View
|
|
1 chunk |
+35 lines, -0 lines |
0 comments
|
Download
|
|
A |
ports/python_modules/yt/pkg_info
|
View
|
1
2
3
4
5
6
7
8
|
1 chunk |
+7 lines, -0 lines |
0 comments
|
Download
|
Total messages: 24 (0 generated)
|