|
1 | 1 | # ScienceMode4_python_wrapper |
2 | | -Python wrapper for the ScienceMode 4 protocol |
| 2 | +* Python wrapper for the ScienceMode 4 protocol |
3 | 3 |
|
4 | 4 | ## Introduction |
5 | | - |
6 | | -sciencemode_cffi is a python wrapper for the sciencemode library. |
7 | | - |
8 | | -This python library was tested on Windows 64bit together with Anaconda Python. |
9 | | - |
10 | | -This library is using [cffi](https://cffi.readthedocs.io/). |
| 5 | +* sciencemode_cffi is a python wrapper for the sciencemode library. |
| 6 | +* This python library was tested on Windows 64bit together with Anaconda Python. |
| 7 | +* This library is using [cffi](https://cffi.readthedocs.io/). |
11 | 8 |
|
12 | 9 | ## Preparation |
13 | | -Unzip the correct version of the smpt library and copy the lib into the lib directory. |
14 | | -On Windows, build artifacts from [ScienceMode4_c_library](https://github.com/ScienceMode/ScienceMode4_c_library) can be used. |
15 | | - |
16 | | -## How to build for Windows |
17 | | -Mingw 5.3 from Qt needs to be installed in `C:\Qt\Tools\mingw530_32`. The [Visual studio compiler](https://visualstudio.microsoft.com/visual-cpp-build-tools/) needs also be installed. |
18 | | - |
19 | | -The QT-Binaries can be installed using the [QT Online Installer](https://www.qt.io/download-open-source). |
| 10 | +* Unzip the correct version of the smpt library and copy the lib into the lib directory. |
| 11 | +* On Windows, build artifacts from [ScienceMode4_c_library](https://github.com/ScienceMode/ScienceMode4_c_library) can be used. |
20 | 12 |
|
21 | | -The following should be selected for building the python wheels: |
22 | | - |
| 13 | +## Copy Library to lib |
| 14 | +* Download [smpt_windows_static_x86.zip](https://github.com/ScienceMode/ScienceMode4_c_library/releases/download/v4.0.0/smpt_windows_static_x86.zip) from [ScienceMode4_c_library](https://github.com/ScienceMode/ScienceMode4_c_library) |
| 15 | +* copy libsmpt.lib from the smpt_windows_static_x86.zip to /lib (path inside the zip file is .\ScienceMode_Library\release\smpt\windows_x86\static) |
23 | 16 |
|
| 17 | +## How to build for Windows |
| 18 | +* Install MinGW from [MinGW releases](https://github.com/niXman/mingw-builds-binaries/releases) |
| 19 | + * Adjust path where MinGW is installed in ScienceMode/_cffi.py in line 202: mingw_path = os.getenv('MINGW_PATH', default='...') |
| 20 | +* Install [Visual studio compiler](https://visualstudio.microsoft.com/visual-cpp-build-tools/) |
24 | 21 |
|
| 22 | +## Install setuptools |
| 23 | +``` |
| 24 | +pip install setuptools |
| 25 | +``` |
25 | 26 |
|
26 | 27 | ## Install the wheel pacakge |
27 | 28 | ``` |
28 | 29 | pip install wheel |
29 | 30 | ``` |
30 | | -## Copy Library to lib |
31 | | -* Download [smpt_windows_static_x86.zip](https://github.com/ScienceMode/ScienceMode4_c_library/releases/download/v4.0.0/smpt_windows_static_x86.zip) from [ScienceMode4_c_library](https://github.com/ScienceMode/ScienceMode4_c_library) |
32 | | -* copy libsmpt.lib from the smpt_windows_static_x86.zip to /lib (path inside the zip file is .\ScienceMode_Library\release\smpt\windows_x86\static) |
33 | 31 |
|
34 | 32 | ## Building the wheel |
35 | 33 | Create a wheel with |
36 | 34 | ``` |
37 | 35 | python setup.py bdist_wheel --universal |
38 | 36 | ``` |
| 37 | + |
39 | 38 | ## Installing the wheel |
40 | 39 | You may correct the filename, check that the python version is matching the version in the filename. |
41 | 40 | E.g. for python 3.9, the following version is valid: |
|
0 commit comments