Skip to content

Conversation

@ordicker
Copy link

This pull request contains a new build recipe I built using the BinaryBuilder.jl wizard:

  • Package name: OpenCV
  • Version: v4.4.0

@staticfloat please review and merge.

@ordicker
Copy link
Author

I'm not sure why the build failed on the windows machine. It looks like the dlls were made.
About the ARM, it had some error with NEON, not sure how to fix it.

@ViralBShah
Copy link
Member

I suggest submitting a build for all platforms here so we can then see what the issues are on the failing platforms.

@ordicker
Copy link
Author

Will do, is there a way to update this pull request using the wizard? If not, just close this one and I will open a new one.

@giordano
Copy link
Member

No, simply edit the file in this pull request. Please don't open new pull requests, it's a waste of time and scatters discussion across multiple places

@ordicker
Copy link
Author

I saw this GSoC binding to Julia.
Is BinaryBulider could help simplify the compilation process? The compilation process also generates the OpenCV.jl package, so I'm not sure if BinaryBulider could help.

@ordicker
Copy link
Author

ordicker commented Oct 4, 2020

I think it's better to wait for the 4.5.0 release.

@ordicker ordicker closed this Oct 4, 2020
@ViralBShah
Copy link
Member

Just curious- what is wrong with 4.4? Can we not get it in for the platforms it builds on?

@ordicker
Copy link
Author

ordicker commented Oct 4, 2020

Notting wrong with 4.4 but the guys at GSoC did amazing work (which I stumbled upon accidentally), and I would recommand anyone how try to call OpenCV functions to compile it from source with Julia flags.
I know that those 2 topics (binding and binaries) looks separated but as I followed the tutorial it's looks like that won't work here.
Maybe I got it wrong.

And sure we can get it for the platforms it builds on. I think the Windows one is also working but I'm not sure what is the problem.

@ViralBShah
Copy link
Member

@archit120 Could you chime in on what is necessary for OpenCV bindings to be built? Can you help with the BB recipes for opencv and cxxwrap wrappers?

@archit120
Copy link
Contributor

I tried to get BB recipe done after GSoC period was over but this semester has been swamped because of a delayed start. The way to get this to work shouldn't be too different from any other package that uses CxxWrap but there's a bit more complexity because the OpenCV compilation process also generated the Julia package itself.

The best way to do this would be to create another Julia package like OpenCV.jl that has the generated Julia package files but instead of using the manually linked library it depends on a JLL targetted at the exact same build configuration that the .jl files were generated from.

@ViralBShah
Copy link
Member

Thanks @archit120. Would it be possible for you once things are calmer to help out with these bindings? With BB binaries, as you may imagine, the usage of the package will increase manifold.

@ViralBShah
Copy link
Member

Maybe the simplest thing is to generate one JLL, if the opencv build process and cxxwrap bindings are all in the same package.

@ordicker
Copy link
Author

ordicker commented Oct 7, 2020

I would love to help, but I will need some guidance.

@archit120
Copy link
Contributor

@ViralBShah Yeah, I want to get back to finishing this ASAP because the build process is extremely complicated right now. I'm not aware if JLL can contain regular Julia package code but if that's possible then yes, it might be another possible way. It would still require some modifications in the OpenCV build system to create packages that could work this way and maybe BinaryBuilder? However, I think most other CxxWrap based packages take the approach of splitting the binary and the wrapper which is possible in this case too.

@ordicker I think the path to do this would be to first create a build recipe that is able to compile OpenCV binaries with the Julia flags on. Once that's done, we could just copy over the package file to a new location like OpenCV.jl and modify it to use the jll it was created from.

@ordicker
Copy link
Author

ordicker commented Oct 7, 2020

Got it, I will try to make a recipe with Julia flags. BTW do you know when OpenCV plans to release 4.5.0? 4.4.0 doesn't have those, and I prefer to make the recipe on stable release.

@ViralBShah
Copy link
Member

Yes, Julia code should be shipped in the regular Julia package way. Perhaps the simplest thing is to generate it once, check-in the Julia code into the package and compile opencv into the JLL. Don't try to automate the whole thing in order to get all this working.

I guess if 4.4 doesn't have the Julia flags, we have to certainly wait for 4.5.

@ordicker
Copy link
Author

4.5 is out. I will try to compile it with Julia flags.

@terasakisatoshi
Copy link
Contributor

@ordicker

My build_tarball.jl might help you. It builds OpenCV with 4.5.0 and add WITH_QT flags for linux platform.

Here is my application that uses My JLL package

@ordicker
Copy link
Author

ordicker commented Nov 1, 2020

That's really helpful, thanks!

@terasakisatoshi
Copy link
Contributor

Note that if we skip -DWITH_QT, we can't use cv2::imshow on Linux machine because it came up with the following error message:

OpenCV Error: Unspecified error (The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Carbon support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script) in cvShowImage

If we use -DWITH_GTK=ON and add GTK3_jll as a dependencies we can't build OpenCV. It gets an error message that tells missing <gtk/gtk/h>.

That's why I added -DWITH_QT option. However, there is a disadvantage we can't build OpenCV for various platforms such a AARCH64, ARM32 system.

You can also try a build_tarball.jl with headless version. Since it omits -DWITH_QT, we can build OpenCV for various platforms.

@ViralBShah
Copy link
Member

We now have Qt building on the arm systems.

@ViralBShah
Copy link
Member

It would be nice to get OpenCV into Yggdrasil.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants