-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
(#10727) Add recipe for cuda-api-wrappers/0.5.1 #10728
Conversation
This comment has been minimized.
This comment has been minimized.
self.cpp_info.names["cmake_find_package"] = "cuda-api-wrappers" | ||
self.cpp_info.names["cmake_find_package_multi"] = "cuda-api-wrappers" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Target name is wrong, there should be 3 imported targets cuda-api-wrapers::runtime-and-driver
, cuda-api-wrapers::nvtx
and cuda-api-wrapers::nvrtc
:
https://github.com/eyalroz/cuda-api-wrappers/blob/b2d2c22f577be74a4070f47dacff3736d5878835/CMakeLists.txt#L39-L43
https://github.com/eyalroz/cuda-api-wrappers/blob/b2d2c22f577be74a4070f47dacff3736d5878835/CMakeLists.txt#L92-L94
https://github.com/eyalroz/cuda-api-wrappers/blob/b2d2c22f577be74a4070f47dacff3736d5878835/CMakeLists.txt#L117-L122
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SpaceIm Thank you!
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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() { | ||
|
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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,...)
This comment has been minimized.
This comment has been minimized.
fd0b901
to
005b2cb
Compare
This comment has been minimized.
This comment has been minimized.
@@ -0,0 +1,34 @@ | |||
from conans import ConanFile, tools | |||
from conans.errors import ConanInvalidConfiguration |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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() { | ||
|
There was a problem hiding this comment.
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,...)
self.cpp_info.names["cmake_find_package"] = "cuda-api-wrappers" | ||
self.cpp_info.names["cmake_find_package_multi"] = "cuda-api-wrappers" |
There was a problem hiding this comment.
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
All green in build 7 (
|
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. |
This pull request has been automatically closed because it has not had recent activity. Thank you for your contributions. |
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