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

mathematica: use opencv4 #101227

Merged
merged 1 commit into from Dec 29, 2020

Conversation

herberteuler
Copy link
Member

@herberteuler herberteuler commented Oct 21, 2020

Motivation for this change

The default opencv2 is marked broken at 5e68d20, and it is suggested there that the current release is 4.x.

Things done

Updated the dependency on opencv from release 2 to release 4. The build is broken if using opencv2. Some tests were done to ensure the build works.

  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

The default opencv2 is marked broken at 5e68d20, and it is suggested
there that the current release is 4.x.
Copy link
Member

@lovesegfault lovesegfault left a comment

Choose a reason for hiding this comment

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

Should be fine. I don't think anyone without Mathematica will actually be able to test this, unfortunately.

@Wulfsta
Copy link
Member

Wulfsta commented Oct 23, 2020

@lovesegfault I have Mathematica if you need me to test?

@herberteuler
Copy link
Member Author

@lovesegfault I have Mathematica if you need me to test?

Please test if you have use cases involving OpenCV.

@Wulfsta
Copy link
Member

Wulfsta commented Oct 23, 2020

@lovesegfault I have Mathematica if you need me to test?

Please test if you have use cases involving OpenCV.

I was going to just go to whatever reference pages Wolfram has for OpenCV and run whatever examples are there. I suspect that will be fine?

@herberteuler
Copy link
Member Author

herberteuler commented Oct 23, 2020

I was going to just go to whatever reference pages Wolfram has for OpenCV and run whatever examples are there. I suspect that will be fine?

There is an example from Wolfram, and it uses the C language, but the C interface is only available in OpenCV 2. OpenCV 4 provides only C++ interfaces. In this example, OpenCV is used as an external library, so it should be possible to rewrite it in C++ instead, and it should work as long as the opencv4 package works, but I do not have time to test that.

Also, there is a bundled OpenCV library in directory libexec/Mathematica/SystemFiles/Links/OpenCVLink/LibraryResources/Linux-x86-64 of the installation directory, but it has no public definitions. Any use of this library also suits the testing purpose.

@Wulfsta
Copy link
Member

Wulfsta commented Oct 26, 2020

I was going to just go to whatever reference pages Wolfram has for OpenCV and run whatever examples are there. I suspect that will be fine?

There is an example from Wolfram, and it uses the C language, but the C interface is only available in OpenCV 2. OpenCV 4 provides only C++ interfaces. In this example, OpenCV is used as an external library, so it should be possible to rewrite it in C++ instead, and it should work as long as the opencv4 package works, but I do not have time to test that.

Also, there is a bundled OpenCV library in directory libexec/Mathematica/SystemFiles/Links/OpenCVLink/LibraryResources/Linux-x86-64 of the installation directory, but it has no public definitions. Any use of this library also suits the testing purpose.

Sorry, I have not had time to look into this yet. I will try to get to it in the next few days.

@Wulfsta
Copy link
Member

Wulfsta commented Oct 29, 2020

Looks like I actually won't be able to provide any help with this due to a lack of time, sorry!

@herberteuler do you have an explanation about why opencv needs to be included in the buildInputs at all? It seems that the documentation that we cited claims that they are external libraries. I haven't tried removing it and building though, so it very well might not work if removed.

@herberteuler
Copy link
Member Author

I do not know either, it was already there when I started to maintain this package. It is used as an external library in the example, but also bundled with the package.

@prusnak prusnak merged commit 1017eb0 into NixOS:master Dec 29, 2020
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

4 participants