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

[cgal] compatibility with Conan 2.0, and cgal/5.5.2 #17858

Merged
merged 19 commits into from
Jun 20, 2023

Conversation

lrineau
Copy link
Contributor

@lrineau lrineau commented Jun 7, 2023

Specify library name and version: cgal/5.5.2

This pull-request adds cgal/5.5.2, but its major contribution is the compatibiity with Conan 2.0.

Fixes #10011.


@CLAassistant
Copy link

CLAassistant commented Jun 7, 2023

CLA assistant check
All committers have signed the CLA.

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

That is for compatibility with Conan 1.x.
@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@github-actions
Copy link
Contributor

github-actions bot commented Jun 8, 2023

Hooks produced the following warnings for commit cdb7052
cgal/5.3.2
post_package_info(): WARN: [CMAKE FILE NOT IN BUILD FOLDERS (KB-H019)] The *.cmake files have to be placed in a folder declared as `cpp_info.builddirs`. Currently folders declared: {'/home/conan/w/prod/BuildSingleReference/.conan/data/cgal/5.3.2/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/'}
post_package_info(): WARN: [CMAKE FILE NOT IN BUILD FOLDERS (KB-H019)] Found files: ./lib/cmake/CGAL/CGAL_Boost_iostreams_support.cmake; ./lib/cmake/CGAL/CGAL_Boost_serialization_support.cmake; ./lib/cmake/CGAL/CGAL_Ceres_support.cmake; ./lib/cmake/CGAL/CGAL_CheckCXXFileRuns.cmake; ./lib/cmake/CGAL/CGAL_Common.cmake; ./lib/cmake/CGAL/CGAL_CreateSingleSourceCGALProgram.cmake; ./lib/cmake/CGAL/CGAL_Eigen3_support.cmake; ./lib/cmake/CGAL/CGAL_Eigen_support.cmake; ./lib/cmake/CGAL/CGAL_GLPK_support.cmake; ./lib/cmake/CGAL/CGAL_GeneratorSpecificSettings.cmake; ./lib/cmake/CGAL/CGAL_LASLIB_support.cmake; ./lib/cmake/CGAL/CGAL_METIS_support.cmake; ./lib/cmake/CGAL/CGAL_Macros.cmake; ./lib/cmake/CGAL/CGAL_OpenCV_support.cmake; ./lib/cmake/CGAL/CGAL_OpenGR_support.cmake; ./lib/cmake/CGAL/CGAL_Qt5_moc_and_resource_files.cmake; ./lib/cmake/CGAL/CGAL_SCIP_support.cmake; ./lib/cmake/CGAL/CGAL_SCM.cmake; ./lib/cmake/CGAL/CGAL_SetupBoost.cmake; ./lib/cmake/CGAL/CGAL_SetupCGALDependencies.cmake; ./lib/cmake/CGAL/CGAL_SetupCGAL_CoreDependencies.cmake; ./lib/cmake/CGAL/CGAL_SetupCGAL_ImageIODependencies.cmake; ./lib/cmake/CGAL/CGAL_SetupCGAL_Qt5Dependencies.cmake; ./lib/cmake/CGAL/CGAL_SetupDependencies.cmake; ./lib/cmake/CGAL/CGAL_SetupFlags.cmake; ./lib/cmake/CGAL/CGAL_SetupGMP.cmake; ./lib/cmake/CGAL/CGAL_SetupLEDA.cmake; ./lib/cmake/CGAL/CGAL_SetupVLD.cmake; ./lib/cmake/CGAL/CGAL_TBB_support.cmake; ./lib/cmake/CGAL/CGAL_TweakFindBoost.cmake; ./lib/cmake/CGAL/CGAL_UseLEDA.cmake; ./lib/cmake/CGAL/CGAL_UseMKL.cmake; ./lib/cmake/CGAL/CGAL_UseMPFI.cmake; ./lib/cmake/CGAL/CGAL_UseRS.cmake; ./lib/cmake/CGAL/CGAL_UseRS3.cmake; ./lib/cmake/CGAL/CGAL_VersionUtils.cmake; ./lib/cmake/CGAL/CGAL_add_test.cmake; ./lib/cmake/CGAL/CGAL_display_flags.cmake; ./lib/cmake/CGAL/CGAL_enable_end_of_configuration_hook.cmake; ./lib/cmake/CGAL/CGAL_parse_version_h.cmake; ./lib/cmake/CGAL/CGAL_pointmatcher_support.cmake; ./lib/cmake/CGAL/CGAL_setup_target_dependencies.cmake; ./lib/cmake/CGAL/CGAL_target_use_TBB.cmake; ./lib/cmake/CGAL/UseCGAL.cmake; ./lib/cmake/CGAL/UseESBTL.cmake; ./lib/cmake/CGAL/UseEigen3.cmake; ./lib/cmake/CGAL/UseLASLIB.cmake; ./lib/cmake/CGAL/UseOpenMesh.cmake; ./lib/cmake/CGAL/UseTBB.cmake; ./lib/cmake/CGAL/list_of_whitelisted_headers.cmake; ./lib/cmake/CGAL/process_dependencies.cmake; ./lib/cmake/CGAL/run_cmd_redirection_cerr.cmake; ./lib/cmake/CGAL/run_test_with_cin.cmake; ./lib/cmake/conan-official-cgal-variables.cmake

@conan-center-bot

This comment has been minimized.

... to backport part of CGAL CMake logic for CGAL::CGAL
@conan-center-bot

This comment has been minimized.

@github-actions
Copy link
Contributor

github-actions bot commented Jun 9, 2023

Hooks produced the following warnings for commit f12596d
cgal/5.3.2
post_package_info(): WARN: [CMAKE FILE NOT IN BUILD FOLDERS (KB-H019)] The *.cmake files have to be placed in a folder declared as `cpp_info.builddirs`. Currently folders declared: {'/home/conan/w/prod/BuildSingleReference/.conan/data/cgal/5.3.2/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/', '/home/conan/w/prod/BuildSingleReference/.conan/data/cgal/5.3.2/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/lib/cmake/CGAL'}
post_package_info(): WARN: [CMAKE FILE NOT IN BUILD FOLDERS (KB-H019)] Found files: ./lib/cmake/conan-official-cgal-variables.cmake
cgal/5.5.1
post_package_info(): WARN: [CMAKE FILE NOT IN BUILD FOLDERS (KB-H019)] The *.cmake files have to be placed in a folder declared as `cpp_info.builddirs`. Currently folders declared: {'/home/conan/w/prod/BuildSingleReference/.conan/data/cgal/5.5.1/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/', '/home/conan/w/prod/BuildSingleReference/.conan/data/cgal/5.5.1/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/lib/cmake/CGAL'}
post_package_info(): WARN: [CMAKE FILE NOT IN BUILD FOLDERS (KB-H019)] Found files: ./lib/cmake/conan-official-cgal-variables.cmake
cgal/5.5
post_package_info(): WARN: [CMAKE FILE NOT IN BUILD FOLDERS (KB-H019)] The *.cmake files have to be placed in a folder declared as `cpp_info.builddirs`. Currently folders declared: {'/home/conan/w/prod/BuildSingleReference/.conan/data/cgal/5.5/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/', '/home/conan/w/prod/BuildSingleReference/.conan/data/cgal/5.5/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/lib/cmake/CGAL'}
post_package_info(): WARN: [CMAKE FILE NOT IN BUILD FOLDERS (KB-H019)] Found files: ./lib/cmake/conan-official-cgal-variables.cmake
cgal/5.5.2
post_package_info(): WARN: [CMAKE FILE NOT IN BUILD FOLDERS (KB-H019)] The *.cmake files have to be placed in a folder declared as `cpp_info.builddirs`. Currently folders declared: {'/home/conan/w/prod/BuildSingleReference/.conan/data/cgal/5.5.2/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/', '/home/conan/w/prod/BuildSingleReference/.conan/data/cgal/5.5.2/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/lib/cmake/CGAL'}
post_package_info(): WARN: [CMAKE FILE NOT IN BUILD FOLDERS (KB-H019)] Found files: ./lib/cmake/conan-official-cgal-variables.cmake

@lrineau
Copy link
Contributor Author

lrineau commented Jun 9, 2023

The error is on MacOS, with Apple-clang 13 and C++17:

mpfr/4.1.0: WARN: Can't find a 'mpfr/4.1.0' package binary 'c16aea0f6d35a4856182c8d8c4dedcf2dad52637' for the configuration:
[settings]
arch=x86_64
build_type=Release
compiler=apple-clang
compiler.version=13
os=Macos
[options]
exact_int=gmp
fPIC=True
shared=False
[requires]
gmp/6.2.Z

https://c3i.jfrog.io/c3i/misc-v2/logs/pr/17858/13-macos-clang/cgal/5.5//da39a3ee5e6b4b0d3255bfef95601890afd80709-test.txt

Does anybody know what I can do?

Maybe @uilianries, @prince-chrismc? You helped me with my previous PRs #12249 and #13443.

@uilianries
Copy link
Member

@lrineau I started an internal CI job to build mpfr/4.1.0. Thank you for reporting.

@conan-center-bot

This comment has been minimized.

@lrineau
Copy link
Contributor Author

lrineau commented Jun 14, 2023

@uilianries Houra! The last CI set of tests eventually succeeded! Thanks for your help.

recipes/cgal/all/conanfile.py Outdated Show resolved Hide resolved
recipes/cgal/all/conanfile.py Show resolved Hide resolved
os.path.join(self.package_folder, self._cmake_module_file_rel_path)
)

def _create_cmake_module_variables(self, module_file):
Copy link
Member

Choose a reason for hiding this comment

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

Why do you need to create it only now? What error are you trying to fix?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am fixing a lot of issues, at least for CMake consumers. See #10011 for example.

CGAL requires C++14, and specific compilers flags to enable the possibility to set FPU rounding modes. That CMake function, from CGAL pull-request CGAL/cgal#7512, takes care of all the known compilers CGAL has ever supported.

Everything is probably doable adding compilers flags using cpp_info, except for target_compile_features(${target} INTERFACE cxx_decltype_auto) for which Conan has currently no equivalent.

Copy link
Member

Choose a reason for hiding this comment

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

I would be great adding this detailed in description as a comment in the code. Usually, we receive this kind of change as a patch, over the current version, but I see applying it to each past version would require another patch too. Another option is you adding it as a cmake file side-by-side with the conanfile.py, and exporting it.

Copy link
Contributor Author

@lrineau lrineau Jun 14, 2023

Choose a reason for hiding this comment

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

Thanks. Done in 010075b.

generators = "CMakeDeps", "CMakeToolchain"

def requirements(self):
self.requires("eigen/3.4.0")
Copy link
Member

Choose a reason for hiding this comment

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

why do you need to include Eigen too? Is there a public header or something missing?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Some parts of CGAL require Eigen3, but not CGAL core parts.

Copy link
Member

Choose a reason for hiding this comment

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

Is it something new? We didn't have it before and cgal was working. If it's a new dependency, it would require a if Version(self.version) < "5.5.2" for instance.

Copy link
Member

Choose a reason for hiding this comment

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

It should be solved as cgal dependency directly then, and could be added as dependency based on an option.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

CGAL is a header-only library, with dependencies and optional dependencies. That is not new. What is new is that I have upgraded the test_package with a less trivial test.

During the build of the CGAL Conan package, the dependencies will not change anything in the produced package (that is header-only). I do not think Conan package options are a good way to deal with that. There are only three dependencies: boost, gmp, and mpfr. But currently 18 optional dependencies. That is not new.

If a user has a program with several compilation units using CGAL (like the CGAL 3D demo, with all its plugins) but only some of them using optional dependencies, then the use of Conan option would pull the dependencies for all the compilation units, and not only for the one really needing them.

Co-authored-by: Uilian Ries <[email protected]>
@conan-center-bot

This comment has been minimized.

@github-actions
Copy link
Contributor

Hooks produced the following warnings for commit e968c3b
cgal/5.5
post_package_info(): WARN: [CMAKE FILE NOT IN BUILD FOLDERS (KB-H019)] The *.cmake files have to be placed in a folder declared as `cpp_info.builddirs`. Currently folders declared: {'/home/conan/w/prod/BuildSingleReference/.conan/data/cgal/5.5/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/lib/cmake/CGAL', '/home/conan/w/prod/BuildSingleReference/.conan/data/cgal/5.5/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/'}
post_package_info(): WARN: [CMAKE FILE NOT IN BUILD FOLDERS (KB-H019)] Found files: ./lib/cmake/conan-official-cgal-variables.cmake
cgal/5.3.2
post_package_info(): WARN: [CMAKE FILE NOT IN BUILD FOLDERS (KB-H019)] The *.cmake files have to be placed in a folder declared as `cpp_info.builddirs`. Currently folders declared: {'/home/conan/w/prod/BuildSingleReference/.conan/data/cgal/5.3.2/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/', '/home/conan/w/prod/BuildSingleReference/.conan/data/cgal/5.3.2/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/lib/cmake/CGAL'}
post_package_info(): WARN: [CMAKE FILE NOT IN BUILD FOLDERS (KB-H019)] Found files: ./lib/cmake/conan-official-cgal-variables.cmake
cgal/5.5.1
post_package_info(): WARN: [CMAKE FILE NOT IN BUILD FOLDERS (KB-H019)] The *.cmake files have to be placed in a folder declared as `cpp_info.builddirs`. Currently folders declared: {'/home/conan/w/prod/BuildSingleReference/.conan/data/cgal/5.5.1/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/lib/cmake/CGAL', '/home/conan/w/prod/BuildSingleReference/.conan/data/cgal/5.5.1/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/'}
post_package_info(): WARN: [CMAKE FILE NOT IN BUILD FOLDERS (KB-H019)] Found files: ./lib/cmake/conan-official-cgal-variables.cmake
cgal/5.5.2
post_package_info(): WARN: [CMAKE FILE NOT IN BUILD FOLDERS (KB-H019)] The *.cmake files have to be placed in a folder declared as `cpp_info.builddirs`. Currently folders declared: {'/home/conan/w/prod/BuildSingleReference/.conan/data/cgal/5.5.2/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/lib/cmake/CGAL', '/home/conan/w/prod/BuildSingleReference/.conan/data/cgal/5.5.2/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/'}
post_package_info(): WARN: [CMAKE FILE NOT IN BUILD FOLDERS (KB-H019)] Found files: ./lib/cmake/conan-official-cgal-variables.cmake

That will avoid a warning:
```
post_package_info(): WARN: [CMAKE FILE NOT IN BUILD FOLDERS (KB-H019)] The *.cmake files have to be placed in a folder declared as `cpp_info.builddirs`. Currently folders declared: {'/home/conan/w/prod/BuildSingleReference/.conan/data/cgal/5.5/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/lib/cmake/CGAL', '/home/conan/w/prod/BuildSingleReference/.conan/data/cgal/5.5/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/'}
post_package_info(): WARN: [CMAKE FILE NOT IN BUILD FOLDERS (KB-H019)] Found files: ./lib/cmake/conan-official-cgal-variables.cmake
```
Copy link
Member

@uilianries uilianries left a comment

Choose a reason for hiding this comment

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

LGTM

@conan-center-bot
Copy link
Collaborator

Conan v1 pipeline ✔️

All green in build 17 (010075b9fe23c22e9e1752577e457d2441606890):

  • cgal/5.3.2@:
    All packages built successfully! (All logs)

  • cgal/5.5.1@:
    All packages built successfully! (All logs)

  • cgal/5.5@:
    All packages built successfully! (All logs)

  • cgal/5.5.2@:
    All packages built successfully! (All logs)


Conan v2 pipeline ✔️

Note: Conan v2 builds may be required once they are on the v2 ready list

All green in build 17 (010075b9fe23c22e9e1752577e457d2441606890):

  • cgal/5.5.2@:
    All packages built successfully! (All logs)

  • cgal/5.5.1@:
    All packages built successfully! (All logs)

  • cgal/5.3.2@:
    All packages built successfully! (All logs)

  • cgal/5.5@:
    All packages built successfully! (All logs)

@lrineau
Copy link
Contributor Author

lrineau commented Jun 20, 2023

@uilianries, @prince-chrismc: is there anything more I should do with this pull-request? Or just wait?

I am sorry for my questions: I am not completely familiar with the Conan community and its practices.

@conan-center-bot conan-center-bot merged commit e124327 into conan-io:master Jun 20, 2023
@lrineau lrineau deleted the cgal-5.5.2 branch June 20, 2023 18:39
pezy pushed a commit to pezy/conan-center-index that referenced this pull request Jul 15, 2023
* [cgal] compatibility with Conan 2.0, and cgal/5.5.2

* cleanup for the linter

* Fix linter errors for Conan 1.0

* Use patch directly to avoid `strip` in conandata

That is for compatibility with Conan 1.x.

* remove version before 5.3 (header only)

* backport the patch

* remove CGAL CMake Config files

* Fix the licenses/ directory

* fix linter error

* reuse patches with versions, for Conan 1.x

* fix a final linter warning

* handle that CGAL requires C++14

* CGAL is a header-only library

* add back a CMake build module

... to backport part of CGAL CMake logic for CGAL::CGAL

* Update to Boost 1.82

Co-authored-by: Uilian Ries <[email protected]>

* place the Conan specific CMake module in lib/cmake/CGAL

That will avoid a warning:
```
post_package_info(): WARN: [CMAKE FILE NOT IN BUILD FOLDERS (KB-H019)] The *.cmake files have to be placed in a folder declared as `cpp_info.builddirs`. Currently folders declared: {'/home/conan/w/prod/BuildSingleReference/.conan/data/cgal/5.5/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/lib/cmake/CGAL', '/home/conan/w/prod/BuildSingleReference/.conan/data/cgal/5.5/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/'}
post_package_info(): WARN: [CMAKE FILE NOT IN BUILD FOLDERS (KB-H019)] Found files: ./lib/cmake/conan-official-cgal-variables.cmake
```

* Add a comment about CGAL_setup_CGAL_flags

---------

Co-authored-by: Uilian Ries <[email protected]>
@lrineau lrineau mentioned this pull request Aug 9, 2023
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants