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

libtorch-bin: fix CMake library paths for split outputs #103120

Merged
merged 2 commits into from Nov 10, 2020

Conversation

danieldk
Copy link
Contributor

@danieldk danieldk commented Nov 8, 2020

Motivation for this change

The libtorch CMake files are in the dev output and used relative
paths to locate the shared libraries. This fails, because the
libraries are in the out output. This change patches the CMake files
to use library paths from out.

See #102146.

Cc @juliendehos

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • 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 nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@danieldk danieldk force-pushed the libtorch-bin-cmake-fix-lib-paths branch from 831ff3b to 259950d Compare November 8, 2020 10:00
@danieldk
Copy link
Contributor Author

danieldk commented Nov 8, 2020

@juliendehos Thank you for reporting this bug. This change should fix the issue for the libtorch-bin derivation. I also tested the change with your example repository. Once this is merged, I will make a similar PR for the pytorch derivation`.

(Since libtorch-bin does not require any compilation, it is nicer for testing these changes.)

The libtorch CMake files are in the `dev` output and used relative
paths to locate the shared libraries. This fails, because the
libraries are in the `out` output. This change patches the CMake files
to use library paths from `out`.

See NixOS#102146.
@danieldk danieldk force-pushed the libtorch-bin-cmake-fix-lib-paths branch from 259950d to 2802a02 Compare November 9, 2020 06:50
@danieldk danieldk merged commit da115b4 into NixOS:master Nov 10, 2020
@danieldk danieldk deleted the libtorch-bin-cmake-fix-lib-paths branch November 10, 2020 11:10
@acairncross
Copy link
Contributor

Is this ok to be applied to pytorch too now?

@danieldk
Copy link
Contributor Author

danieldk commented Dec 3, 2020

Is this ok to be applied to pytorch too now?

Thanks for reminding me! I somehow thought that I had already created a PR for this, but I misremembered. Should be fixed with:

#105772

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

2 participants