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

alembic: use threadsafe hdf5 #30682

Merged
merged 3 commits into from Jan 16, 2018
Merged

Conversation

guibou
Copy link
Contributor

@guibou guibou commented Oct 22, 2017

Motivation for this change

Allowing alembic (and perhaps other libraries) to load hdf5 encoded files in a concurrent manner. To achieve this, this change:

  • Enables thread-safe support in hdf5 in a separate package hdf5-threadsafe.
  • Use the later for the alembic package
Discussion

By default, hdf5 is not thread-safe hence --enable-threadsafe is mandatory to load alembic file (using hdf5) in a concurrent context.

However this change is not benign for all hdf5 users: the High Level (hl) library included in hdf5 does not officially support thread safety. The recommended way is to --disable-hl. However this may not be acceptable for some users of hdf5 (actually 21 derivation in nixpkgs). So I do not propose this for the default hdf5 derivation.

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
    • 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.

@FRidh
Copy link
Member

FRidh commented Oct 22, 2017

  • If I am correct zlib support is currently enabled.
  • szip is listed as unfree. Does alembic need szip support to function? If not, then it should not use szip by default.

@guibou
Copy link
Contributor Author

guibou commented Oct 22, 2017

@FRidh

  • Yes, you are right, zlib is currently enabled. I assumed that callPackage does not fill the value with a default, such as zlib = null, but I'm apparently wrong.
  • Alembic works without szip, you are right, and I understand the issue about the szip license, so I won't complain and override locally my project to get szip.

So the issue about szip and zlib can be closed. What about hdf5 and threading?

@guibou guibou force-pushed the guibou_alembic_hdf5 branch 2 times, most recently from d72b991 to 0b59ffd Compare October 22, 2017 21:40
@guibou guibou changed the title (Discussion) alembic: use threadsafe hdf5 and add (szip zlib) input format (Discussion) alembic: use threadsafe hdf5 Oct 23, 2017
alembic = callPackage ../development/libraries/alembic {};
alembic = callPackage ../development/libraries/alembic {
hdf5 = hdf5-threadsafe;
};
Copy link
Member

Choose a reason for hiding this comment

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

Since hdf5-threadsafe is in all-packages.nix why not just pass that in directly instead of overriding hdf5? This makes things more explicit for alembic and easier to understand.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You mean to directly use hdf5-threadsafe inside alembic? Yes, that's a solution. I'll update the PR with this.

@guibou
Copy link
Contributor Author

guibou commented Jan 15, 2018

Any update? I'm using this (2 lines) changes in production since October without any issue, can we merge?

@FRidh FRidh self-assigned this Jan 15, 2018
@guibou guibou changed the title (Discussion) alembic: use threadsafe hdf5 alembic: use threadsafe hdf5 Jan 15, 2018
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec

outputs = [ "bin" "dev" "out" "lib" ];

buildInputs = [ unzip cmake openexr hdf5 ];
buildInputs = [ unzip cmake openexr hdf5-threadsafe ];
Copy link
Member

Choose a reason for hiding this comment

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

Please shift unzip and cmake to nativeBuildInputs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

Compiled with thread safe support and without the High Level library
which is incompatible with thread safety.
@peterhoeg
Copy link
Member

Thanks @guibou !

@guibou guibou deleted the guibou_alembic_hdf5 branch January 16, 2018 10:35
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

4 participants