Merge pull request #75526 from robertodr/more-mkl

Add GNU threading and Fortran libraries to MKL package
This commit is contained in:
markuskowa 2020-01-04 20:36:43 +01:00 committed by GitHub
commit 1c55261574
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 34 additions and 12 deletions

View file

@ -1,4 +1,4 @@
{ stdenvNoCC, fetchurl, rpmextract, undmg, darwin }:
{ stdenvNoCC, fetchurl, rpmextract, undmg, darwin, enableStatic ? false }:
/*
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.
@ -46,12 +46,28 @@ in stdenvNoCC.mkDerivation {
tar xzvf $f
done
'' else ''
rpmextract rpm/intel-mkl-cluster-rt-${rpm-ver}.x86_64.rpm
rpmextract rpm/intel-mkl-common-c-${rpm-ver}.noarch.rpm
# Common stuff
rpmextract rpm/intel-mkl-core-${rpm-ver}.x86_64.rpm
rpmextract rpm/intel-mkl-common-c-${rpm-ver}.noarch.rpm
rpmextract rpm/intel-mkl-common-f-${rpm-ver}.noarch.rpm
# Dynamic libraries
rpmextract rpm/intel-mkl-cluster-rt-${rpm-ver}.x86_64.rpm
rpmextract rpm/intel-mkl-core-rt-${rpm-ver}.x86_64.rpm
rpmextract rpm/intel-mkl-gnu-f-rt-${rpm-ver}.x86_64.rpm
rpmextract rpm/intel-mkl-gnu-rt-${rpm-ver}.x86_64.rpm
# Intel OpenMP runtime
rpmextract rpm/intel-openmp-${openmp-ver}.x86_64.rpm
'';
'' + (if enableStatic then ''
# Static libraries
rpmextract rpm/intel-mkl-cluster-${rpm-ver}.x86_64.rpm
rpmextract rpm/intel-mkl-gnu-${rpm-ver}.x86_64.rpm
rpmextract rpm/intel-mkl-gnu-f-${rpm-ver}.x86_64.rpm
'' else ''
# Take care of installing dynamic-only PkgConfig files during the installPhase
''
);
installPhase = ''
for f in $(find . -name 'mkl*.pc') ; do
@ -80,15 +96,20 @@ in stdenvNoCC.mkDerivation {
cp -r compilers_and_libraries_${version}/mac/mkl/bin/pkgconfig/* $out/lib/pkgconfig
'' else ''
mkdir -p $out/lib
cp license.txt $out/lib/
cp -r opt/intel/compilers_and_libraries_${version}/linux/mkl/include $out/
mkdir -p $out/lib/pkgconfig
'') +
(if enableStatic then ''
cp -r opt/intel/compilers_and_libraries_${version}/linux/compiler/lib/intel64_lin/* $out/lib/
cp -r opt/intel/compilers_and_libraries_${version}/linux/mkl/lib/intel64_lin/* $out/lib/
cp license.txt $out/lib/
mkdir -p $out/lib/pkgconfig
cp -r opt/intel/compilers_and_libraries_${version}/linux/mkl/bin/pkgconfig/* $out/lib/pkgconfig
'' else ''
cp -r opt/intel/compilers_and_libraries_${version}/linux/compiler/lib/intel64_lin/*.so* $out/lib/
cp -r opt/intel/compilers_and_libraries_${version}/linux/mkl/lib/intel64_lin/*.so* $out/lib/
cp -r opt/intel/compilers_and_libraries_${version}/linux/mkl/bin/pkgconfig/*dynamic*.pc $out/lib/pkgconfig
'');
# fixDarwinDylibName fails for libmkl_cdft_core.dylib because the

View file

@ -153,6 +153,7 @@ in {
static = true;
};
openblas = super.openblas.override { enableStatic = true; };
mkl = super.mkl.override { enableStatic = true; };
nix = super.nix.override { withAWS = false; };
# openssl 1.1 doesn't compile
openssl = super.openssl_1_0_2.override {