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

set opencl pkg_config name #8623

Closed
wants to merge 4 commits into from
Closed

Conversation

dvirtz
Copy link
Contributor

@dvirtz dvirtz commented Jan 4, 2022

Specify library name and version: opencl-headers

the name of the pc file installed by ocl-icd system package is OpenCL.pc


  • 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.

Copy link
Contributor

@SpaceIm SpaceIm left a comment

Choose a reason for hiding this comment

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

update required_conan_version = ">=1.43.0" please

self.cpp_info.names["cmake_find_package"] = "OpenCL"
self.cpp_info.names["cmake_find_package_multi"] = "OpenCL"
self.cpp_info.names["pkg_config"] = "OpenCL"
self.cpp_info.set_property("cmake_target_name", "OpenCL")
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
self.cpp_info.set_property("cmake_target_name", "OpenCL")
self.cpp_info.set_property("cmake_target_name", "OpenCL::Headers")

self.cpp_info.names["cmake_find_package"] = "OpenCL"
self.cpp_info.names["cmake_find_package_multi"] = "OpenCL"
self.cpp_info.names["pkg_config"] = "OpenCL"
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
self.cpp_info.names["pkg_config"] = "OpenCL"
self.cpp_info.set_property("pkg_config_name", "OpenCL")

recipes/opencl-headers/all/conanfile.py Show resolved Hide resolved
@conan-center-bot

This comment has been minimized.

self.cpp_info.components["_opencl-headers"].names["cmake_find_package"] = "Headers"
self.cpp_info.components["_opencl-headers"].names["cmake_find_package_multi"] = "Headers"
self.cpp_info.components["_opencl-headers"].set_property("cmake_target_name", "OpenCL::Headers")
self.cpp_info.components["_opencl-headers"].set_property("pkg_config_name", "OpenCL")

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

You know you can accept suggestions through github? It saves time sometimes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, but I prefer to test that locally before committing

self.cpp_info.names["cmake_find_package"] = "OpenCL"
self.cpp_info.names["cmake_find_package_multi"] = "OpenCL"
self.cpp_info.set_property("cmake_target_name", "OpenCL::OpenCL")
Copy link
Contributor

@SpaceIm SpaceIm Jan 4, 2022

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.set_property("cmake_target_name", "OpenCL::OpenCL")
self.cpp_info.set_property("cmake_target_name", "OpenCL::Headers")

No (same review than #8623 (comment))

Copy link
Contributor Author

Choose a reason for hiding this comment

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

can you explain that? from the docs it seems that this recipe generates the target OpenCL::OpenCL for both the cmake_find_package and the cmake_find_package_multi generators.

Copy link
Contributor

@SpaceIm SpaceIm Jan 4, 2022

Choose a reason for hiding this comment

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

It's an unwanted side effect of cmake_find_package, the truth is OpenCL-Headers source code which only provides OpenCL::Headers target. set_property() is better in this case, and we should drop those side effects in CMakeDeps.

@conan-center-bot

This comment has been minimized.

SpaceIm
SpaceIm previously approved these changes Jan 4, 2022
@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

self.cpp_info.components["_opencl-headers"].names["cmake_find_package"] = "Headers"
self.cpp_info.components["_opencl-headers"].names["cmake_find_package_multi"] = "Headers"
self.cpp_info.components["_opencl-headers"].set_property("cmake_target_name", "OpenCL::Headers")
self.cpp_info.components["_opencl-headers"].set_property("pkg_config_name", "OpenCLHeaders")
Copy link
Contributor

@SpaceIm SpaceIm Jan 4, 2022

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.components["_opencl-headers"].set_property("pkg_config_name", "OpenCLHeaders")
self.cpp_info.components["_opencl-headers"].set_property("pkg_config_name", "OpenCLHeaders")

No, if "official" pkg-config file is OpenCL.pc, just set pkg_config_name to OpenCL.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

but this causes PkgConfigDeps to generate a self including file:

Name: OpenCL
Description: Conan package: OpenCL
Version: 2021.06.30
Requires: OpenCL

with this change it generates

Name: OpenCL
Description: Conan package: OpenCL
Version: 2021.06.30
Requires: OpenCLHeaders

and

prefix=/home/conan/.conan/data/opencl-headers/2021.06.30/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9
libdir1=${prefix}/lib
includedir1=${prefix}/include

Name: OpenCLHeaders
Description: Conan component: OpenCLHeaders
Version: 2021.06.30
Libs: -L"${libdir1}" -F Frameworks 
Cflags: -I"${includedir1}" 

Copy link
Contributor

Choose a reason for hiding this comment

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

I would say it's a bug of PkgConfigDeps, it's still experimental.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

what would you expect the generator to do?

Copy link
Contributor

Choose a reason for hiding this comment

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

Actually i would expect the component pkg-config file to override the global pkg-config file like it happens for pkg-config generator

Copy link
Contributor

Choose a reason for hiding this comment

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

@SpaceIm, I think that here maybe the best would be not to declare the pkg_config_name property in the component at all, just for the root cpp_info, so Conan will create a new name for the component (OpenCL-_opencl-headers.pc in this case) that is included in the OpenCL.pc that is the one we want.
Doing that names will not collide and also not declaring the property with other invented named we don't promote names that are not official... Also, for Conan 1.45 we have added a warning to try to avoid names overlapping when using PkgConfigDeps. WDYT?

Copy link
Contributor

Choose a reason for hiding this comment

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

Conan 1.45 will bring the same behavior for PkgConfigDeps. It's already tested here conan-io/conan#10344. The documentation is pending but it's ongoing.
In summary, you can put:

self.cpp_info.components["_opencl-headers"].set_property("pkg_config_name", "OpenCL")

and you're not going to create the self including file anymore.

@ghost
Copy link

ghost commented Jan 31, 2022

I detected other pull requests that are modifying opencl-headers/all recipe:

This message is automatically generated by https://github.com/ericLemanissier/conan-center-conflicting-prs so don't hesitate to report issues/improvements there.

@ghost ghost mentioned this pull request Feb 4, 2022
4 tasks
@conan-center-bot

This comment has been minimized.

@conan-center-bot
Copy link
Collaborator

Failure in build 3 (838d75e0de581b19d508fa3d318768cba801ad17):

  • opencl-headers/2022.01.04@:
    All packages built successfully! (All logs)

  • opencl-headers/2021.04.29@:
    All packages built successfully! (All logs)

  • opencl-headers/2021.06.30@:
    All packages built successfully! (All logs)

  • opencl-headers/2020.06.16@:
    All packages built successfully! (All logs)

  • opencl-headers/2020.12.18@:
    An unexpected error happened and has been reported

  • opencl-headers/2020.03.13@:
    All packages built successfully! (All logs)


Note: To save resources, CI tries to finish as soon as an error is found. For this reason you might find that not all the references have been launched or not all the configurations for a given reference. Also, take into account that we cannot guarantee the order of execution as it depends on CI workload and workers availability.

@SpaceIm
Copy link
Contributor

SpaceIm commented Mar 11, 2022

this PR can be closed, pkg-config name has been fixed already in #9259

@SSE4 SSE4 closed this Mar 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants