Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: cf96c40c1494
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: cbaa9a7ab917
Choose a head ref
  • 2 commits
  • 1 file changed
  • 2 contributors

Commits on Jun 4, 2019

  1. mkl: fix install_name on Darwin

    Closes #57697
    
    Co-Authored-By: Dmitry Kalinkin <dmitry.kalinkin@gmail.com>
    smaret and veprbl committed Jun 4, 2019
    Copy the full SHA
    fb883a5 View commit details

Commits on Jun 6, 2019

  1. Merge pull request #57947 from smaret/fix-mkl

    mkl: fix install_name on Darwin
    veprbl authored Jun 6, 2019
    Copy the full SHA
    cbaa9a7 View commit details
Showing with 29 additions and 12 deletions.
  1. +29 −12 pkgs/development/libraries/science/math/mkl/default.nix
41 changes: 29 additions & 12 deletions pkgs/development/libraries/science/math/mkl/default.nix
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{ stdenvNoCC, writeText, fetchurl, rpmextract, undmg }:
{ stdenvNoCC, writeText, fetchurl, rpmextract, undmg, darwin }:
/*
For details on using mkl as a blas provider for python packages such as numpy,
numexpr, scipy, etc., see the Python section of the NixPkgs manual.
*/
stdenvNoCC.mkDerivation rec {
stdenvNoCC.mkDerivation (rec {
name = "mkl-${version}";
version = "${date}.${rel}";
date = "2019.3";
@@ -21,7 +21,13 @@ stdenvNoCC.mkDerivation rec {
sha256 = "13rb2v2872jmvzcqm4fqsvhry0j2r5cn4lqql4wpqbl1yia2pph6";
});

buildInputs = if stdenvNoCC.isDarwin then [ undmg ] else [ rpmextract ];
nativeBuildInputs = if stdenvNoCC.isDarwin
then
[ undmg
darwin.cctools
]
else
[ rpmextract ];

buildPhase = if stdenvNoCC.isDarwin then ''
for f in Contents/Resources/pkg/*.tgz; do
@@ -41,6 +47,7 @@ stdenvNoCC.mkDerivation rec {
cp -r compilers_and_libraries_${version}/licensing/mkl/en/license.txt $out/lib/
cp -r compilers_and_libraries_${version}/mac/compiler/lib/* $out/lib/
cp -r compilers_and_libraries_${version}/mac/mkl/lib/* $out/lib/
cp -r compilers_and_libraries_${version}/mac/tbb/lib/* $out/lib/
'' else ''
mkdir -p $out/lib
@@ -51,18 +58,22 @@ stdenvNoCC.mkDerivation rec {
cp license.txt $out/lib/
'';

# fixDarwinDylibName fails for libmkl_cdft_core.dylib because the
# larger updated load commands do not fit. Use install_name_tool
# explicitly and ignore the error.
postFixup = stdenvNoCC.lib.optionalString stdenvNoCC.isDarwin ''
for f in $out/lib/*.dylib; do
install_name_tool -id $out/lib/$(basename $f) $f || true
done
install_name_tool -change @rpath/libiomp5.dylib $out/lib/libiomp5.dylib $out/lib/libmkl_intel_thread.dylib
install_name_tool -change @rpath/libtbb.dylib $out/lib/libtbb.dylib $out/lib/libmkl_tbb_thread.dylib
install_name_tool -change @rpath/libtbbmalloc.dylib $out/lib/libtbbmalloc.dylib $out/lib/libtbbmalloc_proxy.dylib
'';

# Per license agreement, do not modify the binary
dontStrip = true;
dontPatchELF = true;

# Since these are unmodified binaries from Intel, they do not depend on stdenv
# and we can make them fixed-output derivations for cache efficiency.
outputHashAlgo = "sha256";
outputHashMode = "recursive";
outputHash = if stdenvNoCC.isDarwin
then "0rwm46v9amq2clm6wxhr98zzbafr485dz05pihlqsbrbabmlfw30"
else "101krzh2mjbfx8kvxim2zphdvgg7iijhbf9xdz3ad3ncgybxbdvw";

meta = with stdenvNoCC.lib; {
description = "Intel Math Kernel Library";
longDescription = ''
@@ -76,4 +87,10 @@ stdenvNoCC.mkDerivation rec {
platforms = [ "x86_64-linux" "x86_64-darwin" ];
maintainers = [ maintainers.bhipple ];
};
}
} // stdenvNoCC.lib.optionalAttrs stdenvNoCC.isLinux {
# Since on Linux binaries are unmodified, we can make them
# fixed-output derivations.
outputHashAlgo = "sha256";
outputHashMode = "recursive";
outputHash = "101krzh2mjbfx8kvxim2zphdvgg7iijhbf9xdz3ad3ncgybxbdvw";
})