Skip to content

Commit

Permalink
Add pypi installation instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
oysstu committed Apr 7, 2022
1 parent bd2f417 commit ce02efc
Showing 1 changed file with 18 additions and 11 deletions.
29 changes: 18 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,43 @@
# imcpy
Python bindings for [Inter-Module Communication Protocol (IMC)](https://lsts.fe.up.pt/toolchain/imc) used to communicate between modules in the [LSTS toolchain](https://lsts.fe.up.pt/).

### Installation
## Installation

### Pip install (PyPi)
Precompiled wheels are available from PyPi, compiled against the standard IMC message set (LSTS).
If your project does not use custom IMC messages, these wheels should be sufficient.

#### Clone this project using
```bash
git clone --recursive git://github.com/oysstu/imcpy.git
pip install imcpy
```
This includes the pybind11 submodule.

Check the release notes or pypi for the precompiled architectures and python versions.

###### (Optional) Use a specific IMC/Dune version
The setup checks for a folder named imc and dune in the top folder. If these are not found,
they are retrieved from the LSTS repositories (master). To use a different version,
simply add a folder called dune or imc, respectively, in the top folder. They will automatically be used.
### Source install

#### Clone the project recursively
```bash
git clone --recursive git://github.com/oysstu/imcpy.git
```
This includes the pybind11 submodule.

#### Build and install using setuptools (wrapper around cmake)
#### Build the library

```bash
python3 setup.py install
```

If you use the system python and only want to install for a single user, you can add --user to the install command without needing administrator rights. On Windows, the Windows SDK must be installed with Visual Studio and the CMake executable must be on the system PATH.

###### (Optional) Only generate bindings for a subset of IMC messages
##### (Optional) Use a specific IMC/Dune version
Replace the dune/imc submodules with the target versions

##### (Optional) Only generate bindings for a subset of IMC messages
A config file named whitelist.cfg can be placed in the root folder to
only create bindings for a subset of the IMC messages. This can be necessary when compiling on
embedded systems, as the linker consumes much memory for the full message set.
If an unknown message is parsed, it will be returned as the Message baseclass rather than a specialized message.
Look at minimal_whitelist.cfg for a set of messages that should always be included.


#### Recommendations
- The imcpy library generates stub files for the bindings, meaning that you can have autocomplete and static type checking if your IDE supports them. This can for example be [PyCharm](https://www.jetbrains.com/pycharm/) or [Jedi](https://github.com/davidhalter/jedi)-based editors.

0 comments on commit ce02efc

Please sign in to comment.