-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathINSTALL.txt
37 lines (22 loc) · 1.8 KB
/
INSTALL.txt
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
The extension should be compatible with CPython 3.7 and 3.8, no other versions were tested.
Only Linux and Windows OS are supported currently. This is due to complications with support
of events in multiprocess environments: Linux provides an easy to use futex, while Windows has CreateEvent.
To build the extension you need to have CPython development libraries available e.g. for Debian:
apt-get install python3-all-dev python3-distutils
To build and install locally, use:
python3 setup.py install
For development/testing purpose you might consider inplace setup, where binaries will appear in /src folder
and optimization is disabled:
python3 setup.py build_ext --inplace --debug
"build_ext" is a preferable way to build the debug configuration because distutils does not support "--inplace" switch.
Currently the correctness of the code is verified mostly through internal assertions instead of external
output verification. To trigger these internal assertions there exist two tests in the /tests folder:
- lower level for testing the language-independant code (tests/test.c);
- higher level for testing CPython extension (tests/pso.py and tests/test1.pso.py).
Lower level test has the form of standalone program which is compiled with:
python3 setup.py build_test
This command also accepts optional "--inplace" and "--debug" switches with effects similar to build_ext,
although with "--inplace" it yields executable binary in the /src folder instead of /tests. For example you might run:
python3 setup.py build_test --inplace && ./src/pso_test
Higher level test requires a compiled CPython extension in the path and a pso.py module to run. For inplace testing use:
python3 setup.py build_ext --inplace --debug && export PYTHONPATH="$PWD/src" && python3 tests/run.py && python3 -m pso tests/accounts.py