lang:c:pybind11
差分
このページの2つのバージョン間の差分を表示します。
両方とも前のリビジョン前のリビジョン次のリビジョン | 前のリビジョン | ||
lang:c:pybind11 [2025/08/11 10:45] – editor | lang:c:pybind11 [2025/08/17 09:35] (現在) – editor | ||
---|---|---|---|
行 1: | 行 1: | ||
====== pybind11 ====== | ====== pybind11 ====== | ||
===== インストール ===== | ===== インストール ===== | ||
+ | |||
+ | ---- | ||
===== コンパイル/ | ===== コンパイル/ | ||
+ | リンク時に以下を追加する | ||
+ | `python3-config --cflags --ldflags` -fPIC -shared | ||
+ | ---- | ||
===== 実装 ===== | ===== 実装 ===== | ||
==== 関数 ==== | ==== 関数 ==== | ||
行 9: | 行 14: | ||
==== template ==== | ==== template ==== | ||
+ | ---- | ||
+ | ==== multithread ==== | ||
+ | thread で pybind11 の module を実行しても、multithread にならない。 | ||
+ | source に以下を記述する。 | ||
+ | |||
+ | ---- | ||
===== Mac ===== | ===== Mac ===== | ||
OS でデフォルトの python では、リンク時にエラーになる場合がある。 | OS でデフォルトの python では、リンク時にエラーになる場合がある。 | ||
- | そもそもデフォルトでは、python3-config がないので、 | + | デフォルトでは、python3-config がないので、 |
Homebrew で python をインストールして、そちらを使う。 | Homebrew で python をインストールして、そちらを使う。 | ||
lang/c/pybind11.1754909156.txt.gz · 最終更新: by editor