(mtool) C:\MMD\mlib_go\backend>go mod init github.com/miu200521358/mlib_go
go: creating new go.mod: module github.com/miu200521358/mlib_go
- VSCode に go 拡張をいれる
golang.go - コマンドプロンプトで下記を実行(× Power Shell)
- https://jmeubank.github.io/tdm-gcc/download/ をインストール
Minimal online installer.(多分最初のexeボタン)- PATH に TDM-GCC-64 までのパスを追加
- go.mod の最後の3行(replaceのとこ)をコメントアウト
- 開発用にローカルのを参照しているため
- ライブラリインポート
set GOOS=windowsset GOARCH=amd64set CGO_ENABLED=1go mod tidy
- ビルドできるはず
set CGO_ENABLED=1go run main.gogo build -o ../build/mlib.exe main.go
- ビルドできたらVSCode再起動で run もできるようになってるはず
go clean --modcache
go clean -cache
go clean -testcache
go fmt ./...
- .icoファイルを作成
- .rcファイルを作成
IDI_ICON1 ICON DISCARDABLE "app.ico"
- .resファイルにコンパイル
windres -O coff -o app.res app.rc
- ビルドスクリプトで実行
go run crumb/profile.gogo tool pprof crumb\profile.go crumb\cpu.pprofgo tool pprof -flat crumb\profile.go crumb\cpu.pprofgo tool pprof -cum crumb\profile.go crumb\cpu.pprofgo tool pprof -http=:8080 cpu.pprof
(pprof) top- プロファイル: ISAOミク+Addiction
go get github.com/goccy/go-graphviz/cmd/dotgo install github.com/goccy/go-graphvizgo tool pprof -http=:8081 mem.pprof
- SWIG インストール: https://rinatz.github.io/swigdoc/abstract.html
- TDM-GCC インストール: https://jmeubank.github.io/tdm-gcc/download/
新しいパッケージ構成(pkg\infra\drivers\mbullet\bt)用:
cd pkg\infra\drivers\mbullet\bt
swig_bt.batbt.go- Goバインディングbt.cxx- C++ラッパーbt.h- ヘッダーファイル
bullet.iを変更した場合のみ再実行が必要- SWIG の再生成はリポジトリ管理者が実施
- パスは環境に応じて調整すること
go list -m -mod=mod -versions github.com/miu200521358/dds
go list -m -mod=mod -versions github.com/miu200521358/win
go list -m -mod=mod -versions github.com/miu200521358/walk
set GOGC=1000set GODEBUG=gctrace=1(mtool) C:\MMD\mlib_go\crumb>go run profile.gogo tool pprof profile.go cpu.pprofgo tool pprof -http=:8080 cpu.pprof
export filename=pprof_model_load_20260201_201437_000
printf "top 50\n" | go tool pprof "$filename.pprof" > "${filename}_top_50.txt"
conda create -n mlib python=3.14 -y
conda activate mlib
pip install skillport
skillport init
Source code is licensed under CC-BY-NC-4.0. Official binaries distributed by the author may be used commercially under the LICENSE-EXCEPTION.