···
assert blas.isILP64 == lapack.isILP64;
15
-
stdenv.mkDerivation rec {
17
+
stdenv.mkDerivation (finalAttrs: {
owner = "Reference-ScaLAPACK";
22
-
tag = "v${version}";
24
+
tag = "v${finalAttrs.version}";
hash = "sha256-KDMW/D7ubGaD2L7eTwULJ04fAYDPAKl8xKPZGZMkeik=";
26
-
passthru = { inherit (blas) isILP64; };
29
+
inherit (blas) isILP64;
30
+
tests.pkg-config = testers.hasPkgConfigModules {
31
+
package = finalAttrs.finalPackage;
__structuredAttrs = true;
···
# Required to activate ILP64.
# See https://github.com/Reference-ScaLAPACK/scalapack/pull/19
40
-
postPatch = lib.optionalString passthru.isILP64 ''
47
+
postPatch = lib.optionalString finalAttrs.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/*
···
53
-
nativeBuildInputs = [ cmake ];
60
+
nativeBuildInputs = [
nativeCheckInputs = [ mpiCheckPhaseHook ];
67
+
propagatedBuildInputs = [
59
-
propagatedBuildInputs = [ mpi ];
60
-
hardeningDisable = lib.optionals (stdenv.hostPlatform.isAarch64 && stdenv.hostPlatform.isDarwin) [
# xslu and xsllt tests seem to time out on x86_64-darwin.
# this line is left so those who force installation on x86_64-darwin can still build
doCheck = !(stdenv.hostPlatform.isx86_64 && stdenv.hostPlatform.isDarwin);
70
-
-DBUILD_SHARED_LIBS=ON -DBUILD_STATIC_LIBS=OFF
71
-
-DLAPACK_LIBRARIES="-llapack"
72
-
-DBLAS_LIBRARIES="-lblas"
73
-
-DCMAKE_Fortran_COMPILER=${lib.getDev mpi}/bin/mpif90
75
-
lib.concatStringsSep " " [
76
-
"-Wno-implicit-function-declaration"
77
-
(lib.optionalString passthru.isILP64 "-DInt=long")
80
-
${lib.optionalString passthru.isILP64 ''-DCMAKE_Fortran_FLAGS="-fdefault-integer-8"''}
78
+
(lib.cmakeBool "BUILD_SHARED_LIBS" (!stdenv.hostPlatform.isStatic))
79
+
(lib.cmakeFeature "LAPACK_LIBRARIES" "-llapack")
80
+
(lib.cmakeFeature "BLAS_LIBRARIES" "-lblas")
81
+
(lib.cmakeFeature "CMAKE_C_FLAGS" "${lib.concatStringsSep " " [
82
+
"-Wno-implicit-function-declaration"
83
+
(lib.optionalString finalAttrs.passthru.isILP64 "-DInt=long")
86
+
++ lib.optionals finalAttrs.passthru.isILP64 [
87
+
(lib.cmakeFeature "CMAKE_Fortran_FLAGS" "-fdefault-integer-8")
# Increase individual test timeout from 1500s to 10000s because hydra's builds
# sometimes fail due to this
···
# _IMPORT_PREFIX, used to point to lib, points to dev output. Every package using the generated
# cmake file will thus look for the library in the dev output instead of out.
# Use the absolute path to $out instead to fix the issue.
92
-
substituteInPlace $dev/lib/cmake/scalapack-${version}/scalapack-targets-release.cmake \
98
+
substituteInPlace $dev/lib/cmake/scalapack-${finalAttrs.version}/scalapack-targets-release.cmake \
--replace "\''${_IMPORT_PREFIX}" "$out"
homepage = "http://www.netlib.org/scalapack/";
description = "Library of high-performance linear algebra routines for parallel distributed memory machines";
99
-
license = licenses.bsd3;
100
-
platforms = platforms.unix;
101
-
maintainers = with maintainers; [
105
+
license = lib.licenses.bsd3;
106
+
platforms = lib.platforms.unix;
107
+
pkgConfigModules = [ "scalapack" ];
108
+
maintainers = with lib.maintainers; [
···
# xslu and xsllt tests fail on x86 darwin
broken = stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64;