blas,lapack: use isILP64 instead of is64bit

This is a better name since we have multiple 64-bit things that could
be referred to.

LP64  : integer=32, long=64, pointer=64
ILP64 : integer=64, long=64, pointer=64
This commit is contained in:
Matthew Bauer
2020-04-20 15:50:55 -05:00
parent f86d582ea7
commit ff2f2644f8
32 changed files with 47 additions and 47 deletions

View File

@@ -1,7 +1,7 @@
{ lib, stdenv
, lapack-reference, openblasCompat, openblas
, is64bit ? false
, blasProvider ? if is64bit then openblas else openblasCompat }:
, isILP64 ? false
, blasProvider ? if isILP64 then openblas else openblasCompat }:
let
blasFortranSymbols = [
@@ -31,12 +31,12 @@ let
else stdenv.hostPlatform.extensions.sharedLibrary;
is64bit = blasProvider.blas64 or false;
isILP64 = blasProvider.blas64 or false;
blasImplementation = lib.getName blasProvider;
in
assert is64bit -> (blasImplementation == "openblas" && blasProvider.blas64) || blasImplementation == "mkl";
assert isILP64 -> (blasImplementation == "openblas" && blasProvider.blas64) || blasImplementation == "mkl";
stdenv.mkDerivation {
pname = "blas";
@@ -49,7 +49,7 @@ stdenv.mkDerivation {
};
passthru = {
inherit is64bit;
inherit isILP64;
provider = blasProvider;
implementation = blasImplementation;
};
@@ -134,6 +134,6 @@ Libs: -L$out/lib -lcblas
EOF
'' + stdenv.lib.optionalString (blasImplementation == "mkl") ''
mkdir -p $out/nix-support
echo 'export MKL_INTERFACE_LAYER=${lib.optionalString is64bit "I"}LP64,GNU' > $out/nix-support/setup-hook
echo 'export MKL_INTERFACE_LAYER=${lib.optionalString isILP64 "I"}LP64,GNU' > $out/nix-support/setup-hook
'');
}

View File

@@ -1,7 +1,7 @@
{ lib, stdenv
, lapack-reference, openblasCompat, openblas
, is64bit ? false
, lapackProvider ? if is64bit then openblas else openblasCompat }:
, isILP64 ? false
, lapackProvider ? if isILP64 then openblas else openblasCompat }:
let
@@ -14,7 +14,7 @@ let
in
assert is64bit -> (lapackImplementation == "openblas" && lapackProvider.blas64) || lapackImplementation == "mkl";
assert isILP64 -> (lapackImplementation == "openblas" && lapackProvider.blas64) || lapackImplementation == "mkl";
stdenv.mkDerivation {
pname = "lapack";
@@ -27,7 +27,7 @@ stdenv.mkDerivation {
};
passthru = {
inherit is64bit;
inherit isILP64;
provider = lapackProvider;
implementation = lapackImplementation;
};
@@ -108,6 +108,6 @@ Libs: -L$out/lib -llapacke
EOF
'' + stdenv.lib.optionalString (lapackImplementation == "mkl") ''
mkdir -p $out/nix-support
echo 'export MKL_INTERFACE_LAYER=${lib.optionalString is64bit "I"}LP64,GNU' > $out/nix-support/setup-hook
echo 'export MKL_INTERFACE_LAYER=${lib.optionalString isILP64 "I"}LP64,GNU' > $out/nix-support/setup-hook
'');
}