|
6 | 6 | [](https://travis-ci.org/primitiv/primitiv-python) |
7 | 7 | [](https://pypi.python.org/pypi/primitiv) |
8 | 8 |
|
9 | | -Python frontend of primitiv |
10 | | -================================= |
| 9 | +Python Frontend of primitiv |
| 10 | +=========================== |
11 | 11 |
|
12 | | -Dependency |
13 | | ---------------------------------- |
| 12 | +Dependencies |
| 13 | +------------ |
14 | 14 |
|
15 | | -* C++ primitiv |
16 | 15 | * Python 3 (3.5 or later) |
17 | 16 | * NumPy (1.11.0 or later) |
18 | 17 | * Cython (0.27 or later) |
| 18 | +* scikit-build (0.6.1 or later, only for building) |
| 19 | +* (optional) CUDA (7.5 or later) |
| 20 | +* (optional) OpenCL (1.2 or later) and OpenCL C++ binding v2 |
19 | 21 |
|
20 | | -How to install? |
21 | | ---------------------------------- |
| 22 | +Getting Started |
| 23 | +--------------- |
22 | 24 |
|
23 | | -1. Install [primitiv core library](http://github.com/primitiv/primitiv): |
| 25 | +### Automatic Install using `pip` |
| 26 | + |
| 27 | +To install primitiv without CUDA and OpenCL, run the following commands: |
24 | 28 |
|
25 | 29 | ``` |
26 | | -$ cmake .. [options] |
27 | | -$ make |
28 | | -$ sudo make install |
| 30 | +$ pip3 install numpy cython scikit-build [--user] |
| 31 | +$ pip3 install primitiv [--user] |
29 | 32 | ``` |
30 | 33 |
|
31 | | -2. Install NumPy and Cython with Python 3 |
| 34 | +To enable CUDA and/or OpenCL support, specify `--enable-cuda` or |
| 35 | +`--enable-opencl` with `--global-option` flag of `pip` like the following |
| 36 | +example: |
32 | 37 |
|
33 | 38 | ``` |
34 | | -$ sudo apt install python3-numpy |
35 | | -$ sudo pip3 install cython |
| 39 | +$ pip3 install primitiv --global-option --enable-cuda \ |
| 40 | + --global-option --enable-opncl |
36 | 41 | ``` |
37 | 42 |
|
38 | | -Currently, Cython 0.27 is not contained in Debian and Ubuntu repositories. |
| 43 | +### Compiling Step by Step |
39 | 44 |
|
40 | | -3. Run the following commands in python-primitiv directory: |
| 45 | +1. Install NumPy, Cython and scikit-build with Python 3 |
41 | 46 |
|
42 | 47 | ``` |
| 48 | +$ sudo pip3 install numpy cython scikit-build |
| 49 | +``` |
| 50 | + |
| 51 | +2. Run the following commands in `primitiv-python` directory: |
| 52 | + |
| 53 | +``` |
| 54 | +$ git submodule update --init |
43 | 55 | $ python3 ./setup.py build [--enable-cuda] [--enable-opencl] |
44 | | -$ python3 ./setup.py test # (optional) |
45 | | -$ sudo python3 ./setup.py install [--enable-cuda] [--enable-opencl] |
| 56 | +$ python3 ./setup.py test [--enable-cuda] [--enable-opencl] # (optional) |
| 57 | +$ python3 ./setup.py install [--user] [--enable-cuda] [--enable-opencl] |
46 | 58 | ``` |
47 | 59 |
|
48 | | -You also can use `LIBRARY_PATH` and `CPLUS_INCLUDE_PATH` depending on your environment. |
| 60 | +To enable CUDA and/or OpenCL support, run setup script with `--enable-DEVICE` option. |
| 61 | + |
| 62 | +primitiv-python repository contains the core library as a git submodule. |
| 63 | +Note that you have to update the working tree of the core library manually by |
| 64 | +`git submodule update` after you run `git pull` or `git checkout` commands. |
| 65 | + |
| 66 | +Resources |
| 67 | +--------- |
49 | 68 |
|
50 | | -To install CUDA and/or OpenCL support, run setup script with `--enable-DEVICE` option. |
| 69 | +* [C++ core library of primitiv](https://github.com/primitiv/primitiv) |
| 70 | +* [Examples](https://github.com/primitiv/primitiv-python/tree/develop/examples) |
0 commit comments