Skip to content

Add conan files#1184

Draft
codingwithmagga wants to merge 3 commits into
NVIDIA:mainfrom
codingwithmagga:codingwithmagga/fix-359-package-manager-support
Draft

Add conan files#1184
codingwithmagga wants to merge 3 commits into
NVIDIA:mainfrom
codingwithmagga:codingwithmagga/fix-359-package-manager-support

Conversation

@codingwithmagga
Copy link
Copy Markdown

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.

import os

from conan import ConanFile
from conan.tools.build import can_run
from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout

class TestPackageConan(ConanFile):
    settings = "os", "compiler", "build_type", "arch"
    generators = "CMakeDeps", "VirtualRunEnv"
    test_type = "explicit"

    def requirements(self):
        self.requires('matx/1.0.0')

    def layout(self):
        cmake_layout(self)

    def generate(self):
        tc = CMakeToolchain(self)
        tc.generate()

    def build(self):
        cmake = CMake(self)
        cmake.configure()
        cmake.build()        

    def test(self):
        if can_run(self):
            bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package")
            self.run(bin_path, env="conanrun")

I added a CMakeLists.txt and a folder src where I copied the examples from this repo to.

cmake_minimum_required(VERSION 3.25.2)

if(NOT DEFINED CMAKE_CUDA_ARCHITECTURES)
    set(CMAKE_CUDA_ARCHITECTURES "native")
    message(STATUS "Using native GPU architecture since CMAKE_CUDA_ARCHITECTURES not defined")
endif()

project(test_package LANGUAGES CXX CUDA)

find_package(matx CONFIG REQUIRED)

add_subdirectory(src)

Now you can run conan build . to create the examples using conan and the matx conan package.

@copy-pr-bot
Copy link
Copy Markdown

copy-pr-bot Bot commented May 20, 2026

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant