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

opencv: Fix OpenCV build on non NixOS platform #25814

Merged
merged 1 commit into from
May 16, 2017

Conversation

sifmelcara
Copy link
Member

@sifmelcara sifmelcara commented May 15, 2017

Motivation for this change

Fixes #21994

I solve this issue by deleting this paragraph

To reproduce this issue, a distro which have libraries symlinked in /lib and /lib64 is needed. (i.e Arch Linux)

Things done
  • Tested using sandboxing
    (nix.useSandbox on NixOS,
    or option build-use-sandbox in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • 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.

Edit: I forgot to put opencv in title, now fixed.

@mention-bot
Copy link

@sifmelcara, thanks for your PR! By analyzing the history of the files in this pull request, we identified @abbradar, @basvandijk and @cpages to be potential reviewers.

OpenCV's CMakeFile will use libraries in /lib and /lib64 if it can
find libraries from those paths. However, it causes
build failure because nix detects impure paths being used.
@sifmelcara sifmelcara changed the title Fix OpenCV build on non NixOS platform opencv: Fix OpenCV build on non NixOS platform May 15, 2017
@FRidh
Copy link
Member

FRidh commented May 16, 2017

cc maintainers @viric @mdaiter

@mdaiter
Copy link
Contributor

mdaiter commented May 16, 2017

Why does this fix build errors on non-NixOS systems?

@sifmelcara
Copy link
Member Author

Arch Linux have something like /lib64/libz.so in its filesystem, then these code add impure pathes to CMAKE_LIBRARY_PATH.

Because cmake tries to use those impure libraries, ld reports impure path `/lib64/libz.so' used in link, as reported in #21994 (Note that nix's ld have ability to detect impure library being linked)

@mdaiter
Copy link
Contributor

mdaiter commented May 16, 2017

@sifmelcara makes sense. You have my thumbs up.

👍

@FRidh FRidh merged commit fda2318 into NixOS:master May 16, 2017
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.

impure path when trying to build opencv with cuda
4 participants