Opened 5 years ago

Closed 4 years ago

#60118 closed defect (fixed)

opencv and opencv4 conflict

Reported by: dynect (0x1) Owned by: Christopher Nielsen <mascguy@…>
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: stromnov (Andrey Stromnov), mascguy (Christopher Nielsen), Schamschula (Marius Schamschula)
Port: opencv opencv4

Description

I have OpenCV installed through MacPorts, and when I go to install OpenCV4 I get:

--->  Computing dependencies for opencv4
Error: Can't install opencv4 because conflicting ports are active: opencv
Error: Follow https://guide.macports.org/#project.tickets to report a bug.
Error: Processing of port opencv4 failed

So I'm guessing only one version of OpenCV can be installed?

Change History (14)

comment:1 Changed 5 years ago by jmroot (Joshua Root)

Cc: stromnov added
Port: opencv opencv4 added

Yes, they have been marked as conflicting ports. I would guess that since they are different versions of the same software, they try to install many of the same files.

comment:2 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

Summary: OpenCV conflictopencv and opencv4 conflict

But just to be clear, that is a bug. If we want to provide multiple ports for different versions of a software package, we should do so in such a way that they do not conflict.

(The exception is -devel ports.)

comment:3 Changed 4 years ago by mascguy (Christopher Nielsen)

Cc: mascguy added

comment:4 Changed 4 years ago by mascguy (Christopher Nielsen)

Presently, only two ports are dependent on opencv4: Gerbil and py-pytorch. So if this is going to be fixed, now would be a great time... before more dependent ports are added.

I'll volunteer to update py-pytorch, since there's no maintainer. I'd also be willing to update Gerbil, with Clemens' blessing.

Last edited 4 years ago by mascguy (Christopher Nielsen) (previous) (diff)

comment:5 Changed 4 years ago by mascguy (Christopher Nielsen)

Looking at what the two opencv ports install, there are very few conflicts. So it looks like the opencv4 changes necessary, will be fairly minimal. Ditto for the changes to the two dependents.

opencv installs:

/opt/local/bin/opencv_annotation
/opt/local/bin/opencv_createsamples
/opt/local/bin/opencv_interactive-calibration
/opt/local/bin/opencv_traincascade
/opt/local/bin/opencv_version
/opt/local/bin/opencv_visualisation
/opt/local/bin/opencv_waldboost_detector
/opt/local/bin/setup_vars_opencv3.sh

/opt/local/lib/libopencv_*.dylib

/opt/local/include/opencv/*
/opt/local/include/opencv2/*
/opt/local/lib/pkgconfig/opencv.pc
/opt/local/share/OpenCV/*
/opt/local/share/licenses/opencv3/*

While opencv4 installs:

/opt/local/bin/setup_vars_opencv4.sh
/opt/local/bin/opencv_interactive-calibration
/opt/local/bin/opencv_annotation
/opt/local/bin/opencv_version
/opt/local/bin/opencv_visualisation

/opt/local/lib/libopencv_*.a

/opt/local/include/opencv4/*
/opt/local/lib/opencv4     [presently empty, apart from '3rdparty' subdirectory]
/opt/local/lib/opencv4/3rdparty/*
/opt/local/lib/cmake/opencv4/*
/opt/local/share/opencv4/*
/opt/local/share/licenses/opencv4/*

Assuming I didn't miss anything (?), only two things need changes:

  • Libraries (move down one level, into /opt/local/lib/opencv4/)
  • Binaries (rename to opencv4_*?)
Version 0, edited 4 years ago by mascguy (Christopher Nielsen) (next)

comment:6 Changed 4 years ago by mascguy (Christopher Nielsen)

Currently building opencv4 with all variants enabled, to identify other potential conflicts.

Last edited 4 years ago by mascguy (Christopher Nielsen) (previous) (diff)

comment:7 Changed 4 years ago by mascguy (Christopher Nielsen)

Even with all variants enabled, there don't appear to be any other conflicts beyond what's mentioned above. So that's good news.

comment:8 Changed 4 years ago by mascguy (Christopher Nielsen)

Andrew, since I have a need for opencv4, I'm willing to take on this work. Let me know if that's okay with you.

comment:9 Changed 4 years ago by mascguy (Christopher Nielsen)

Most of this work has been completed, taken care of with additional options passed to configure. The last remaining remnant originates with variant opencv_contrib, and may require a one-line workaround in the portfile.

I'll try to wrap this up over the next day or two, and submit a pull request for review/comment.

comment:10 Changed 4 years ago by Schamschula (Marius Schamschula)

Cc: Schamschula added

comment:11 Changed 4 years ago by Schamschula (Marius Schamschula)

FYI: gmic builds against opencv4.

comment:12 in reply to:  11 Changed 4 years ago by mascguy (Christopher Nielsen)

Replying to Schamschula:

FYI: gmic builds against opencv4.

Marius, it looks like gmic depends on opencv, rather than opencv4.

comment:13 Changed 4 years ago by mascguy (Christopher Nielsen)

Last edited 4 years ago by mascguy (Christopher Nielsen) (previous) (diff)

comment:14 Changed 4 years ago by Christopher Nielsen <mascguy@…>

Owner: set to Christopher Nielsen <mascguy@…>
Resolution: fixed
Status: newclosed

In ca9ffa681f453399942385f9ef34cf1c124b6ea4/macports-ports (master):

opencv/opencv4: eliminate conflicts, improve consistency, add variants; update gerbil and py-pytorch for opencv4 changes

opencv: eliminate conflict with opencv4; add variants debug, nonfree, tests
opencv4: eliminate conflict with opencv; switch to shared libs; rename variant opencv_contrib to contrib, to match opencv; add variants debug, java, python35..39, qt4, qt5, tbb, tests, vtk
gerbil: update for opencv4 library move
py-pytorch: update for opencv4 library move

Fixes: #61912
Fixes: #61801
Fixes: #60118
Fixes: #58845
Fixes: #57640
Fixes: #51734
Fixes: #48218
Fixes: #32528

Note: See TracTickets for help on using tickets.