Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

opencv: 3.1.0 -> 3.2.0 (with caveats) #21552

Closed
wants to merge 1 commit into from

Conversation

risicle
Copy link
Contributor

@risicle risicle commented Dec 31, 2016

The caveat here is that certain parts of the contrib module need to be disabled as they have become badly behaved in 3.2.0 and attempt to perform downloads of additional components during the build phase.

This does make me wonder whether we should continue to provide 3.1.0 packages for those needing to use the dnn or xfeatures2d modules.

Thoughts anybody?

Things done
  • Tested using sandboxing
    (nix.useSandbox on NixOS,
    or option build-use-sandbox in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@mention-bot
Copy link

@risicle, thanks for your PR! By analyzing the history of the files in this pull request, we identified @mdaiter, @abbradar and @cpages to be potential reviewers.

] ++ lib.optionals enableContrib [
"-DOPENCV_EXTRA_MODULES_PATH=${contribSrc}/modules"
# the following modules are badly behaved and attempt to download 3rd party libs as part of the build process:
"-DBUILD_opencv_dnn=OFF" # attempts to download protobuf src and googlenet caffe model
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we change the Makefile script using sed to remove the command to download neural nets?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

prrrrobably, I'm not 100% sure what the ramifications would be.

Digging deeper, it seems like the dnn module does at least have some provision for not building protobuf itself (see https://github.com/opencv/opencv_contrib/blob/3.2.0/modules/dnn/cmake/OpenCVFindLibProtobuf.cmake)

Copy link
Member

Choose a reason for hiding this comment

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

I think upstream would accept patches, which uses a flag to point to the source instead of downloading something.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I find cmake "syntax" fairly impossible to comprehend at the best of times and there is some odd stuff in here...

Interestingly, building with -DBUILD_PROTOBUF=OFF seems to have the effect of disabling both the protobuf download and the googlenet model download. Which is odd. It appears the googlenet model is only used in the tests, which we seem to build but not run. This is probably because the tests require quite a large download of external data. This suggests the option of disabling the test building - it would be nice to run them, but we don't, and building them just feels like a waste of time & space.

I'm going to crawl back into bed with some paracetamol anyone who feels like having a go ad untangling this mess is most welcome.

@risicle
Copy link
Contributor Author

risicle commented Jan 2, 2017

Ok I've managed to bring back dnn through -DBUILD_PROTOBUF=OFF, xfeatures2d looks like it will be trickier to fix so it's still disabled, which is a pity because I imagine it has 100x more users than dnn.

the caveat here is that xfeatures2d from the contrib module needs to
be disabled as it has become badly behaved in 3.2.0 and attempts to
perform downloads of additional components during the build phase
@basvandijk
Copy link
Member

@risicle I didn't know about your PR so I made one myself in #22084. My PR makes sure that the files that would be downloaded during the build are fetched to the nix store.

@cpages
Copy link
Contributor

cpages commented Jan 25, 2017

#22084 got merged, so I'm closing this. @risicle thanks anyway.

@cpages cpages closed this Jan 25, 2017
@risicle
Copy link
Contributor Author

risicle commented Jan 25, 2017

👍 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants