#68189 closed defect (fixed)

opencv4 @4.6.0 +contrib+eigen+java+nonfree+opencl+openmp+qt5+tbb+vtk: build failure related to ceres-solver: cannot initialize a parameter of type 'LocalParameterization*' with an lvalue of type 'ceres::SubsetManifold*'

Reported by: Gandoon (Erik Hedlund) Owned by: mascguy (Christopher Nielsen)
Priority: Normal Milestone:
Component: ports Version: 2.8.1
Keywords: Cc:
Port: opencv4

Description (last modified by mascguy (Christopher Nielsen))

The build fails on MacOS 10.15 early during the build, soon after it spits out this error:

.../opencv4/work/opencv4-4.6.0/opencv_contrib/modules/sfm/src/libmv_light/libmv/simple_pipeline/bundle.cc:552:17:
warning: 'SetParameterization' is deprecated: LocalParameterizations are deprecated. Use SetManifold instead. [-Wdeprecated-declarations]
        problem.SetParameterization(current_camera_R_t,
                ^

.../opencv4/work/opencv4-4.6.0/opencv_contrib/modules/sfm/src/libmv_light/libmv/simple_pipeline/bundle.cc:553:37:
error: cannot initialize a parameter of type 'LocalParameterization *' with an lvalue of type 'ceres::SubsetManifold *'
                                    constant_translation_manifold);
                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

/opt/local/include/ceres/problem.h:396:51: note: passing argument to parameter 'local_parameterization' here
                           LocalParameterization* local_parameterization);
                                                  ^

1 warning and 1 error generated.

I am uncertain if this is an error relating to MacPorts or if it is an upstream issue. I have tried to force a rebuild of ceres-solver @2.1.0_0 just in case it would help, but no success.

Attachments (1)

opencv4-main-20230918b4.log (1.5 MB) - added by Gandoon (Erik Hedlund) 14 months ago.
Most recent failing upgrade build

Download all attachments as: .zip

Change History (11)

Changed 14 months ago by Gandoon (Erik Hedlund)

Attachment: opencv4-main-20230918b4.log added

Most recent failing upgrade build

comment:1 Changed 14 months ago by mascguy (Christopher Nielsen)

Owner: set to mascguy
Status: newassigned

That particular combination of variants - apart from openmp - is what I have installed everywhere. (Including 10.15.)

I'll take a look.

comment:2 Changed 14 months ago by mascguy (Christopher Nielsen)

Summary: opencv4 @4.6.0_12 +contrib +eigen +java +nonfree +opencl +openmp +qt5 +tbb +vtk fails to build on MacOS 10.15opencv4 @4.6.0 +contrib+eigen+java+nonfree+opencl+openmp+qt5+tbb+vtk: build failure related to ceres-solver: cannot initialize a parameter of type 'LocalParameterization*' with an lvalue of type 'ceres::SubsetManifold*'

comment:3 Changed 14 months ago by mascguy (Christopher Nielsen)

Based on the log, you have Xcode/CLT 12.4 installed. And that release ships with the macOS 11 SDK, rather than 10.15, which can definitely cause issues.

The latest Xcode/CLT release with the 10.15 SDK, is 12.1. So I'd strongly recommend that you downgrade both the CLT and Xcode to that version, before going any further.

comment:4 in reply to:  3 ; Changed 14 months ago by Gandoon (Erik Hedlund)

Replying to mascguy:

Based on the log, you have Xcode/CLT 12.4 installed. And that release ships with the macOS 11 SDK, rather than 10.15, which can definitely cause issues.

The latest Xcode/CLT release with the 10.15 SDK, is 12.1. So I'd strongly recommend that you downgrade both the CLT and Xcode to that version, before going any further.

I have been using that combination of Xcode/CLT for many years now, it has never been an issue so far. Can you point to what would be the actual issues with using the newer Xcode/CLT? The point of having the setup I have is to be able to build for both MacOS 10.15 and 11.n (as far as I know, that is the reason why it was released for 10.15 back when it was the latest and greatest). I do have my doubts that this should be the problem as as recently as July this year I built opencv4 with this exact setup:

$ port -v installed opencv4
The following ports are currently installed:
  opencv4 @4.6.0_11+contrib+eigen+java+nonfree+opencl+openmp+qt5+tbb+vtk (active) requested_variants='+contrib+eigen+java+nonfree+opencl+openmp+qt5+tbb+vtk' platform='darwin 19' archs='x86_64' date='2023-07-26T14:15:21+0200'

I would prefer to not downgrade anything as there is an obvious risk that, despite the original intended Xcode/CLT for 10.15 was 12.1, such an action could break more than it fixes. The 10.15 SDKs are available and linked to.

By repeating port -v upgrade opencv4 I manage to arrive at roughly 98% built and the Ceres error being one of the last hurdles to cross.

comment:5 Changed 14 months ago by mascguy (Christopher Nielsen)

Description: modified (diff)

comment:6 in reply to:  4 ; Changed 14 months ago by mascguy (Christopher Nielsen)

Replying to Gandoon:

I have been using that combination of Xcode/CLT for many years now, it has never been an issue so far.

No worries. And agreed, use of Xcode/CLT 12.4 isn't the cause.

Rather, it's an upstream issue, caused by the recent upgrade of ceres-solver to v2.1.0:

Issue 3270 - Make command fails with a conversion error from ceres

With this patch:

PR 3243 - Use ceres::Manifolds instead of ceres::LocalParameterization

However, we're getting ready to update opencv4 to 4.8.0 anyway, and that fix is included. So it'll be taken care of soon, once testing is complete across all macOS releases. (Possibly later today, if all goes well.)

comment:7 in reply to:  6 ; Changed 14 months ago by Gandoon (Erik Hedlund)

Replying to mascguy:

. . .

No worries. And agreed, use of Xcode/CLT 12.4 isn't the cause.

Rather, it's an upstream issue, caused by the recent upgrade of ceres-solver to v2.1.0:

Issue 3270 - Make command fails with a conversion error from ceres

With this patch:

PR 3243 - Use ceres::Manifolds instead of ceres::LocalParameterization

However, we're getting ready to update opencv4 to 4.8.0 anyway, and that fix is included. So it'll be taken care of soon, once testing is complete across all macOS releases. (Possibly later today, if all goes well.)

That is good to know. I will then await the version 4.8.0 for now. If that works this issue will very soon become irrelevant.

comment:8 in reply to:  7 Changed 14 months ago by mascguy (Christopher Nielsen)

Replying to Gandoon:

That is good to know. I will then await the version 4.8.0 for now. If that works this issue will very soon become irrelevant.

The 4.8.0 update was completed this morning. Let me know when you've had a chance to resync your ports tree, and update this port.

comment:9 Changed 14 months ago by Gandoon (Erik Hedlund)

And that goes for this ticket as well, it builds just fine. So just like for #67634, I think this one can be closed now unless someone else has problems still.

comment:10 in reply to:  9 Changed 14 months ago by mascguy (Christopher Nielsen)

Resolution: fixed
Status: assignedclosed

Replying to Gandoon:

And that goes for this ticket as well, it builds just fine. So just like for #67634, I think this one can be closed now unless someone else has problems still.

Great, glad all of the issues are resolved!

Note: See TracTickets for help on using tickets.