Skip to content

Commit 7a19f2f

Browse files
authored
Update README.md (#206)
1 parent afd0be3 commit 7a19f2f

File tree

1 file changed

+18
-17
lines changed

1 file changed

+18
-17
lines changed

usvm-python/README.md

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ To turn them on, first you need to set up `CPython`. For that:
77

88
1. Clone `CPython` as repository submodule ([refer to the section about submodules](#working-with-git-submodule)).
99

10-
2. If you are using Unix, you also need to install optional dependencies ([refer to the section about CPython build](#cpython-build)).
10+
2. Install dependencies ([refer to the section about CPython build](#cpython-build)). This step is mandatory for all operating systems.
1111

1212
After these steps, add gradle property `cpythonActivated=true`. This can be done in `GRADLE_USER_HOME` directory
1313
([about](https://docs.gradle.org/current/userguide/directory_layout.html#dir:gradle_user_home))
@@ -49,9 +49,16 @@ Official instruction: https://devguide.python.org/getting-started/setup-building
4949

5050
Gradle tasks for building and running were tested on Windows, Ubuntu and MacOS 14.4.1.
5151

52+
### Windows
53+
5254
For Windows you need MSBuild (see https://devguide.python.org/getting-started/setup-building/#windows).
5355

54-
1. Install optional dependencies.
56+
Note that you need `Python native development tool` component. You may also need `Desktop development with C++` component.
57+
58+
### Linux and MacOS
59+
60+
For these OS you need to install optional dependencies.
61+
5562
- Only for Linux.
5663
- Official instruction: https://devguide.python.org/getting-started/setup-building/#install-dependencies
5764
- __Short version (Ubuntu)__. Install the following packages with apt:
@@ -73,16 +80,18 @@ For Windows you need MSBuild (see https://devguide.python.org/getting-started/se
7380
cpython.ssl.path=/opt/homebrew/opt/openssl
7481
```
7582
76-
2. Use Gradle tasks to do the rest.
83+
### After dependecies are installed
84+
85+
Use Gradle tasks to do the rest.
7786
78-
- Task to run tests (see `src/test/resources/samples` and `src/test/kotlin/org/usvm/samples`):
87+
- Task to run tests (see `src/test/resources/samples` and `src/test/kotlin/org/usvm/samples`):
7988
80-
- `:usvm-python:test` (name of task group --- `verification`)
89+
- `:usvm-python:test` (name of task group --- `verification`)
8190
82-
- Tasks for running `src/test/kotlin/manualTest.kt` (name of task group --- `run`):
91+
- Tasks for running `src/test/kotlin/manualTest.kt` (name of task group --- `run`):
8392
84-
- `:usvm-python:manualTestDebug`: run with debug logging and debug build of CPython
85-
- `:usvm-python:manualTestDebugNoLogs`: run with info logging and debug build of CPython
93+
- `:usvm-python:manualTestDebug`: run with debug logging and debug build of CPython
94+
- `:usvm-python:manualTestDebugNoLogs`: run with info logging and debug build of CPython
8695
8796
## Structure of `usvm-python`
8897
@@ -125,20 +134,12 @@ For Windows you need MSBuild (see https://devguide.python.org/getting-started/se
125134
126135
Add the definition of the native method in `CPythonAdapter.java`.
127136
128-
Regenerate `org_usvm_interpreter_CPythonAdapter.h`:
129-
130-
```
131-
cd usvm-python-main/src/main/java
132-
javah org.usvm.interpreter.CPythonAdapter
133-
mv org_usvm_interpreter_CPythonAdapter.h ../../../../cpythonadapter/src/main/c/include
134-
```
137+
Header `org_usvm_interpreter_CPythonAdapter.h` should be generated automatically before building `usvm-python:cpythonadapter` module. It can be found in the build directory. The Gradle task that is responsible for that is `usvm-python-main:build`.
135138
136139
Then implement the corresponding methods in `org_usvm_interpreter_CPythonAdapter.c`.
137140
138141
### Static method that can be called from C code
139142
140-
TODO: this is deprecated.
141-
142143
Implement the method in `CPythonAdapter.java`.
143144
144145
Annotate the method with `CPythonAdapterJavaMethod(cName = <c_name>)`.

0 commit comments

Comments
 (0)