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

add opencv build without openblas dependencies #980

Closed
wants to merge 2 commits into from

Conversation

n-kai-cj
Copy link
Contributor

@n-kai-cj n-kai-cj commented Dec 8, 2020

I'd like to add an option to build OpenCV without OpenBLAS dependencies.

  • Add exclude argument to root cppbuild.sh
  • Confirmed build success and run opencv without openblas.jar
    • build and run on windows-x86_64, windows-x86_64-gpu

build
bash cppbuild.sh -platform windows-x86_64 -exclude openblas install opencv
mvn install -Djavacpp.platform=windows-x86_64 --projects opencv

@saudet
Copy link
Member

saudet commented Dec 9, 2020

Please remove from the patch the files found under src/gen. They get regenerated anyway.

@n-kai-cj
Copy link
Contributor Author

n-kai-cj commented Dec 9, 2020

commit them.
BTW, how do I get this jar from https://oss.sonatype.org/content/repositories/snapshots/org/bytedeco/ or maven repository?
maybe I need to add something in .appveyor.yml and .travis.yml, but not sure how to add new argument exclude.

@saudet
Copy link
Member

saudet commented Dec 9, 2020

How about using an environment variable like HEADLESS so that we can run the build entering a single command like
HEADLESS=1 mvn clean install?

The builds are now done with GitHub Actions, so you can modify the files under .github to have the JAR files built from your fork deployed wherever you need them.

@saudet
Copy link
Member

saudet commented Dec 14, 2020

What about using NOOPENBLAS as environment variable to tweak the build? Does that sound good to you?

@n-kai-cj
Copy link
Contributor Author

sorry for late.
Yes, that's better to me.

I was looking into the way to add something to .github files to make jar files. Ideally, I'd like to get the opencv jar without openblas by indicating like a opencv_noopenblas-platforms in pom.xml. But I'm not sure how to do that.

@saudet
Copy link
Member

saudet commented Dec 14, 2020

I was looking into the way to add something to .github files to make jar files. Ideally, I'd like to get the opencv jar without openblas by indicating like a opencv_noopenblas-platforms in pom.xml. But I'm not sure how to do that.

The closest thing to that would be an "extension", such as the one defined in "platform/gpu/pom.xml", but this doesn't allow us to change the dependencies of the modules. There's just no way to do that with Maven... We could work around that by providing the "excludes" as part of the platform artifact in something like "platform/noopenblas/pom.xml" instead patching the main pom.xml file. I'm not sure that would work well, but if you would like to try it out, please do!

@n-kai-cj
Copy link
Contributor Author

Yes, I've just noticed it seems not to be able to be achieved. If I succeed with your comments such as adding exclude and platform/noopenblas/pom.xml, we couldn't get opencv-gpu without openblas or we need more platform/noopenblas/gpu/pom.xml, right? I think it's not a good way.

Second ideal thing is to get each platforms of opencv_noopenblas.jar from https://oss.sonatype.org/content/repositories/snapshots/org/bytedeco/. Can we change the artifact jar file's name with command mvn install by editing pom.xml?

@saudet
Copy link
Member

saudet commented Dec 14, 2020

Yes, I've just noticed it seems not to be able to be achieved. If I succeed with your comments such as adding exclude and platform/noopenblas/pom.xml, we couldn't get opencv-gpu without openblas or we need more platform/noopenblas/gpu/pom.xml, right? I think it's not a good way.

Right, it doubles the number of packages.

Second ideal thing is to get each platforms of opencv_noopenblas.jar from https://oss.sonatype.org/content/repositories/snapshots/org/bytedeco/. Can we change the artifact jar file's name with command mvn install by editing pom.xml?

That's determined by the classifier name here:
https://github.com/bytedeco/javacpp-presets/blob/master/pom.xml#L348

@n-kai-cj
Copy link
Contributor Author

Thank you! I'll try it later.

@saudet
Copy link
Member

saudet commented Dec 15, 2020

BTW, why do you need a version of OpenCV without OpenBLAS? Are you experiencing any issues with OpenBLAS?

@n-kai-cj
Copy link
Contributor Author

No, I don't have particular reason. I just want to reduce the artifact size.

@saudet
Copy link
Member

saudet commented Dec 15, 2020

That will only reduce the overall size by 1/3rd. To reduce more, you'll need to disable other modules from OpenCV anyway...

@n-kai-cj
Copy link
Contributor Author

Since openblas of master branch is upgraded, I have to change patch file.
I think it'll be unclear commit if I commit all changes from current master branch, so send another PR #987

Can I close this PR?

@saudet
Copy link
Member

saudet commented Dec 17, 2020 via email

@n-kai-cj n-kai-cj closed this Dec 19, 2020
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.

2 participants