Pythod extension Linux tweaks (#1125)

This commit is contained in:
Nikolay Igotti
2017-12-11 15:37:36 +03:00
committed by GitHub
parent e80f7421c7
commit 91bc9fa587
2 changed files with 16 additions and 2 deletions
+14
View File
@@ -7,6 +7,11 @@ lands.
To build and run the sample do the following:
* Install Python with development headers, i.e.
```
sudo apt install python-dev
```
* Run `build.sh`, it will ask for superuser password to install Python extension
* On macOS copy Kotlin binary to extension's directory and change install name with
`install_name_tool` tool, i.e.
@@ -15,6 +20,15 @@ To build and run the sample do the following:
sudo install_name_tool /Library/Python/2.7/site-packages/kotlin_bridge.so \
-change libserver.dylib @loader_path/libserver.dylib
```
* On Linux copy Kotlin binary in some place where libraries could be loaded from, i.e.
```
cp libserver.so /usr/local/lib/
ldconfig
```
or modify dynamic loader search path with
```
export LD_LIBRARY_PATH=`pwd`
```
* run Python code using Kotlin functionality with
```
@@ -23,9 +23,9 @@
// Note, that as we cache this in the global, and Kotlin/Native object references
// are currently thread local, we make this global a TLS variable.
__thread static server_kref_demo_Server server = { 0 };
static __thread server_kref_demo_Server server = { 0 };
static T_(Server) getServer() {
static T_(Server) getServer(void) {
if (!server.pinned) {
server = __ kotlin.demo.Server.Server("the server");
}