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

[osqp-eigen, osqp] Add new port #41676

Draft
wants to merge 21 commits into
base: master
Choose a base branch
from
Draft

Conversation

aboelens
Copy link

@aboelens aboelens commented Oct 20, 2024

  • Changes comply with the maintainer guide.
  • The name of the port matches an existing name for this component on https://repology.org/ if possible, and/or is strongly associated with that component on search engines.
  • Optional dependencies are resolved in exactly one way. For example, if the component is built with CMake, all find_package calls are REQUIRED, are satisfied by vcpkg.json's declared dependencies, or disabled with CMAKE_DISABLE_FIND_PACKAGE_Xxx.
  • The versioning scheme in vcpkg.json matches what upstream says.
  • The license declaration in vcpkg.json matches what upstream says.
  • The installed as the "copyright" file matches what upstream says.
  • The source code of the component installed comes from an authoritative source.
  • The generated "usage text" is accurate. See adding-usage for context.
  • The version database is fixed by rerunning ./vcpkg x-add-version --all and committing the result.
  • Only one version is in the new port's versions file.
  • Only one version is added to each modified port's versions file.

@JonLiu1993 JonLiu1993 changed the title Add osqp [osqp-eigen, osqp] Add new port Oct 21, 2024
@JonLiu1993 JonLiu1993 added the category:new-port The issue is requesting a new library to be added; consider making a PR! label Oct 21, 2024
@aboelens
Copy link
Author

aboelens commented Oct 21, 2024 via email

Copy link
Contributor

@dg0yt dg0yt left a comment

Choose a reason for hiding this comment

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

Consider adding license to the manifest.

Please trim the patches. Keep them minimal.

  • Use CMake options to skip blocks or disable depedencies/features.
  • Skip whole blocks with if(0).
  • Remove lines instead of commenting them.

ports/osqp-eigen/portfile.cmake Outdated Show resolved Hide resolved
ports/osqp-eigen/portfile.cmake Outdated Show resolved Hide resolved
@JonLiu1993 JonLiu1993 marked this pull request as draft November 11, 2024 07:39
Copy link
Contributor

@dg0yt dg0yt left a comment

Choose a reason for hiding this comment

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

Early feedback.

ports/osqp/portfile.cmake Outdated Show resolved Hide resolved
ports/osqp-eigen/portfile.cmake Outdated Show resolved Hide resolved
ports/osqp-eigen/portfile.cmake Outdated Show resolved Hide resolved
ports/osqp-eigen/portfile.cmake Outdated Show resolved Hide resolved
ports/osqp-eigen/vcpkg.json Outdated Show resolved Hide resolved
ports/osqp-eigen/vcpkg.json Outdated Show resolved Hide resolved
ports/osqp-eigen/vcpkg.json Show resolved Hide resolved
ports/osqp/osqp.patch Outdated Show resolved Hide resolved
Comment on lines +14 to +19
vcpkg_download_distfile(
QDLDL
URLS "https://github.com/osqp/qdldl/archive/refs/tags/v0.1.5.tar.gz"
FILENAME "qdldl-0.1.5.tar.gz"
SHA512 3a224767708484d6728e4b0801210c5e7d4e906564c0855c7987876316cde7349c2717a169b4a6680495b0c71415be383e3e5c6826873fb92d7e93258a7a03a8
)
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe a candidate for a separate port?

Copy link
Author

Choose a reason for hiding this comment

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

It is currently loaded as a git sub module, which is why I took this approach.

Copy link
Contributor

Choose a reason for hiding this comment

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

Fyi I opened an issue on this upstream some time ago: osqp/osqp#85 . If I recall correctly the critical point is that osqp package also has some code-generation functionalities, and so at least for those they need access to qdldl source code, but I guess there is nothing preventing using an external qdldl for all other uses.

Copy link
Contributor

Choose a reason for hiding this comment

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

And apparently I forgot that eventually we devendored qdldl in conda-forge, see https://github.com/conda-forge/libosqp-feedstock/blob/main/recipe/patches/0002-build-qdldl-interface-as-part-of-osqp.patch and conda-forge/libosqp-feedstock#8 .

fyi @h-vetinari as he is the author of the patch, so I guess he need to be onboard for the patch to be used here unless the copyright info of the conda-forge feedstock needs to be added here somehow.

Choose a reason for hiding this comment

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

The feedstock is under bsd-3 license so the patch can be used freely. If properly attributed, even better.

Copy link
Author

Choose a reason for hiding this comment

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

I finally got around to looking at the patch. It seems that the patch is not for compiling osqp against a separate installation of qdldl. Instead it pulls in the relevant code of qdldl and compiles it as part of osqp.

Copy link
Contributor

@traversaro traversaro Dec 2, 2024

Choose a reason for hiding this comment

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

I finally got around to looking at the patch. It seems that the patch is not for compiling osqp against a separate installation of qdldl. Instead it pulls in the relevant code of qdldl and compiles it as part of osqp.

Where did you get that impression? The patch explicitly removed the add_subdirectory of the submodule, and substitute it with a find_package(qdldl), see https://github.com/conda-forge/libosqp-feedstock/blob/a60a9fc6866820657fe71a112f35d99fe19a5978/recipe/patches/0002-build-qdldl-interface-as-part-of-osqp.patch#L64 . Are you sure you are not confusing qdldl itself with the qdldl_interface.h/qdldl_interface.c files that are instead the osqp files used to interface with qdldl ?

Copy link
Author

Choose a reason for hiding this comment

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

Maybe I misread? "Since we were not building the MKL pardiso bindings correctly anyway we can just ignore the whole ./lin_sys folder, or rather: just take out what we need and put it in the sources directly, rather than muck around with trying to build a separate library."

Copy link
Contributor

@traversaro traversaro Dec 2, 2024

Choose a reason for hiding this comment

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

Ah, I see why it is misleading. The folder contains both qdldl_interface.h and qdldl_interface.c, and the qdldl submodules, see https://github.com/osqp/osqp/tree/v0.6.3/lin_sys/direct/qdldl . If you check what the patch is actually doing, it takes the non-qdldl files and move them to the osqp library, while using the qdldl external library.

Copy link
Author

Choose a reason for hiding this comment

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

OK. Thanks for the explanation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:new-port The issue is requesting a new library to be added; consider making a PR!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants