README.md 2.74 KB
Newer Older
Dipl.-Ing. Jonas Stienen's avatar
Dipl.-Ing. Jonas Stienen committed
1
2
3
4
5
6
7
## VAPython

VAPython contains is a C++ extension for the Python3 interpreter that provides a (networked) interface to VA.


### License

Pascal Palenda's avatar
Pascal Palenda committed
8
Copyright 2015-2022 Institute of Technical Acoustics (ITA), RWTH Aachen University
Dipl.-Ing. Jonas Stienen's avatar
Dipl.-Ing. Jonas Stienen committed
9
10
11
12
13
14
15
16
17
18
19
20
21
22

Licensed under the Apache License, Version 2.0 (the "License");
you may not use files of this project except in compliance with the License.
You may obtain a copy of the License at

<http://www.apache.org/licenses/LICENSE-2.0>

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.


23
24
25
26
27
28
29
30
31
32
33
34
35
36
### Requirements

Python 3.7 or higher. The [setuptools](https://setuptools.pypa.io/en/latest/) and the [wheel](https://pypi.org/project/wheel/) package to create or use installer.


### Install

The VA binary packages come with wheel installers for the supported python versions 3.7 - 3.9 which are located in the *python* folder. The files have a similar name to *va-2021b-cp39-cp39-win_amd64.whl*. They can be installed using pip from the respective folder:

`pip install va-2021b-cp39-cp39-win_amd64.whl`

Afterwards you can start a VAServer and try the script in the *example* folder.


Dipl.-Ing. Jonas Stienen's avatar
Dipl.-Ing. Jonas Stienen committed
37
38
### Quick build guide

39
40
41
Before you can build VAPython you have to run CMake with option `ITA_VA_WITH_BINDING_PYTHON` as this among others will prepare the *setup.py* file.


42
43
#### Visual Studio

44
Running CMake creates a Visual Studio project called `VAPython`. "Building" this target will run a batch script (*setuptools_build_va_python.bat*), that will build the `va` package for Python and create a wheel installer file using setuptools (see below). Note, that this might only work in Release mode. You can modify the batch script, e.g. to specify the python version. Per default it uses the Python launcher *py* to create installers for multiple Python versions.
45
46


47
#### Setuptools
Dipl.-Ing. Jonas Stienen's avatar
Dipl.-Ing. Jonas Stienen committed
48

49
After running CMake you can use Pythons *setuptools* to build the module that is called `va`. Check the respective [Requirements](#requirements). Creating an installer is done using the following two steps:
Dipl.-Ing. Jonas Stienen's avatar
Dipl.-Ing. Jonas Stienen committed
50

51
`python setup.py build --force`
Dipl.-Ing. Jonas Stienen's avatar
Dipl.-Ing. Jonas Stienen committed
52

53
`python setup.py bdist_wheel`
Dipl.-Ing. Jonas Stienen's avatar
Dipl.-Ing. Jonas Stienen committed
54

55
56
57
58
59

#### Trouble shooting

If you get some errors like `module not found`, this usually refers to missing or incompatible shared libraries that the `va` module is trying to load upon import within the Python interpreter. Make sure the following files are available (i.e. copy them next to the va*.pyc file in the dist/lib/	site-packages folder or into the distribution zip file)
Windows:
60
`VABase.dll VANet.dll vista_base.dll vista_aspects.dll vista_inter_proc_comm.dll`
61
Other OS: replace `dll` with `so`