Opened 14 months ago

Last modified 14 months ago

#68189 closed defect

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*' — at Version 5

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.

Change History (6)

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)
Note: See TracTickets for help on using tickets.