Readme updated

This commit is contained in:
Nicolas 2025-10-30 09:15:43 +01:00
parent f60df09fa7
commit eea2fc6bde
1 changed files with 19 additions and 8 deletions

View File

@ -15,6 +15,13 @@ Because the language is an embedded language, it can relay heavily on **python t
## How it works
The **Compilation** step starts with tracing the python code to generate a acyclic directed graph (DAG) of variables and operations. The DAG can be optimized and gets than linearized to a sequence of operations. Each operation gets mapped to a pre-compiled stencil, which is a piece of machine code with placeholders for memory addresses. The compiler generates patch instructions to fill the placeholders with the correct memory addresses. The binary code build from the stencils, data for constants and the patch instructions are than passed to the Runner for execution. The runner allocates memory for the code and data, applies the patch instructions to correct memory addresses and finally executes the code.
## Getting started
To install copapy, you can use pip:
```bash
pip install copapy
```
## Developer Guide
Contributions are welcome, please open an issue or submit a pull request on GitHub.
@ -29,26 +36,24 @@ You may setup a venv:
```bash
python -m venv .venv
source .venv/bin/activate # On Windows use `.venv\Scripts\activate`
source .venv/bin/activate # On Windows `.venv\Scripts\activate`
```
Build and install the package and dev dependencies:
```bash
pip install .[dev]
pip install -e .[dev]
```
If this fails because you have no suitable c compiler installed you can either install a
compiler or use the binary from pypi:
If the build fails because you have no suitable c compiler installed, you can either install a compiler or use the binary from pypi:
```bash
pip install copapy[dev]
```
When using pytest it will run the binary from pypi but the local python code still from the repo.
When running pytest it will use the binary from pypi but the local python code gets executed from the local repo.
For running all tests you need the stencil object files and the compiled runner.
You can download the stencils and binary runner from GitHub or build them with gcc yourself.
For running all tests you need the stencil object files and the compiled runner. You can download the stencils and binary runner from GitHub or build them with gcc yourself.
For downloading the latest binaries from GitHub run:
@ -62,7 +67,13 @@ To build the binaries from source on Linux run:
bash tools/build.sh
```
Ensure that everything is set up correctly by running the unit tests:
The runner (without the stencils) can be build on windows with:
```
tools\build
```
Ensure that everything is set up correctly by running the tests:
```bash
pytest