scalapack: allow to build with ILP64 interface

This commit is contained in:
Markus Kowalewski
2022-02-06 18:58:29 +01:00
parent 52899ec696
commit c87e86dfeb
@@ -2,7 +2,7 @@
, mpi, blas, lapack
} :
assert (!blas.isILP64) && (!lapack.isILP64);
assert blas.isILP64 == lapack.isILP64;
stdenv.mkDerivation rec {
pname = "scalapack";
@@ -15,6 +15,18 @@ stdenv.mkDerivation rec {
sha256 = "0hiap5i9ik6xpvl721n2slanlqygagc1pg2bcjb27ans6balhsfh";
};
passthru = { inherit (blas) isILP64; };
# Required to activate ILP64.
# See https://github.com/Reference-ScaLAPACK/scalapack/pull/19
postPatch = lib.optionalString passthru.isILP64 ''
sed -i 's/INTSZ = 4/INTSZ = 8/g' TESTING/EIG/* TESTING/LIN/*
sed -i 's/INTGSZ = 4/INTGSZ = 8/g' TESTING/EIG/* TESTING/LIN/*
# These tests are not adapted to ILP64
sed -i '/xssep/d;/xsgsep/d;/xssyevr/d' TESTING/CMakeLists.txt
'';
nativeBuildInputs = [ cmake ];
checkInputs = [ openssh ];
buildInputs = [ blas lapack ];
@@ -28,6 +40,10 @@ stdenv.mkDerivation rec {
-DLAPACK_LIBRARIES="-llapack"
-DBLAS_LIBRARIES="-lblas"
-DCMAKE_Fortran_COMPILER=${mpi}/bin/mpif90
${lib.optionalString passthru.isILP64 ''
-DCMAKE_Fortran_FLAGS="-fdefault-integer-8"
-DCMAKE_C_FLAGS="-DInt=long"
''}
)
'';
@@ -55,5 +71,4 @@ stdenv.mkDerivation rec {
platforms = [ "x86_64-linux" ];
maintainers = with maintainers; [ costrouc markuskowa ];
};
}