[MacPorts] #67634: opencv4 @4.6.0_10 +contrib+eigen+java+nonfree+opencl+openmp+qt5+tbb+vtk fails to build

MacPorts noreply at macports.org
Thu Jun 15 15:32:41 UTC 2023


#67634: opencv4 @4.6.0_10 +contrib+eigen+java+nonfree+opencl+openmp+qt5+tbb+vtk
fails to build
---------------------+--------------------
 Reporter:  Gandoon  |      Owner:  (none)
     Type:  defect   |     Status:  new
 Priority:  Normal   |  Milestone:
Component:  ports    |    Version:  2.8.1
 Keywords:           |       Port:
---------------------+--------------------
 I have had an issue building opencv4 @4.6.0_10 (upgrading from @4.6.0_3).
 The options I have used for a while are as follows
 `+contrib+eigen+java+nonfree+opencl+openmp+qt5+tbb+vtk` which worked fine
 until the previously mentioned version (rev 3). Now it failed to build. A
 workaround if you have the same problem that may or may not work for you
 is presented later.

 A few changes seems to have broken the old opencv4 @4.6.0_3. A `port rev-
 upgrade` shows that two files has disappeared:

 {{{
 # port -v rev-upgrade
 --->  Scanning binaries for linking errors
 Could not open /opt/local/lib/libtbb.dylib: Error opening or reading file
 (referenced from /opt/local/lib/opencv4/libopencv_core.4.6.0.dylib)
 Could not open /opt/local/lib/libprotobuf.30.dylib: Error opening or
 reading file (referenced from
 /opt/local/lib/opencv4/libopencv_dnn.4.6.0.dylib)
 --->  Found 4 broken files, matching files to ports
 --->  Found 1 broken port, determining rebuild order
 You can always run 'port rev-upgrade' again to fix errors.
 The following ports will be rebuilt: opencv4
 @4.6.0+contrib+eigen+java+nonfree+opencl+openmp+qt5+tbb+vtk
 Continue? [Y/n]:
 }}}

 The first of which seems to be related to an earlier upgrade of tbb and
 the move to onetbb which seems to have moved `/opt/local/lib/libtbb.dylib`
 to `/opt/local/libexec/tbb/lib/libtbb.dylib` and
 `/opt/local/libexec/onetbb/lib/libtbb.dylib` respectively. This allows the
 issue to be reasonably easily manually fixed (but it is not really a
 permanent fix) by soft-linking to the new location. I personally tried
 with linking the new onetbb version (`# ln -s -v
 /opt/local/libexec/onetbb/lib/libtbb.dylib /opt/local/lib/libtbb.dylib`)
 and that solved the first error (the new onetbb seems to work fine despite
 the dependency being on the old tbb). This will of course need to be
 tested if it works in reality as well, but for now it solved the port
 issue.

 The second error seems to be related to opencv4 referencing the versioned
 `libprotobuf.30.dylib`. That one is now at `libprotobuf.32.dylib`
 so obviously the one it tries to find is no longer there.

 However, with the jerry-rigging method mentioned above for the tbb
 reference there, opencv4 finally built and subsequently the second issue
 was also cleared.

 So, something somewhere needs to be fixed for this to work smoothly.

-- 
Ticket URL: <https://trac.macports.org/ticket/67634>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list