Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)

Merge pull request #47182 from bhipple/add/mkl

mkl: init at 2019.0.117

authored by

Matthew Bauer and committed by
GitHub
0b298d51 4c1b22b1

+95
+8
lib/licenses.nix
··· 387 387 fullName = "ISC License"; 388 388 }; 389 389 390 + # Proprietary binaries; free to redistribute without modification. 391 + issl = { 392 + fullName = "Intel Simplified Software License"; 393 + url = https://software.intel.com/en-us/license/intel-simplified-software-license; 394 + free = false; 395 + }; 396 + 397 + 390 398 lgpl2 = spdx { 391 399 spdxId = "LGPL-2.0"; 392 400 fullName = "GNU Library General Public License v2 only";
+85
pkgs/development/libraries/science/math/mkl/default.nix
··· 1 + { stdenvNoCC, writeText, fetchurl, rpmextract, undmg }: 2 + /* 3 + Some (but not all) mkl functions require openmp, but Intel does not add these 4 + to SO_NEEDED and instructs users to put openmp on their LD_LIBRARY_PATH. If 5 + you are using mkl and your library/application is using some of the functions 6 + that require openmp, add a setupHook like this to your package: 7 + 8 + setupHook = writeText "setup-hook.sh" '' 9 + addOpenmp() { 10 + addToSearchPath LD_LIBRARY_PATH ${openmp}/lib 11 + } 12 + addEnvHooks "$targetOffset" addOpenmp 13 + ''; 14 + 15 + We do not add the setup hook here, because avoiding it allows this large 16 + package to be a fixed-output derivation with better cache efficiency. 17 + */ 18 + 19 + stdenvNoCC.mkDerivation rec { 20 + name = "mkl-${version}"; 21 + version = "${date}.${rel}"; 22 + date = "2019.0"; 23 + rel = "117"; 24 + 25 + src = if stdenvNoCC.isDarwin 26 + then 27 + (fetchurl { 28 + url = "http://registrationcenter-download.intel.com/akdlm/irc_nas/tec/13565/m_mkl_${version}.dmg"; 29 + sha256 = "1f1jppac7vqwn00hkws0p4njx38ajh0n25bsjyb5d7jcacwfvm02"; 30 + }) 31 + else 32 + (fetchurl { 33 + url = "http://registrationcenter-download.intel.com/akdlm/irc_nas/tec/13575/l_mkl_${version}.tgz"; 34 + sha256 = "1bf7i54iqlf7x7fn8kqwmi06g30sxr6nq3ac0r871i6g0p3y47sf"; 35 + }); 36 + 37 + buildInputs = if stdenvNoCC.isDarwin then [ undmg ] else [ rpmextract ]; 38 + 39 + buildPhase = if stdenvNoCC.isDarwin then '' 40 + for f in Contents/Resources/pkg/*.tgz; do 41 + tar xzvf $f 42 + done 43 + '' else '' 44 + rpmextract rpm/intel-mkl-common-c-${date}-${rel}-${date}-${rel}.noarch.rpm 45 + rpmextract rpm/intel-mkl-core-rt-${date}-${rel}-${date}-${rel}.x86_64.rpm 46 + ''; 47 + 48 + installPhase = if stdenvNoCC.isDarwin then '' 49 + mkdir -p $out/lib 50 + cp -r compilers_and_libraries_${version}/mac/mkl/include $out/ 51 + cp -r compilers_and_libraries_${version}/mac/mkl/lib/* $out/lib/ 52 + cp -r compilers_and_libraries_${version}/licensing/mkl/en/license.txt $out/lib/ 53 + '' else '' 54 + mkdir -p $out/lib 55 + cp -r opt/intel/compilers_and_libraries_${version}/linux/mkl/include $out/ 56 + cp -r opt/intel/compilers_and_libraries_${version}/linux/mkl/lib/intel64_lin/* $out/lib/ 57 + cp license.txt $out/lib/ 58 + ''; 59 + 60 + # Per license agreement, do not modify the binary 61 + dontStrip = true; 62 + dontPatchELF = true; 63 + 64 + # Since these are unmodified binaries from Intel, they do not depend on stdenv 65 + # and we can make them fixed-output derivations for cache efficiency. 66 + outputHashAlgo = "sha256"; 67 + outputHashMode = "recursive"; 68 + outputHash = if stdenvNoCC.isDarwin 69 + then "1224dln7n8px1rk8biiggf77wjhxh8mzw0hd8zlyjm8i6j8w7i12" 70 + else "0d8ai0wi8drp071acqkm1wv6vyg12010y843y56zzi1pql81xqvx"; 71 + 72 + meta = with stdenvNoCC.lib; { 73 + description = "Intel Math Kernel Library"; 74 + longDescription = '' 75 + Intel Math Kernel Library (Intel MKL) optimizes code with minimal effort 76 + for future generations of Intel processors. It is compatible with your 77 + choice of compilers, languages, operating systems, and linking and 78 + threading models. 79 + ''; 80 + homepage = https://software.intel.com/en-us/mkl; 81 + license = [ licenses.issl licenses.unfreeRedistributable ]; 82 + platforms = [ "x86_64-linux" "x86_64-darwin" ]; 83 + maintainers = [ maintainers.bhipple ]; 84 + }; 85 + }
+2
pkgs/top-level/all-packages.nix
··· 21066 21066 21067 21067 m4rie = callPackage ../development/libraries/science/math/m4rie { }; 21068 21068 21069 + mkl = callPackage ../development/libraries/science/math/mkl { }; 21070 + 21069 21071 nasc = callPackage ../applications/science/math/nasc { }; 21070 21072 21071 21073 openblas = callPackage ../development/libraries/science/math/openblas { };