Add conan files#1184
Conversation
…ps://github.com/codingwithmagga/MatX into codingwithmagga/fix-359-package-manager-support
|
Thanks for doing this! One comment I have is that the version number is hard-coded in many places making it a maintenance burden to update all the right places. Would it be possible to grab the source version from CMakeLists.txt, which is our current source of truth? Also, what would be required to make this present in the public conan repo? |
Greptile SummaryThis PR adds Conan 2 packaging support for MatX, introducing a root-level
Confidence Score: 4/5Safe to merge as a first-cut Conan packaging addition; no changes to library code or existing build infrastructure. The core recipe logic is sound and follows Conan 2 conventions. The main gap is that conanfile.py — the recipe's missing Important Files Changed
Sequence DiagramsequenceDiagram
participant Dev as Developer
participant Conan as Conan CLI
participant CMake as CMake
participant CPM as CPM/FetchContent
participant GitHub as GitHub (CCCL)
participant Cache as Local Conan Cache
Dev->>Conan: conan create .
Conan->>CMake: cmake.configure()
CMake->>CPM: rapids_cpm_cccl()
CPM->>GitHub: Download CCCL (requires internet)
GitHub-->>CPM: CCCL source
CMake-->>Conan: Configure done
Conan->>CMake: cmake.install()
CMake-->>Conan: Headers + cmake config files
Conan->>Cache: Store matx/1.0.0 package
Dev->>Conan: conan build . (test_package)
Conan->>CMake: Generate CMakeDeps + CMakeToolchain
CMake->>Cache: find_package(matx CONFIG REQUIRED)
Cache-->>CMake: matx::matx target
CMake-->>Dev: test_package binary built
Reviews (1): Last reviewed commit: "Merge branch 'codingwithmagga/fix-359-pa..." | Re-trigger Greptile |
@cliffburdick I start with the second question:
sources:
"1.0.0":
url: "https://github.com/NVIDIA/MatX/archive/refs/tags/v1.0.0.tar.gz"
sha256: "some_sha"And versions:
"1.0.0":
folder: allI never uploaded an open source conan package to this repository so it may be that they have some small change requests, but I assume that the changes won't be to big. But this process may take some time. If you want I can have a look at this next week or you can do that by yourself of course. To your first question: Although it is in principle possible to get the cmake version into your conan file I would not recommend that since conan calls cmake not the other way around. I updated the documentation slightly to a generic MatX version to remove the hardcoded 1.0.0 version there. |
Conan
Add conan files to create a matx conan package.
Workflow
In the main folder run
conan create .This creates the matx conan package on your system.
Test
After creating the conan package create a new folder with a
conanfile.py.I added a
CMakeLists.txtand a foldersrcwhere I copied the examples from this repo to.Now you can run
conan build .to create the examples using conan and the matx conan package.