WINDOWSでPYODE ~VS2022でbuild~

sponsored

 condaを利用すると簡単・便利ですが、余計なものが大量にインストールされてしまいます。そこでソースコードからbuildに挑戦しました。参考はこちら

0.環境

・Windows 10
・VisualStudio2022 Comunity 次のものを選択しました。(感謝)

・Python 3.7.9
・Cython 0.29.37
・ode-0.16.6 gitbusketから入手して、c:\ode-0.16.6に展開しました。
・pkg-config windows用を入手しました。pathを通しておきます。

1.odeのbuild

・c:\ode-0.16.6\buildに移動

$>premake4 --only-double --only-shared --plathorm=x64 vs2010

・vsを起動。c:\ode-0.16.6\build\vs2010のode.slnを読み込みます。ビルドの下辺りにある項目を「Release」「x64」にしてbuild開始します。特に問題なく終わるでしょう。
c:\ode-0.16.6\lib\releaseにode.libとode.dllが造られているでしょう。これをc:\ode-0.16.6\bindings\pythonにcopyします。

2.pkg-config

参考に従ってode.pcを準備します。次に環境変数を設定します。

set path=%path%;c:\pkg-config\bin
set include=%include%;C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\ucr
set include=%include%;C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\shared
set include=%include%;C:\ode-0.16.6\include
set LIB=%LIB%;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.20348.0\um\x64
set LIB=%LIB%;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.20348.0\ucrt\x64
set Path=%Path%;C:\Program Files (x86)\Windows Kits\10\bin\10.0.20348.0\x64
set PKG_CONFIG_PATH=c:\ode-0.16.6

3.setup.pyの実行

c:\ode-0.16.6\bindings\pythonに移動します。

$>python setup.py build_ext
$>python setup.py install

tutorial3を試してみました。参考に従って、tutorial3.pyの接触判定を変更しておきます。

以上です。

コメント

タイトルとURLをコピーしました