[Issue]: scikit-build pulling in unnecessary dependencies
Problem Description
When trying to install individual tools using provided instructions, e.g.
pip install "git+https://github.com/AMDResearch/nexus.git#egg=intellikit[accordo]"
I find that the IntelliKit package (which uses scikit-build) invokes CMake and the CMakeLists.txt builds the Nexus C++ library unconditionally. This isn't a breaking issue, but it does mean we pollute dependencies pulling in libdwarf, LLVM, etc. where they're not actually needed.
I think this is a packaging architecture issue in the IntelliKit repo. The [accordo], [nexus], and [metrix] extras are defined for runtime dependency selection, but the C++ build is monolithic. Eventually we should either:
a) Split into separate packages (e.g., intellikit-core, intellikit-nexus) where only nexus has kerneldb C++ components
b) Pre-build and publish wheels to PyPI so users don't need to build from source
Operating System
22.04.5 LTS (Jammy Jellyfish)
CPU
AMD EPYC 9554 64-Core Processor
GPU
AMD Instinct MI300X
ROCm Version
ROCm 6.4.1
Steps to Reproduce
No response
(Optional for Linux users) Output of /opt/rocm/bin/rocminfo --support
No response
Additional Information
No response
The BUILD_NEXUS CMake option should be turned off in that case.
https://github.com/AMDResearch/nexus/blob/92aac4b2fd5f119233eac885dc17a91ee46c1a3e/CMakeLists.txt#L13
I think we should be able to turn it off if the command to install is pip install "git+https://github.com/AMDResearch/nexus.git#egg=intellikit[accordo]" or similar.
I am open to ideas on how to package. I have tried to completely isolate the packges and have them in subdirectories (which worked fine) but the extras way seemed cleaner.
Thanks. I was able to use BUILD_NEXUS to fix this. I use uv as my package manager so I'll share that config here for others to learn from:
pyproject.toml
dependencies = [
...
"intellikit[accordo]",
...
]
[tool.uv.sources]
intellikit = { git = "https://github.com/AMDResearch/nexus.git" }
[tool.uv.extra-build-variables]
intellikit = { BUILD_NEXUS = "OFF" }
No you shouldn't have to do intellikit = { BUILD_NEXUS = "OFF" }. This repo package should take care of that. I will fix this.
If you use pip install "git+https://github.com/AMDResearch/intellikit.git#subdirectory=accordo" you get the desired behavior (but from a different mechanism).