一键导入
luarocks-cmake-packaging
Create luarocks rockspec with cmake build, dynamic backend .so copying, cross-platform
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Create luarocks rockspec with cmake build, dynamic backend .so copying, cross-platform
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Add device information query functions through HAL → ins:: API → language bindings
Add --device all/--timer/--info CLI flags to demos across all languages for competition scoring
Add composite signal operators using existing primitives (no dedicated backend kernels needed)
How to port a cusignal Python/CUDA module to ins::signal C++ using Insight7 primitives and HAL
Profile and optimize binding language (Lua/Julia/Python) demo performance to match or exceed C++ baseline
busted loads _insight.so from ~/.luarocks/lib first, not build/ — must copy .so after rebuild
| name | luarocks-cmake-packaging |
| description | Create luarocks rockspec with cmake build, dynamic backend .so copying, cross-platform |
| source | auto-skill |
| extracted_at | 2026-06-05T14:22:08.096Z |
Problem: luarocks cmake build type calls cmake --install which fails on FetchContent codec dependencies (ogg/flac/vorbis). Also, install.lib doesn't support glob patterns for dynamic backend discovery.
Solution: Use command build type with custom build_command + install section.
Rockspec template (insight-1.0-1.rockspec):
build = {
type = "command",
build_command = [[
cmake -S . -B build.luarocks \
-DCMAKE_BUILD_TYPE=Release \
-DINSIGHT_BUILD_TESTS=OFF \
-DINSIGHT_BUILD_DEMOS=OFF \
-DINSIGHT_BUILD_BINDINGS=ON \
-DINSIGHT_BUILD_PYTHON_BINDING=OFF \
-DINSIGHT_BUILD_JULIA_BINDING=OFF \
-DINSIGHT_BUILD_LUA_BINDING=ON \
-DINSIGHT_WITH_CUDA=ON \
-DINSIGHT_USE_FFTW3=ON \
-DINSIGHT_USE_OPENBLAS=ON \
-DINSIGHT_USE_MATPLOT=ON \
-DLUA_INCLUDE_DIR="$(LUA_INCDIR)" \
&& cmake --build build.luarocks -j 24
]],
install = {
lua = {
["insight"] = "bindings/lua/insight/init.lua",
["insight.init"] = "bindings/lua/insight/init.lua",
},
lib = {
"build.luarocks/bindings/lua/_insight",
},
},
}
Key decisions:
command type avoids cmake --install (which fails on codec deps)install.lib only lists _insight (luarocks creates symlink)LUA_INCLUDE_DIR="$(LUA_INCDIR)" passes luarocks' Lua headers to cmake$(LUA_LIBDIR) — not always set by luarocksBackend .so handling:
libinsight_*_backend.so to bindings/lua/init.lua finds backends via package.cpath search + symlink resolutionParallel build: CMAKE_BUILD_PARALLEL_LEVEL=24 or MAKEFLAGS="-j24"
Testing:
luarocks --lua-version 5.3 make bindings/lua/insight-1.0-1.rockspec LUA_DIR=/usr --local
eval $(luarocks path --lua-version 5.3)
lua5.3 -e 'local ins = require("insight"); print(ins.zeros({3,3}))'
Why: cmake build type in luarocks calls cmake --install which triggers codec deps install rules. command type gives full control.