Skip to content

opencv: add new version, variant, and patch#27374

Merged
adamjstewart merged 25 commits intospack:developfrom
glennpj:opencv
Feb 1, 2022
Merged

opencv: add new version, variant, and patch#27374
adamjstewart merged 25 commits intospack:developfrom
glennpj:opencv

Conversation

@glennpj
Copy link
Copy Markdown
Contributor

@glennpj glennpj commented Nov 11, 2021

  • added version 4.5.4
  • added tesseract variant
  • added patch to not add system paths

@spackbot-app
Copy link
Copy Markdown

spackbot-app bot commented Nov 11, 2021

@bvanessen can you review this PR?

This PR modifies the following package(s), for which you are listed as a maintainer:

  • opencv

@spackbot-app spackbot-app bot requested a review from adamjstewart November 11, 2021 21:44
Copy link
Copy Markdown
Member

@adamjstewart adamjstewart left a comment

Choose a reason for hiding this comment

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

Tesseract doesn't seem to be in OpenCV proper like all other components/modules we have variants for, it seems to be in opencv_contrib. Since is the first time we've added a opencv_contrib-specific component, I'll have to think if this is the best way to do this. We'll definitely need a conflict for +tesseract when ~contrib.

@glennpj
Copy link
Copy Markdown
Contributor Author

glennpj commented Nov 11, 2021

We'll definitely need a conflict for +tesseract when ~contrib.

Yes, sorry, I completely missed that.

@adamjstewart
Copy link
Copy Markdown
Member

Tesseract doesn't seem to be in OpenCV proper like all other components/modules we have variants for, it seems to be in opencv_contrib. Since is the first time we've added a opencv_contrib-specific component, I'll have to think if this is the best way to do this.

@bvanessen do you have any thoughts on this? I'm thinking we might just want to make it a separate variant (not in modules or components).

@glennpj
Copy link
Copy Markdown
Contributor Author

glennpj commented Nov 12, 2021

I just discovered that there seems to be a problem with the installation of opencv that, as far as I can tell, is independent of this PR. Looking at the installation directory, the programs are not getting installed in ${prefix}/bin. This is true for an installation of 4.5.2 that I did back in July as well.

@glennpj
Copy link
Copy Markdown
Contributor Author

glennpj commented Nov 12, 2021

Actually, I think things are fine. I did not realize that literally every variant is turned off.

@glennpj glennpj marked this pull request as draft November 17, 2021 17:58
@glennpj
Copy link
Copy Markdown
Contributor Author

glennpj commented Nov 17, 2021

I converted this to "draft" status as I found some components that do not build due to changed variable names. It looks like this began with version 4.5.2 but it seems like fixing those here is appropriate.

@glennpj
Copy link
Copy Markdown
Contributor Author

glennpj commented Nov 23, 2021

The changes wound being significant but applications and contrib modules are now available as variants, while components that can not be built are no longer variants.

Summary:

- all prebuilt apps are now variants and can be installed
- core is no longer a variant. It was always built anyway so it was not
  really a variant.
- contrib is no longer a variant. All of the contrib modules are now
  available as variants.
- components that can not be built with Spack are no longer variants.
  They are set to 'off' to prevent pulling from system.
- handle the case where a module and a component have the same name
- use `with when` framework
- adjust dependencies and conflicts
- new package: libraw1394
- have libdc1394 depend on libraw1394
- patch to find clp
- patch to find onnx
- patch for cvv to find Qt
- format with black

@spackbot-app spackbot-app bot added the python label Nov 29, 2021
@adamjstewart
Copy link
Copy Markdown
Member

Looks like there are some conflicts, can you resolve those?

Copy link
Copy Markdown
Contributor

@traversaro traversaro left a comment

Choose a reason for hiding this comment

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

The libdc1394 changes look ok for me @adamjstewart .

@glennpj
Copy link
Copy Markdown
Contributor Author

glennpj commented Nov 30, 2021

Looks like there are some conflicts, can you resolve those?

It looks like there were permissions changes on several files in the develop branch that were put in place after my last update of develop that this PR was created from. A rebase seems to have resolved it.

@glennpj glennpj requested a review from adamjstewart January 25, 2022 16:14
Copy link
Copy Markdown
Member

@adamjstewart adamjstewart left a comment

Choose a reason for hiding this comment

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

This PR should contain:

  1. changes to the OpenCV package
  2. changes to other packages that are required as a result (i.e. removing +core)

This PR should not contain changes to other packages that are not related to OpenCV (i.e. fixing a broken build). This makes it harder for me to review. Also, it looks like there was a bad rebase, so this PR is actually undoing many of the changes that have been made in other PRs.

# SPDX-License-Identifier: (Apache-2.0 OR MIT)


class Openvslam(CMakePackage):
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This package should be deprecated before being removed in case someone is still using it

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

By "remove" I mean deprecate first and delete in a later Spack release

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Even though there is no code, just a README?

@glennpj
Copy link
Copy Markdown
Contributor Author

glennpj commented Jan 28, 2022

This PR should contain:

  1. changes to the OpenCV package
  2. changes to other packages that are required as a result (i.e. removing +core)

This PR should not contain changes to other packages that are not related to OpenCV (i.e. fixing a broken build). This makes it harder for me to review. Also, it looks like there was a bad rebase, so this PR is actually undoing many of the changes that have been made in other PRs.

I moved quite a few packages out of this PR into other PRs earlier, as you had requested. I agree that something seemed to have gone horribly wrong with the rebase and I wound undoing much of that. I will have to sort that out, sorry for the extra work.

@glennpj glennpj marked this pull request as draft January 28, 2022 18:17
@glennpj
Copy link
Copy Markdown
Contributor Author

glennpj commented Jan 29, 2022

The problem was not the rebase per se, but a git mistake I made when I moved packages to separate PRs. After creating the other PRs I added commits to this PR to remove the packages. When I rebased, those commits replayed on top and effectively put the packages back in this PR, and reversed the desired commits from the other PRs. I suppose one could argue that doing a rebase was a mistake as I could have merged in the develop branch and resolved conflicts from there. Either way, I did not manage git properly and I apologize for the confusion and extra work.

@glennpj
Copy link
Copy Markdown
Contributor Author

glennpj commented Jan 29, 2022

The 3dtk package needs the new aruco variant in this PR.

@glennpj
Copy link
Copy Markdown
Contributor Author

glennpj commented Jan 29, 2022

The bohrium package needs the new cudev variant.

@glennpj
Copy link
Copy Markdown
Contributor Author

glennpj commented Jan 29, 2022

The py-torchgeo package needs the new datasets variant.

@glennpj glennpj marked this pull request as ready for review January 29, 2022 22:47
@glennpj glennpj requested a review from adamjstewart January 29, 2022 22:47
Copy link
Copy Markdown
Member

@adamjstewart adamjstewart left a comment

Choose a reason for hiding this comment

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

Testing the build and some packages I care about now

conflicts("+v4l", when="platform=darwin", msg="Linux only")
conflicts("+win32ui", when="platform=darwin", msg="Windows only")
conflicts("+win32ui", when="platform=linux", msg="Windows only")
conflicts("+win32ui", when="platform=cray", msg="Windows only")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We can now make the variant conditional on the OS, although that might be difficult to do with the for-loop.

The py-torchgeo package does not need opencv+datasets.
zip --> zlib
Copy link
Copy Markdown
Member

@adamjstewart adamjstewart left a comment

Choose a reason for hiding this comment

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

I haven't looked through the changes in extreme detail (like the conflicts stuff) but I tested that the package installs and works with the only project I use it for (TorchGeo). I'm fine with merging this in its current state unless there are any remaining tests or reviewers you would like to wait for.

@glennpj
Copy link
Copy Markdown
Contributor Author

glennpj commented Jan 31, 2022

I have not put openvslam back in yet. I am not really sure what it means to have a package that has no code, even deprecated packages should be buildable, I think. Otherwise, I think this is ready to go.

@adamjstewart
Copy link
Copy Markdown
Member

Yeah, it's mostly for people who already have the package in their source cache. But I'm not even sure we use the source cache when downloading from master anway.

@glennpj
Copy link
Copy Markdown
Contributor Author

glennpj commented Feb 1, 2022

This is a bit off topic but I looked into openvslam a little more. The only version in spack is master and that is when I discovered that there was only a README. However, there are releases that could be pulled. Interestingly, the README has been updated recently with a link to a lengthy discussion about legal issues and academic misconduct. I did not read the whole issue but it makes me think more firmly that we should remove it from spack.

https://github.com/OpenVSLAM-Community/openvslam/blob/in-discussion/README.md

So, I say let's merge this PR. We can deal with openvslam later if desired.

@adamjstewart adamjstewart merged commit 21524f5 into spack:develop Feb 1, 2022
RikkiButler20 pushed a commit to RikkiButler20/spack that referenced this pull request Feb 1, 2022
* opencv: add new version, variant, and patch

- added version 4.5.4
- added tesseract variant
- added patch to not add system paths

* Add leptonica depends and contrib conflicts

* Add dependencies for 1394 support

- new package: libraw1394
- add sdl dependency to libdc1394
- add conflict for openjpeg and jasper

* Adjust dependencies and conflicts for opencv modules

* rewrite of opencv

- all prebuilt apps are now variants and can be installed
- core is no longer a variant. It was always built anyway so it was not
  really a variant.
- contrib is no longer a variant. All of the contrib modules are now
  available as variants.
- components that can not be built with Spack are no longer variants.
  They are set to 'off' to prevent pulling from system.
- handle the case where a module and a component have the same name
- use `with when` framework
- adjust dependencies and conflicts
- new package: libraw1394
- have libdc1394 depend on libraw1394
- patch to find clp
- patch to find onnx
- patch for cvv to find Qt
- format with black

* Incorporate recommended changes

- fix variants and dependencies on packages that depend on opencv
- remove opencv-3.2 and patches
- add some new patches to handle different versions
- cntk needs further work
- the openvslam package was markde deprecated as it is no longer an
  active project and the repository has no code

* Remove gmake dependency.

* Remove sdl support

SDL is only used in an example case, but the examples are not built.

* remove openvslam

* Remove opencv+flann variant from 3dtk

* Back out cfitsio constraint from py-astropy

* remove opencv+flann variant from dlib

* remove boost constraint from 3dtk

* Remove non-opencv related bohrium changes

* Adjustments for cntk

- protobuf constraint at version 3.10
- need specific variants for opencv
- improve patch

* Deprecate CNTK package

* variant tweaks

- added appropriate conflicts for cublas
- made cuda/cudev relationship explicit
- moved openx to pending components as it needs an openvx package

* fix isort style error

* Use date version from kaldi rather than commit

* Revert changes from a bad rebase

* Add +flann to 3dtk and dlib

* Use compression support with libtiff

* remove `+datasets` from opencv dependency 

The py-torchgeo package does not need opencv+datasets.

* fix typo

zip --> zlib
@glennpj glennpj deleted the opencv branch February 1, 2022 23:25
RikkiButler20 pushed a commit to RikkiButler20/spack that referenced this pull request Feb 8, 2022
* opencv: add new version, variant, and patch

- added version 4.5.4
- added tesseract variant
- added patch to not add system paths

* Add leptonica depends and contrib conflicts

* Add dependencies for 1394 support

- new package: libraw1394
- add sdl dependency to libdc1394
- add conflict for openjpeg and jasper

* Adjust dependencies and conflicts for opencv modules

* rewrite of opencv

- all prebuilt apps are now variants and can be installed
- core is no longer a variant. It was always built anyway so it was not
  really a variant.
- contrib is no longer a variant. All of the contrib modules are now
  available as variants.
- components that can not be built with Spack are no longer variants.
  They are set to 'off' to prevent pulling from system.
- handle the case where a module and a component have the same name
- use `with when` framework
- adjust dependencies and conflicts
- new package: libraw1394
- have libdc1394 depend on libraw1394
- patch to find clp
- patch to find onnx
- patch for cvv to find Qt
- format with black

* Incorporate recommended changes

- fix variants and dependencies on packages that depend on opencv
- remove opencv-3.2 and patches
- add some new patches to handle different versions
- cntk needs further work
- the openvslam package was markde deprecated as it is no longer an
  active project and the repository has no code

* Remove gmake dependency.

* Remove sdl support

SDL is only used in an example case, but the examples are not built.

* remove openvslam

* Remove opencv+flann variant from 3dtk

* Back out cfitsio constraint from py-astropy

* remove opencv+flann variant from dlib

* remove boost constraint from 3dtk

* Remove non-opencv related bohrium changes

* Adjustments for cntk

- protobuf constraint at version 3.10
- need specific variants for opencv
- improve patch

* Deprecate CNTK package

* variant tweaks

- added appropriate conflicts for cublas
- made cuda/cudev relationship explicit
- moved openx to pending components as it needs an openvx package

* fix isort style error

* Use date version from kaldi rather than commit

* Revert changes from a bad rebase

* Add +flann to 3dtk and dlib

* Use compression support with libtiff

* remove `+datasets` from opencv dependency 

The py-torchgeo package does not need opencv+datasets.

* fix typo

zip --> zlib
EthanS94 pushed a commit to EthanS94/spack that referenced this pull request Feb 17, 2022
* opencv: add new version, variant, and patch

- added version 4.5.4
- added tesseract variant
- added patch to not add system paths

* Add leptonica depends and contrib conflicts

* Add dependencies for 1394 support

- new package: libraw1394
- add sdl dependency to libdc1394
- add conflict for openjpeg and jasper

* Adjust dependencies and conflicts for opencv modules

* rewrite of opencv

- all prebuilt apps are now variants and can be installed
- core is no longer a variant. It was always built anyway so it was not
  really a variant.
- contrib is no longer a variant. All of the contrib modules are now
  available as variants.
- components that can not be built with Spack are no longer variants.
  They are set to 'off' to prevent pulling from system.
- handle the case where a module and a component have the same name
- use `with when` framework
- adjust dependencies and conflicts
- new package: libraw1394
- have libdc1394 depend on libraw1394
- patch to find clp
- patch to find onnx
- patch for cvv to find Qt
- format with black

* Incorporate recommended changes

- fix variants and dependencies on packages that depend on opencv
- remove opencv-3.2 and patches
- add some new patches to handle different versions
- cntk needs further work
- the openvslam package was markde deprecated as it is no longer an
  active project and the repository has no code

* Remove gmake dependency.

* Remove sdl support

SDL is only used in an example case, but the examples are not built.

* remove openvslam

* Remove opencv+flann variant from 3dtk

* Back out cfitsio constraint from py-astropy

* remove opencv+flann variant from dlib

* remove boost constraint from 3dtk

* Remove non-opencv related bohrium changes

* Adjustments for cntk

- protobuf constraint at version 3.10
- need specific variants for opencv
- improve patch

* Deprecate CNTK package

* variant tweaks

- added appropriate conflicts for cublas
- made cuda/cudev relationship explicit
- moved openx to pending components as it needs an openvx package

* fix isort style error

* Use date version from kaldi rather than commit

* Revert changes from a bad rebase

* Add +flann to 3dtk and dlib

* Use compression support with libtiff

* remove `+datasets` from opencv dependency 

The py-torchgeo package does not need opencv+datasets.

* fix typo

zip --> zlib
@svenevs
Copy link
Copy Markdown
Member

svenevs commented Feb 25, 2022

Nice work @glennpj 🙂 I'm not in a position to update my spack right now so I just bludgeoned in sfm after realizing I didn't get it with my install a few months ago. Took a quick look to see if current develop had anything related to this module, you totally nailed it! This package is looking really great now ❤️ Looking forward to the next time I get to re-tool things.

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.

4 participants