python3Packages.pytorch: fix Darwin build by disabling GCD
PyTorch 1.6.0 has updated the vendored pthreadpool library, which has recently added support for Grand Central Dispatch. Unfortunately, it uses functionality (DISPATCH_APPLY_AUTO) that is only available since macOS 10.13, whereas we are still using 10.12 libraries. We can't directly pass through option to vendored libraries, since the setup.py scripts creates/filters the options that are passed to CMake. So, instead, this adds a small patch that disables the GCD functionality in pthreadpool.
This commit is contained in:
committed by
Frederik Rietdijk
parent
cb8a5e5b87
commit
6ffc0fd601
@@ -135,6 +135,13 @@ in buildPythonPackage rec {
|
||||
url = "https://github.com/pytorch/pytorch/commit/7676682584d0caf9243bce74ea0a88711ec4a807.diff";
|
||||
sha256 = "13spncaqlpsp8qk2850yly7xqwmhhfwznhmzkk8jgpslkbx75vgq";
|
||||
})
|
||||
] ++ lib.optionals stdenv.isDarwin [
|
||||
# pthreadpool added support for Grand Central Dispatch in April
|
||||
# 2020. However, this relies on functionality (DISPATCH_APPLY_AUTO)
|
||||
# that is available starting with macOS 10.13. However, our current
|
||||
# base is 10.12. Until we upgrade, we can fall back on the older
|
||||
# pthread support.
|
||||
./pthreadpool-disable-gcd.diff
|
||||
];
|
||||
|
||||
preConfigure = lib.optionalString cudaSupport ''
|
||||
|
||||
Reference in New Issue
Block a user