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

opencv3: don't download ippicv if not enabled #37765

Merged
merged 1 commit into from Mar 25, 2018

Conversation

bachp
Copy link
Member

@bachp bachp commented Mar 25, 2018

On aarch64 ipp is not available but the derivation still tries to download it
leading to an error that the platform is not supported.

There is already an option to enable ipp which is disabled by default.
So the sensitive thing to do is to only download the ippicv package if
the option is enabled.

This should make opencv3 build on aarch64.

Motivation for this change

Use python3Packages.opencv3 on raspberry pi.

Things done

I built python3Packages.opencv3 and opencv3 on my x86_64 machine. But I was unable to build opencv3 on my RaspberryPi 3. It always produces a compile segmentation fault, I assume due the lack of resources of the device.

  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • 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 nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

On aarch64 ipp is not available but the derivation still tries to download it
leading to an error that the platform is not supported.

There is already an option to enable ipp which is disabled by default.
So the sensitive thing to do is to only download the ippicv package if
the option is enabled.

This makes opencv3 build on aarch64.
@7c6f434c
Copy link
Member

@GrahamcOfBorg build opencv3 python3Packages.opencv3

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: opencv3, python3Packages.opencv3

Partial log (click to expand)

shrinking /nix/store/17b79brz5zgd7j34ws2hrcal1f2lbm4h-opencv-3.4.1/lib/libopencv_imgproc.so.3.4.1
shrinking /nix/store/17b79brz5zgd7j34ws2hrcal1f2lbm4h-opencv-3.4.1/lib/libopencv_hdf.so.3.4.1
shrinking /nix/store/17b79brz5zgd7j34ws2hrcal1f2lbm4h-opencv-3.4.1/lib/libopencv_flann.so.3.4.1
shrinking /nix/store/17b79brz5zgd7j34ws2hrcal1f2lbm4h-opencv-3.4.1/lib/libopencv_core.so.3.4.1
strip is /nix/store/3zq400fri5dv7d30lpxlqm2v9y1iis6j-binutils-2.28.1/bin/strip
stripping (with command strip and flags -S) in /nix/store/17b79brz5zgd7j34ws2hrcal1f2lbm4h-opencv-3.4.1/lib  /nix/store/17b79brz5zgd7j34ws2hrcal1f2lbm4h-opencv-3.4.1/bin
patching script interpreter paths in /nix/store/17b79brz5zgd7j34ws2hrcal1f2lbm4h-opencv-3.4.1
checking for references to /build in /nix/store/17b79brz5zgd7j34ws2hrcal1f2lbm4h-opencv-3.4.1...
/nix/store/rigq51dm2jxph5cd7zyjyicchfkdjp7w-opencv-3.4.1
/nix/store/17b79brz5zgd7j34ws2hrcal1f2lbm4h-opencv-3.4.1

@GrahamcOfBorg
Copy link

Success on x86_64-darwin (full log)

Attempted: opencv3, python3Packages.opencv3

Partial log (click to expand)

/nix/store/hgqx927b7ayw418s4mcw9gznm7a0fwc1-opencv-3.4.1/lib/libopencv_tracking.3.4.1.dylib: fixing dylib
/nix/store/hgqx927b7ayw418s4mcw9gznm7a0fwc1-opencv-3.4.1/lib/libopencv_video.3.4.1.dylib: fixing dylib
/nix/store/hgqx927b7ayw418s4mcw9gznm7a0fwc1-opencv-3.4.1/lib/libopencv_videoio.3.4.1.dylib: fixing dylib
/nix/store/hgqx927b7ayw418s4mcw9gznm7a0fwc1-opencv-3.4.1/lib/libopencv_videostab.3.4.1.dylib: fixing dylib
/nix/store/hgqx927b7ayw418s4mcw9gznm7a0fwc1-opencv-3.4.1/lib/libopencv_xfeatures2d.3.4.1.dylib: fixing dylib
/nix/store/hgqx927b7ayw418s4mcw9gznm7a0fwc1-opencv-3.4.1/lib/libopencv_ximgproc.3.4.1.dylib: fixing dylib
/nix/store/hgqx927b7ayw418s4mcw9gznm7a0fwc1-opencv-3.4.1/lib/libopencv_xobjdetect.3.4.1.dylib: fixing dylib
/nix/store/hgqx927b7ayw418s4mcw9gznm7a0fwc1-opencv-3.4.1/lib/libopencv_xphoto.3.4.1.dylib: fixing dylib
/nix/store/hgqx927b7ayw418s4mcw9gznm7a0fwc1-opencv-3.4.1
/nix/store/5nc2pskqkyqaw3cjyzx4gk7z7n2csi36-opencv-3.4.1

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: opencv3, python3Packages.opencv3

Partial log (click to expand)

shrinking /nix/store/hbgdjx5nkrjj9dfqdi1b83yi2bw15i69-opencv-3.4.1/bin/opencv_traincascade
shrinking /nix/store/hbgdjx5nkrjj9dfqdi1b83yi2bw15i69-opencv-3.4.1/bin/opencv_createsamples
shrinking /nix/store/hbgdjx5nkrjj9dfqdi1b83yi2bw15i69-opencv-3.4.1/bin/opencv_annotation
shrinking /nix/store/hbgdjx5nkrjj9dfqdi1b83yi2bw15i69-opencv-3.4.1/bin/opencv_visualisation
shrinking /nix/store/hbgdjx5nkrjj9dfqdi1b83yi2bw15i69-opencv-3.4.1/bin/opencv_interactive-calibration
shrinking /nix/store/hbgdjx5nkrjj9dfqdi1b83yi2bw15i69-opencv-3.4.1/bin/opencv_version
strip is /nix/store/fzcs0fn6bb04m82frhlb78nc03ny3w55-binutils-2.28.1/bin/strip
stripping (with command strip and flags -S) in /nix/store/hbgdjx5nkrjj9dfqdi1b83yi2bw15i69-opencv-3.4.1/lib  /nix/store/hbgdjx5nkrjj9dfqdi1b83yi2bw15i69-opencv-3.4.1/bin
patching script interpreter paths in /nix/store/hbgdjx5nkrjj9dfqdi1b83yi2bw15i69-opencv-3.4.1
checking for references to /build in /nix/store/hbgdjx5nkrjj9dfqdi1b83yi2bw15i69-opencv-3.4.1...

@7c6f434c 7c6f434c merged commit 71dd955 into NixOS:master Mar 25, 2018
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

3 participants