@@ -7,7 +7,7 @@ To turn them on, first you need to set up `CPython`. For that:
7
7
8
8
1 . Clone ` CPython ` as repository submodule ([ refer to the section about submodules] ( #working-with-git-submodule ) ).
9
9
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 .
11
11
12
12
After these steps, add gradle property ` cpythonActivated=true ` . This can be done in ` GRADLE_USER_HOME ` directory
13
13
([ 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
49
49
50
50
Gradle tasks for building and running were tested on Windows, Ubuntu and MacOS 14.4.1.
51
51
52
+ ### Windows
53
+
52
54
For Windows you need MSBuild (see https://devguide.python.org/getting-started/setup-building/#windows ).
53
55
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
+
55
62
- Only for Linux.
56
63
- Official instruction: https://devguide.python.org/getting-started/setup-building/#install-dependencies
57
64
- __ 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
73
80
cpython.ssl.path=/opt/homebrew/opt/openssl
74
81
```
75
82
76
- 2. Use Gradle tasks to do the rest.
83
+ ### After dependecies are installed
84
+
85
+ Use Gradle tasks to do the rest.
77
86
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`):
79
88
80
- - `:usvm-python:test` (name of task group --- `verification`)
89
+ - `:usvm-python:test` (name of task group --- `verification`)
81
90
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`):
83
92
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
86
95
87
96
## Structure of `usvm-python`
88
97
@@ -125,20 +134,12 @@ For Windows you need MSBuild (see https://devguide.python.org/getting-started/se
125
134
126
135
Add the definition of the native method in `CPythonAdapter.java`.
127
136
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`.
135
138
136
139
Then implement the corresponding methods in `org_usvm_interpreter_CPythonAdapter.c`.
137
140
138
141
### Static method that can be called from C code
139
142
140
- TODO: this is deprecated.
141
-
142
143
Implement the method in `CPythonAdapter.java`.
143
144
144
145
Annotate the method with `CPythonAdapterJavaMethod(cName = <c_name>)`.
0 commit comments