Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(#10727) Add recipe for cuda-api-wrappers/0.5.1 #10728

Closed

Conversation

aborzunov
Copy link
Contributor

Specify library name and version: cuda-api-wrappers/0.5.1

Thin C++-flavored header-only wrappers for the CUDA APIs.

This library is header-only, but it requires cuda. So test-package just checks presence of some header that do not include cuda related headers.

closes #10727


  • I've read the guidelines for contributing.
  • I've followed the PEP8 style guides for Python code in the recipes.
  • I've used the latest Conan client version.
  • I've tried at least one configuration locally with the conan-center hook activated.

@conan-center-bot

This comment has been minimized.

Comment on lines +37 to +34
self.cpp_info.names["cmake_find_package"] = "cuda-api-wrappers"
self.cpp_info.names["cmake_find_package_multi"] = "cuda-api-wrappers"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
self.cpp_info.names["cmake_find_package"] = "cuda-api-wrappers"
self.cpp_info.names["cmake_find_package_multi"] = "cuda-api-wrappers"
# TODO: to remove in conan v2 once cmake_find_package* generators removed
self.cpp_info.names["cmake_find_package"] = "cuda-api-wrappers"
self.cpp_info.names["cmake_find_package_multi"] = "cuda-api-wrappers"
self.cpp_info.set_property("cmake_file_name", "cuda-api-wrappers")
self.cpp_info.set_property("cmake_target_name", "cuda-api-wrapers::cuda-api-wrappers")

Better compatibility with Conan 2.0

Copy link
Contributor

@SpaceIm SpaceIm May 11, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SpaceIm Thank you!

Copy link
Contributor Author

@aborzunov aborzunov May 30, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit confused, how to declare 3 imported targets?

   def package_info(self):
       self.cpp_info.names["cmake_find_package"] = "cuda-api-wrappres"
       self.cpp_info.names["cmake_find_package_multi"] = "cuda-api-wrappers"

       self.cpp_info.components["runtime-and-driver"].names["cmake_find_package"] = "runtime-and-driver"
       self.cpp_info.components["runtime-and-driver"].system_libs = ["libcudart", "libcuda"]

       self.cpp_info.components["nvrtc"].names["cmake_find_package"] = "nvrtc"
       self.cpp_info.components["nvrtc"].system_libs = ["libnvrtc", "libcudart", "libcuda"]

       self.cpp_info.components["nvtx"].names["cmake_find_package"] = "nvtx"
       self.cpp_info.components["nvtx"].requires = ["runtime-and-driver"]
       self.cpp_info.components["nvtx"].system_libs = ["libnvToolsExt", "libthreads",
                                                       "libcudart", "libcuda"]

Can you provide any example?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, with Conan the only way to provide several targets is to create several components



int main() {

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try consuming something from header. You could generate a version, for instance: https://github.com/eyalroz/cuda-api-wrappers/blob/master/src/cuda/api/versions.hpp#L115

Copy link
Contributor

@SpaceIm SpaceIm May 11, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's not possible, there is a dependency to CUDA. This recipe shouldn't be merged until we have some cuda recipe, even a placeholder. #4844

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this recipe requires cuda it should declare it as requirement, even if this is a header-only package. Of course, we need first that recipe (placeholder, mock,...)

@SSE4 SSE4 closed this May 27, 2022
@SSE4 SSE4 reopened this May 27, 2022
@SSE4 SSE4 closed this May 27, 2022
@SSE4 SSE4 reopened this May 27, 2022
@conan-center-bot

This comment has been minimized.

@aborzunov aborzunov force-pushed the recipe/cuda-api-wrappers-#10727 branch from fd0b901 to 005b2cb Compare May 30, 2022 12:01
@conan-center-bot

This comment has been minimized.

@@ -0,0 +1,34 @@
from conans import ConanFile, tools
from conans.errors import ConanInvalidConfiguration
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
from conans.errors import ConanInvalidConfiguration

Checks from the linter will be mandatory in the near future, so better to start fixing them. Thanks!



int main() {

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this recipe requires cuda it should declare it as requirement, even if this is a header-only package. Of course, we need first that recipe (placeholder, mock,...)

Comment on lines +37 to +34
self.cpp_info.names["cmake_find_package"] = "cuda-api-wrappers"
self.cpp_info.names["cmake_find_package_multi"] = "cuda-api-wrappers"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, with Conan the only way to provide several targets is to create several components

@conan-center-bot
Copy link
Collaborator

All green in build 7 (005b2cb17dc4f32219f1b55a47f3288b59060cdf):

  • cuda-api-wrappers/0.5.1@:
    All packages built successfully! (All logs)

    Result of export using Conan v2 (informative)

    We have started the migration process to Conan v2 and exporting recipes successfully will be required in the future.
    This is just an informative note to gain awareness about the process, no need to take any action. The plan is to enforce smaller steps that are easier to fix and, eventually, this export step will work.

    ERROR: Error loading conanfile at '/home/conan/w/prod_cci_PR-10728/recipes/cuda-api-wrappers/all/conanfile.py': Unable to load conanfile in /home/conan/w/prod_cci_PR-10728/recipes/cuda-api-wrappers/all/conanfile.py
      File "<frozen importlib._bootstrap_external>", line 728, in exec_module
      File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
      File "/home/conan/w/prod_cci_PR-10728/recipes/cuda-api-wrappers/all/conanfile.py", line 1, in <module>
        from conans import ConanFile, tools
    ImportError: cannot import name 'ConanFile' from 'conans' (/opt/pyenv/versions/3.7.13/lib/python3.7/site-packages/conans/__init__.py)
    

@stale
Copy link

stale bot commented Aug 1, 2022

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Aug 1, 2022
@stale
Copy link

stale bot commented Sep 8, 2022

This pull request has been automatically closed because it has not had recent activity. Thank you for your contributions.

@stale stale bot closed this Sep 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[request] cuda-api-wrappers/0.5.1
6 participants