Skip to content

[wpilib, eigen3] Update wpilib version & eigen3 updated to latest master commit#44927

Closed
OhmV-IR wants to merge 35 commits intomicrosoft:masterfrom
OhmV-IR:add-latest-wpilib
Closed

[wpilib, eigen3] Update wpilib version & eigen3 updated to latest master commit#44927
OhmV-IR wants to merge 35 commits intomicrosoft:masterfrom
OhmV-IR:add-latest-wpilib

Conversation

@OhmV-IR
Copy link
Copy Markdown
Contributor

@OhmV-IR OhmV-IR commented Apr 9, 2025

  • Changes comply with the maintainer guide.
  • SHA512s are updated for each updated download.
  • The "supports" clause reflects platforms that may be fixed by this new version. (can't find this in any files I edited in this PR, checked ports/wpilib and versions dir, going to assume I don't need to edit it then)
  • Any fixed CI baseline entries are removed from that file. (the baseline is for certain targets to fail to build because it needs cpp20 support, which is still the case afaik)
  • Any patches that are no longer applied are deleted from the port's directory.
  • The version database is fixed by rerunning ./vcpkg x-add-version --all and committing the result.
  • Only one version is added to each modified port's versions file.

Also contemplating changing the package name to allwpilib because this is more accurate now that the wpilib project has been consolidated into the allwpilib repo which includes cameraserver and apriltags when it previously did not, but I understand that this would be breaking and potentially confusing, so waiting for discussion on that. Have gotten it to build and install successfully on my machine, but I am unsure as of how I should be conducting further testing of this PR. FYI, wpilib is a large repo, takes around 30mins to build on 16GB ram with an i7 laptop cpu, 4 or so years old. My first PR so sorry for any mistakes

@OhmV-IR
Copy link
Copy Markdown
Contributor Author

OhmV-IR commented Apr 9, 2025

@OhmV-IR please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.

@microsoft-github-policy-service agree [company="{your company}"]

Options:

  • (default - no company specified) I have sole ownership of intellectual property rights to my Submissions and I am not making Submissions in the course of work for my employer.
@microsoft-github-policy-service agree
  • (when company given) I am making Submissions in the course of work for my employer (or my employer has intellectual property rights in my Submissions by contract or applicable law). I have permission from my employer to make Submissions and enter into this Agreement on behalf of my employer. By signing below, the defined term “You” includes me and my employer.
@microsoft-github-policy-service agree company="Microsoft"

Contributor License Agreement

@microsoft-github-policy-service agree

Comment on lines -9 to -11
"eigen3",
"fmt",
"libuv",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor Author

@OhmV-IR OhmV-IR Apr 9, 2025

Choose a reason for hiding this comment

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

weird, wpilib seems to handle it themselves if you turn off the flag(or never set it, it's off by default) USE_SYSTEM_EIGEN which I have so the dep should no longer be necessary, and I got a clean winx64 install after running git clean -xdf on my vcpkg directory

@Cheney-W Cheney-W self-assigned this Apr 9, 2025
@Cheney-W Cheney-W added the category:port-update The issue is with a library, which is requesting update new revision label Apr 9, 2025
@Cheney-W
Copy link
Copy Markdown
Contributor

Cheney-W commented Apr 9, 2025

Port installation failed with the following errors with windows triplets:

D:\b\wpilib\src\cc158eba3a-098c95194c.clean\wpimath\src\main\native\include\frc/geometry/Rotation2d.h(204): error C3615: constexpr function 'frc::Rotation2d::ToMatrix' cannot result in a constant expression
D:\b\wpilib\src\cc158eba3a-098c95194c.clean\wpimath\src\main\native\include\frc/geometry/Translation2d.h(97): error C3615: constexpr function 'frc::Translation2d::ToVector' cannot result in a constant expression
D:\b\wpilib\src\cc158eba3a-098c95194c.clean\wpimath\src\main\native\include\frc/geometry/Quaternion.h(266): error C3615: constexpr function 'frc::Quaternion::ToRotationVector' cannot result in a constant expression
D:\b\wpilib\src\cc158eba3a-098c95194c.clean\wpimath\src\main\native\include\frc/geometry/Rotation3d.h(392): error C3615: constexpr function 'frc::Rotation3d::Axis' cannot result in a constant expression
D:\b\wpilib\src\cc158eba3a-098c95194c.clean\wpimath\src\main\native\include\frc/geometry/Rotation3d.h(412): error C3615: constexpr function 'frc::Rotation3d::ToMatrix' cannot result in a constant expression
D:\b\wpilib\src\cc158eba3a-098c95194c.clean\wpimath\src\main\native\include\frc/geometry/Rotation3d.h(432): error C3615: constexpr function 'frc::Rotation3d::ToVector' cannot result in a constant expression
D:\b\wpilib\src\cc158eba3a-098c95194c.clean\wpimath\src\main\native\include\frc/geometry/Translation3d.h(121): error C3615: constexpr function 'frc::Translation3d::ToVector' cannot result in a constant expression

Port installation failed with the following errors with linux or osx triplets:

/mnt/vcpkg-ci/b/wpilib/src/cc158eba3a-098c95194c.clean/wpimath/src/main/native/include/frc/geometry/Rotation2d.h:204:29: error: invalid return type ‘Eigen::Matrix2d’ {aka ‘Eigen::Matrix<double, 2, 2>’} of ‘constexpr’ function ‘constexpr Eigen::Matrix2d frc::Rotation2d::ToMatrix() const’
/mnt/vcpkg-ci/b/wpilib/src/cc158eba3a-098c95194c.clean/wpimath/src/main/native/include/frc/geometry/Translation2d.h:63:36: error: call to non-‘constexpr’ function ‘Eigen::DenseCoeffsBase<Derived, 0>::CoeffReturnType Eigen::DenseCoeffsBase<Derived, 0>::x() const [with Derived = Eigen::Matrix<double, 2, 1>; Eigen::DenseCoeffsBase<Derived, 0>::CoeffReturnType = const double&]’
/mnt/vcpkg-ci/b/wpilib/src/cc158eba3a-098c95194c.clean/wpimath/src/main/native/include/frc/geometry/Translation2d.h:97:29: error: invalid return type ‘Eigen::Vector2d’ {aka ‘Eigen::Matrix<double, 2, 1>’} of ‘constexpr’ function ‘constexpr Eigen::Vector2d frc::Translation2d::ToVector() const’
/mnt/vcpkg-ci/b/wpilib/src/cc158eba3a-098c95194c.clean/wpimath/src/main/native/include/frc/geometry/Quaternion.h:266:29: error: invalid return type ‘Eigen::Vector3d’ {aka ‘Eigen::Matrix<double, 3, 1>’} of ‘constexpr’ function ‘constexpr Eigen::Vector3d frc::Quaternion::ToRotationVector() const’
/mnt/vcpkg-ci/b/wpilib/src/cc158eba3a-098c95194c.clean/wpimath/src/main/native/include/frc/geometry/Quaternion.h:302:36: error: call to non-‘constexpr’ function ‘Eigen::DenseCoeffsBase<Derived, 0>::CoeffReturnType Eigen::DenseCoeffsBase<Derived, 0>::operator()(Eigen::Index) const [with Derived = Eigen::Matrix<double, 3, 1>; Eigen::DenseCoeffsBase<Derived, 0>::CoeffReturnType = const double&; Eigen::Index = long int]’
/mnt/vcpkg-ci/b/wpilib/src/cc158eba3a-098c95194c.clean/wpimath/src/main/native/include/frc/geometry/Rotation3d.h:87:21: error: variable ‘v’ of non-literal type ‘Eigen::Vector3d’ {aka ‘Eigen::Matrix<double, 3, 1>’} in ‘constexpr’ function
/mnt/vcpkg-ci/b/wpilib/src/cc158eba3a-098c95194c.clean/wpimath/src/main/native/include/frc/geometry/Rotation3d.h:101:68: error: temporary of non-literal type ‘frc::ct_matrix<double, 3, 1>’ in a constant expression
/mnt/vcpkg-ci/b/wpilib/src/cc158eba3a-098c95194c.clean/wpimath/src/main/native/include/frc/geometry/Rotation3d.h:201:23: error: variable ‘other’ of non-literal type ‘Eigen::Vector3d’ {aka ‘Eigen::Matrix<double, 3, 1>’} in ‘constexpr’ function
/mnt/vcpkg-ci/b/wpilib/src/cc158eba3a-098c95194c.clean/wpimath/src/main/native/include/frc/geometry/Rotation3d.h:220:12: error: variable ‘axis’ of non-literal type ‘frc::ct_matrix<double, 3, 1>’ in ‘constexpr’ function
/mnt/vcpkg-ci/b/wpilib/src/cc158eba3a-098c95194c.clean/wpimath/src/main/native/include/frc/geometry/Rotation3d.h:226:12: error: variable ‘axis’ of non-literal type ‘frc::ct_matrix<double, 3, 1>’ in ‘constexpr’ function
/mnt/vcpkg-ci/b/wpilib/src/cc158eba3a-098c95194c.clean/wpimath/src/main/native/include/frc/geometry/Rotation3d.h:283:5: error: expression ‘<statement>’ is not a constant expression
/mnt/vcpkg-ci/b/wpilib/src/cc158eba3a-098c95194c.clean/wpimath/src/main/native/include/frc/geometry/Rotation3d.h:392:29: error: invalid return type ‘Eigen::Vector3d’ {aka ‘Eigen::Matrix<double, 3, 1>’} of ‘constexpr’ function ‘constexpr Eigen::Vector3d frc::Rotation3d::Axis() const’
/mnt/vcpkg-ci/b/wpilib/src/cc158eba3a-098c95194c.clean/wpimath/src/main/native/include/frc/geometry/Rotation3d.h:412:29: error: invalid return type ‘Eigen::Matrix3d’ {aka ‘Eigen::Matrix<double, 3, 3>’} of ‘constexpr’ function ‘constexpr Eigen::Matrix3d frc::Rotation3d::ToMatrix() const’
/mnt/vcpkg-ci/b/wpilib/src/cc158eba3a-098c95194c.clean/wpimath/src/main/native/include/frc/geometry/Rotation3d.h:432:29: error: invalid return type ‘Eigen::Vector3d’ {aka ‘Eigen::Matrix<double, 3, 1>’} of ‘constexpr’ function ‘constexpr Eigen::Vector3d frc::Rotation3d::ToVector() const’
/mnt/vcpkg-ci/b/wpilib/src/cc158eba3a-098c95194c.clean/wpimath/src/main/native/include/frc/geometry/Translation3d.h:65:36: error: call to non-‘constexpr’ function ‘Eigen::DenseCoeffsBase<Derived, 0>::CoeffReturnType Eigen::DenseCoeffsBase<Derived, 0>::x() const [with Derived = Eigen::Matrix<double, 3, 1>; Eigen::DenseCoeffsBase<Derived, 0>::CoeffReturnType = const double&]’
/mnt/vcpkg-ci/b/wpilib/src/cc158eba3a-098c95194c.clean/wpimath/src/main/native/include/frc/geometry/Translation3d.h:121:29: error: invalid return type ‘Eigen::Vector3d’ {aka ‘Eigen::Matrix<double, 3, 1>’} of ‘constexpr’ function ‘constexpr Eigen::Vector3d frc::Translation3d::ToVector() const’

More logs please see https://dev.azure.com/vcpkg/public/_build/results?buildId=114427&view=artifacts&pathAsName=false&type=publishedArtifacts

Copy link
Copy Markdown
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.

This port doesn't have a problem with build time: It has a problem with vendored dependencies.

)
vcpkg_cmake_install()
vcpkg_cmake_config_fixup(PACKAGE_NAME wpilib)
vcpkg_cmake_config_fixup(PACKAGE_NAME apriltag)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Clash!

Copy link
Copy Markdown
Contributor Author

@OhmV-IR OhmV-IR Apr 9, 2025

Choose a reason for hiding this comment

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

alright I understand the vendored dependencies thing, we want to use the libs from vcpkg whenever possible, but I need a bit more explanation on what "Clash!" means here / what the problem literally is, as this is my first time

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

here's a photo of a built allwpilib install on my ubuntu vm without using vcpkg:
image

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The vcpkg_cmake_config_fixup(PACKAGE_NAME apriltag) line will put CMake config for the apriltag CMake package name into share/apriltag. But this name is already owned by port apriltag:

apriltag:x64-windows:/share/apriltag/apriltagConfig.cmake
apriltag:x64-windows:/share/apriltag/apriltagConfigVersion.cmake
apriltag:x64-windows:/share/apriltag/apriltagTargets-debug.cmake
apriltag:x64-windows:/share/apriltag/apriltagTargets-release.cmake
apriltag:x64-windows:/share/apriltag/apriltagTargets.cmake

This isn't allowed because both port will eventually be installed simultaneously (at least in vcpkg CI).

This is just what I see on GH. I didn't check the file lists in detail. But they are available from CI (for this PR and in another pipeline for the full CI of all ports).

Copy link
Copy Markdown
Contributor Author

@OhmV-IR OhmV-IR Apr 10, 2025

Choose a reason for hiding this comment

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

well shoot. the apriltag library is a must-have though, so would using a feature to enable / disable it be okay? I don't want to change the name because existing build systems likely rely on the apriltag package name for wpilib

Comment on lines -43 to -45
-DUSE_SYSTEM_FMTLIB=ON
-DUSE_SYSTEM_LIBUV=ON
-DUSE_SYSTEM_EIGEN=ON
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No?

@OhmV-IR
Copy link
Copy Markdown
Contributor Author

OhmV-IR commented Apr 10, 2025

what cxx compiler version is eigen3 built with, I can't find this anywhere? I believe it requires at least cpp14 for the constexpr constructors for the Matrix type, which wpilib relies on so if vcpkg uses an older version(eg cpp14), this port will be forced to use the vendored dep from wpilib

@dg0yt
Copy link
Copy Markdown
Contributor

dg0yt commented Apr 10, 2025

what cxx compiler version is eigen3 built with, I can't find this anywhere? I believe it requires at least cpp14 for the constexpr constructors for the Matrix type, which wpilib relies on so if vcpkg uses an older version(eg cpp14), this port will be forced to use the vendored dep from wpilib

Everything in the triplet is build with the same compiler.
And eigen3 is header-only, so the consuming port controls the compilation.
However, eigen3 hasn't had a release in a while, and this is a problem. Cf. https://gitlab.com/libeigen/eigen/-/issues/2907

@OhmV-IR
Copy link
Copy Markdown
Contributor Author

OhmV-IR commented Apr 15, 2025

Okay got it building by updating eigen3 to the latest master commit, but the dep clash with apriltag is still a problem that I really have no idea on how to solve.

@OhmV-IR OhmV-IR changed the title [wpilib] Update wpilib version [wpilib, eigen3] Update wpilib version & eigen3 updated to latest master commit Apr 15, 2025
@OhmV-IR OhmV-IR force-pushed the add-latest-wpilib branch from 44cb3d7 to 22cd46b Compare April 22, 2025 00:35
@OhmV-IR
Copy link
Copy Markdown
Contributor Author

OhmV-IR commented Apr 22, 2025

Ports that need to be fixed in CI for eigen update:

  • colmap
  • dartsim
  • fcl
  • gtsam
  • nanogui
  • ompl
  • opencv3
  • openmvg
  • pcl
  • rbdl
  • rtabmap
  • scenepic
  • coolprop
  • orocos-kdl
  • robotraconteur-companion

@OhmV-IR OhmV-IR force-pushed the add-latest-wpilib branch from 8666c07 to f8d67aa Compare April 23, 2025 19:00
@OhmV-IR
Copy link
Copy Markdown
Contributor Author

OhmV-IR commented May 5, 2025

abandoning because the fmt update pr is more complete and accomplishes the goals of this pr, will merge anything that might be useful from here into a pr on their branch

@OhmV-IR OhmV-IR closed this May 5, 2025
@OhmV-IR OhmV-IR deleted the add-latest-wpilib branch December 16, 2025 21:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category:port-update The issue is with a library, which is requesting update new revision

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants