mkl: include symlinks to versioned libblas.so.3 names

Some build systems look for this specifically.
This commit is contained in:
Benjamin Hipple 2020-05-07 21:42:47 -04:00 committed by Frederik Rietdijk
parent c1e605dd6b
commit 706642091e
2 changed files with 23 additions and 13 deletions
pkgs/development/libraries/science/math

View file

@ -20,6 +20,8 @@ let
openmp = if stdenvNoCC.isDarwin then "19.0" else "19.1";
openmp-ver = "${openmp}.${spot}-${rel}-${openmp}.${spot}-${rel}";
shlibExt = stdenvNoCC.hostPlatform.extensions.sharedLibrary;
in stdenvNoCC.mkDerivation {
pname = "mkl";
inherit version;
@ -114,10 +116,15 @@ in stdenvNoCC.mkDerivation {
'') + ''
# Setup symlinks for blas / lapack
ln -s $out/lib/libmkl_rt${stdenvNoCC.hostPlatform.extensions.sharedLibrary} $out/lib/libblas${stdenvNoCC.hostPlatform.extensions.sharedLibrary}${stdenvNoCC.lib.optionalString stdenvNoCC.hostPlatform.isLinux ".3"}
ln -s $out/lib/libmkl_rt${stdenvNoCC.hostPlatform.extensions.sharedLibrary} $out/lib/libcblas${stdenvNoCC.hostPlatform.extensions.sharedLibrary}${stdenvNoCC.lib.optionalString stdenvNoCC.hostPlatform.isLinux ".3"}
ln -s $out/lib/libmkl_rt${stdenvNoCC.hostPlatform.extensions.sharedLibrary} $out/lib/liblapack${stdenvNoCC.hostPlatform.extensions.sharedLibrary}${stdenvNoCC.lib.optionalString stdenvNoCC.hostPlatform.isLinux ".3"}
ln -s $out/lib/libmkl_rt${stdenvNoCC.hostPlatform.extensions.sharedLibrary} $out/lib/liblapacke${stdenvNoCC.hostPlatform.extensions.sharedLibrary}${stdenvNoCC.lib.optionalString stdenvNoCC.hostPlatform.isLinux ".3"}
ln -s $out/lib/libmkl_rt${shlibExt} $out/lib/libblas${shlibExt}
ln -s $out/lib/libmkl_rt${shlibExt} $out/lib/libcblas${shlibExt}
ln -s $out/lib/libmkl_rt${shlibExt} $out/lib/liblapack${shlibExt}
ln -s $out/lib/libmkl_rt${shlibExt} $out/lib/liblapacke${shlibExt}
'' + stdenvNoCC.lib.optionalString stdenvNoCC.hostPlatform.isLinux ''
ln -s $out/lib/libmkl_rt${shlibExt} $out/lib/libblas${shlibExt}".3"
ln -s $out/lib/libmkl_rt${shlibExt} $out/lib/libcblas${shlibExt}".3"
ln -s $out/lib/libmkl_rt${shlibExt} $out/lib/liblapack${shlibExt}".3"
ln -s $out/lib/libmkl_rt${shlibExt} $out/lib/liblapacke${shlibExt}".3"
'';
# fixDarwinDylibName fails for libmkl_cdft_core.dylib because the

View file

@ -93,6 +93,9 @@ let
if !builtins.isBool val then toString val
else if val then "1" else "0";
mkMakeFlagsFromConfig = mapAttrsToList (var: val: "${var}=${mkMakeFlagValue val}");
shlibExt = stdenv.hostPlatform.extensions.sharedLibrary;
in
stdenv.mkDerivation rec {
pname = "openblas";
@ -178,16 +181,16 @@ EOF
done
# Setup symlinks for blas / lapack
ln -s $out/lib/libopenblas${stdenv.hostPlatform.extensions.sharedLibrary} $out/lib/libblas${stdenv.hostPlatform.extensions.sharedLibrary}
ln -s $out/lib/libopenblas${stdenv.hostPlatform.extensions.sharedLibrary} $out/lib/libcblas${stdenv.hostPlatform.extensions.sharedLibrary}
ln -s $out/lib/libopenblas${stdenv.hostPlatform.extensions.sharedLibrary} $out/lib/liblapack${stdenv.hostPlatform.extensions.sharedLibrary}
ln -s $out/lib/libopenblas${stdenv.hostPlatform.extensions.sharedLibrary} $out/lib/liblapacke${stdenv.hostPlatform.extensions.sharedLibrary}
ln -s $out/lib/libopenblas${shlibExt} $out/lib/libblas${shlibExt}
ln -s $out/lib/libopenblas${shlibExt} $out/lib/libcblas${shlibExt}
ln -s $out/lib/libopenblas${shlibExt} $out/lib/liblapack${shlibExt}
ln -s $out/lib/libopenblas${shlibExt} $out/lib/liblapacke${shlibExt}
'' + stdenv.lib.optionalString stdenv.hostPlatform.isLinux ''
ln -s $out/lib/libopenblas${stdenv.hostPlatform.extensions.sharedLibrary} $out/lib/libblas${stdenv.hostPlatform.extensions.sharedLibrary}.3
ln -s $out/lib/libopenblas${stdenv.hostPlatform.extensions.sharedLibrary} $out/lib/libcblas${stdenv.hostPlatform.extensions.sharedLibrary}.3
ln -s $out/lib/libopenblas${stdenv.hostPlatform.extensions.sharedLibrary} $out/lib/liblapack${stdenv.hostPlatform.extensions.sharedLibrary}.3
ln -s $out/lib/libopenblas${stdenv.hostPlatform.extensions.sharedLibrary} $out/lib/liblapacke${stdenv.hostPlatform.extensions.sharedLibrary}.3
'';
ln -s $out/lib/libopenblas${shlibExt} $out/lib/libblas${shlibExt}.3
ln -s $out/lib/libopenblas${shlibExt} $out/lib/libcblas${shlibExt}.3
ln -s $out/lib/libopenblas${shlibExt} $out/lib/liblapack${shlibExt}.3
ln -s $out/lib/libopenblas${shlibExt} $out/lib/liblapacke${shlibExt}.3
'';
meta = with stdenv.lib; {
description = "Basic Linear Algebra Subprograms";