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

@ -2,7 +2,7 @@
, libyaml, libxc, fftw, blas, lapack, gsl, netcdf, arpack, autoreconfHook
}:
assert (!blas.is64bit) && (!lapack.is64bit);
assert (!blas.isILP64) && (!lapack.isILP64);
stdenv.mkDerivation rec {
pname = "octopus";

View File

@ -13,7 +13,7 @@
assert pythonSupport -> pythonPackages != null;
assert opencvSupport -> opencv != null;
assert (!blas.is64bit) && (!lapack.is64bit);
assert (!blas.isILP64) && (!lapack.isILP64);
let
pname = "shogun";

View File

@ -9,7 +9,7 @@
, static ? false
}:
assert (!blas.is64bit) && (!lapack.is64bit);
assert (!blas.isILP64) && (!lapack.isILP64);
stdenv.mkDerivation rec {
name = "R-3.6.3";

View File

@ -5,7 +5,7 @@
}:
assert enableGUI -> libGLU != null && libGL != null && xorg != null && fltk != null;
assert (!blas.is64bit) && (!lapack.is64bit);
assert (!blas.isILP64) && (!lapack.isILP64);
stdenv.mkDerivation rec {
pname = "giac${lib.optionalString enableGUI "-with-xcas"}";

View File

@ -1,7 +1,7 @@
{ stdenv, fetchurl, cmake, blas, lapack, gfortran, gmm, fltk, libjpeg
, zlib, libGL, libGLU, xorg, opencascade-occt }:
assert (!blas.is64bit) && (!lapack.is64bit);
assert (!blas.isILP64) && (!lapack.isILP64);
stdenv.mkDerivation rec {
pname = "gmsh";

View File

@ -54,7 +54,7 @@
, less
}:
assert (!blas.is64bit) && (!lapack.is64bit);
assert (!blas.isILP64) && (!lapack.isILP64);
# This generates a `sage-env` shell file that will be sourced by sage on startup.
# It sets up various environment variables, telling sage where to find its

View File

@ -23,7 +23,7 @@
}:
# lots of segfaults with (64 bit) blas
assert (!blas.is64bit) && (!lapack.is64bit);
assert (!blas.isILP64) && (!lapack.isILP64);
# Wrapper that combined `sagelib` with `sage-env` to produce an actually
# executable sage. No tests are run yet and no documentation is built.

View File

@ -53,7 +53,7 @@
, pplpy
}:
assert (!blas.is64bit) && (!lapack.is64bit);
assert (!blas.isILP64) && (!lapack.isILP64);
# This is the core sage python package. Everything else is just wrappers gluing
# stuff together. It is not very useful on its own though, since it will not

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
'');
}

View File

@ -12,7 +12,7 @@
, CoreServices, ApplicationServices
}:
assert (!blas.is64bit) && (!lapack.is64bit);
assert (!blas.isILP64) && (!lapack.isILP64);
with stdenv.lib;
@ -88,7 +88,7 @@ stdenv.mkDerivation rec {
"SHELL=${stdenv.shell}"
"USE_SYSTEM_BLAS=1"
"USE_BLAS64=${if blas.is64bit then "1" else "0"}"
"USE_BLAS64=${if blas.isILP64 then "1" else "0"}"
"USE_SYSTEM_LAPACK=1"

View File

@ -22,7 +22,7 @@
with stdenv.lib;
assert (!blas.is64bit) && (!lapack.is64bit);
assert (!blas.isILP64) && (!lapack.isILP64);
let
dsfmtVersion = "2.2.3";
@ -137,7 +137,7 @@ stdenv.mkDerivation rec {
"SHELL=${stdenv.shell}"
"USE_SYSTEM_BLAS=1"
"USE_BLAS64=${if blas.is64bit then "1" else "0"}"
"USE_BLAS64=${if blas.isILP64 then "1" else "0"}"
"USE_SYSTEM_LAPACK=1"

View File

@ -53,7 +53,7 @@
, darwin
}:
assert (!blas.is64bit) && (!lapack.is64bit);
assert (!blas.isILP64) && (!lapack.isILP64);
stdenv.mkDerivation rec {
version = "5.2.0";
@ -125,12 +125,12 @@ stdenv.mkDerivation rec {
enableParallelBuilding = true;
# See https://savannah.gnu.org/bugs/?50339
F77_INTEGER_8_FLAG = if blas.is64bit then "-fdefault-integer-8" else "";
F77_INTEGER_8_FLAG = if blas.isILP64 then "-fdefault-integer-8" else "";
configureFlags = [
"--with-blas=blas"
"--with-lapack=lapack"
(if blas.is64bit then "--enable-64" else "--disable-64")
(if blas.isILP64 then "--enable-64" else "--disable-64")
]
++ (if stdenv.isDarwin then [ "--enable-link-all-dependencies" ] else [ ])
++ stdenv.lib.optionals enableReadline [ "--enable-readline" ]

View File

@ -2,7 +2,7 @@
, gmpxx
}:
assert (!blas.is64bit) && (!lapack.is64bit);
assert (!blas.isILP64) && (!lapack.isILP64);
stdenv.mkDerivation rec {
pname = "fflas-ffpack";

View File

@ -10,7 +10,7 @@
, withSage ? false # sage support
}:
assert (!blas.is64bit) && (!lapack.is64bit);
assert (!blas.isILP64) && (!lapack.isILP64);
stdenv.mkDerivation rec {
pname = "linbox";

View File

@ -18,7 +18,7 @@ stdenv.mkDerivation {
-e 's,^LAPACK=.*,LAPACK=-L${lapack}/lib -llapack,' \
Makeconf
''
+ stdenv.lib.optionalString blas.is64bit
+ stdenv.lib.optionalString blas.isILP64
''
sed -i Makeconf -e '/^FFLAGS=.*/ s/$/-fdefault-integer-8/'
'';

View File

@ -27,7 +27,7 @@ stdenv.mkDerivation {
cmakeFlags = [
"-DBUILD_SHARED_LIBS=ON"
"-DINTERFACE64=${optionalString blas.is64bit "1"}"
"-DINTERFACE64=${optionalString blas.isILP64 "1"}"
];
preCheck = if stdenv.isDarwin then ''

View File

@ -1,6 +1,6 @@
{ stdenv, fetchurl, unzip, blas, lapack, gfortran }:
assert (!blas.is64bit) && (!lapack.is64bit);
assert (!blas.isILP64) && (!lapack.isILP64);
stdenv.mkDerivation rec {
pname = "ipopt";

View File

@ -2,7 +2,7 @@
, gfortran, mpi, blas, lapack
} :
assert (!blas.is64bit) && (!lapack.is64bit);
assert (!blas.isILP64) && (!lapack.isILP64);
stdenv.mkDerivation rec {
pname = "scalapack";

View File

@ -1,6 +1,6 @@
{ stdenv, fetchFromGitHub, blas, lapack, gfortran, fixDarwinDylibNames }:
assert (!blas.is64bit) && (!lapack.is64bit);
assert (!blas.isILP64) && (!lapack.isILP64);
stdenv.mkDerivation rec {
pname = "scs";

View File

@ -1,7 +1,7 @@
{ stdenv, fetchurl, gfortran, blas, lapack }:
let
int_t = if blas.is64bit then "int64_t" else "int32_t";
int_t = if blas.isILP64 then "int64_t" else "int32_t";
in
stdenv.mkDerivation rec {
version = "4.2.1";

View File

@ -6,7 +6,7 @@ let
version = "4.4.4";
name = "suitesparse-${version}";
int_t = if blas.is64bit then "int64_t" else "int32_t";
int_t = if blas.isILP64 then "int64_t" else "int32_t";
SHLIB_EXT = stdenv.hostPlatform.extensions.sharedLibrary;
in
stdenv.mkDerivation {

View File

@ -44,7 +44,7 @@ stdenv.mkDerivation rec {
"BLAS=-lblas"
"LAPACK=-llapack"
"MY_METIS_LIB=-lmetis"
] ++ stdenv.lib.optionals blas.is64bit [
] ++ stdenv.lib.optionals blas.isILP64 [
"CFLAGS=-DBLAS64"
] ++ stdenv.lib.optionals enableCuda [
"CUDA_PATH=${cudatoolkit}"

View File

@ -1,7 +1,7 @@
{ stdenv, fetchurl, cmake,
gfortran, blas, lapack}:
assert (!blas.is64bit) && (!lapack.is64bit);
assert (!blas.isILP64) && (!lapack.isILP64);
stdenv.mkDerivation rec {
version = "5.2.1";

View File

@ -8,7 +8,7 @@
, gfortran
, lapackSupport ? true }:
assert (!blas.is64bit) && (!lapack.is64bit);
assert (!blas.isILP64) && (!lapack.isILP64);
stdenv.mkDerivation rec {
pname = "sundials";

View File

@ -7,7 +7,7 @@
, gfortran
, lapackSupport ? true }:
assert (!blas.is64bit) && (!lapack.is64bit);
assert (!blas.isILP64) && (!lapack.isILP64);
stdenv.mkDerivation rec {
pname = "sundials";

View File

@ -1,7 +1,7 @@
{ stdenv, fetchFromGitHub, darwin, ocaml, findlib, dune, base, stdio, lapack, blas }:
assert stdenv.lib.versionAtLeast (stdenv.lib.getVersion ocaml) "4.05.0";
assert (!blas.is64bit) && (!lapack.is64bit);
assert (!blas.isILP64) && (!lapack.isILP64);
stdenv.mkDerivation rec {
pname = "ocaml${ocaml.version}-lacaml";

View File

@ -11,7 +11,7 @@
, npy
}:
assert (!blas.is64bit) && (!lapack.is64bit);
assert (!blas.isILP64) && (!lapack.isILP64);
assert blas.implementation == "openblas" && lapack.implementation == "openblas";
buildDunePackage rec {

View File

@ -14,7 +14,7 @@
, withFftw ? true
}:
assert (!blas.is64bit) && (!lapack.is64bit);
assert (!blas.isILP64) && (!lapack.isILP64);
buildPythonPackage rec {
pname = "cvxopt";

View File

@ -12,7 +12,7 @@
, setuptoolsBuildHook
}:
assert (!blas.is64bit) && (!lapack.is64bit);
assert (!blas.isILP64) && (!lapack.isILP64);
let
cfg = writeTextFile {

View File

@ -1,6 +1,6 @@
{ stdenv, fetchurl, blas, lapack, mpi } :
assert (!blas.is64bit) && (!lapack.is64bit);
assert (!blas.isILP64) && (!lapack.isILP64);
stdenv.mkDerivation rec {
pname = "hpl";

View File

@ -59,7 +59,7 @@ in
{
blas = mapListToAttrs supportedSystems (system': let system = lib.systems.elaborate { system = system'; };
in mapListToAttrs (blasProviders system) (provider: let
is64bit = builtins.elem provider (["mkl64"] ++ lib.optional system.is64bit "openblas");
isILP64 = builtins.elem provider (["mkl64"] ++ lib.optional system.is64bit "openblas");
pkgs = pkgsFun {
config = { inherit allowUnfree; };
system = system';
@ -68,13 +68,13 @@ in
lapackProvider = if provider == "mkl64"
then super.mkl
else builtins.getAttr provider super;
inherit is64bit;
inherit isILP64;
};
blas = super.blas.override {
blasProvider = if provider == "mkl64"
then super.mkl
else builtins.getAttr provider super;
inherit is64bit;
inherit isILP64;
};
})];
};