13 assert blas.isILP64 == lapack.isILP64;
15 stdenv.mkDerivation rec {
19 src = fetchFromGitHub {
20 owner = "Reference-ScaLAPACK";
23 sha256 = "sha256-GNVGWrIWdfyTfbz7c31Vjt9eDlVzCd/aLHoWq2DMyX4=";
26 passthru = { inherit (blas) isILP64; };
28 __structuredAttrs = true;
30 # upstream patch, remove with next release
34 url = "https://github.com/Reference-ScaLAPACK/scalapack/commit/a0f76fc0c1c16646875b454b7d6f8d9d17726b5a.patch";
35 sha256 = "0civn149ikghakic30bynqg1bal097hr7i12cm4kq3ssrhq073bp";
39 # Required to activate ILP64.
40 # See https://github.com/Reference-ScaLAPACK/scalapack/pull/19
41 postPatch = lib.optionalString passthru.isILP64 ''
42 sed -i 's/INTSZ = 4/INTSZ = 8/g' TESTING/EIG/* TESTING/LIN/*
43 sed -i 's/INTGSZ = 4/INTGSZ = 8/g' TESTING/EIG/* TESTING/LIN/*
45 # These tests are not adapted to ILP64
46 sed -i '/xssep/d;/xsgsep/d;/xssyevr/d' TESTING/CMakeLists.txt
54 nativeBuildInputs = [ cmake ];
55 nativeCheckInputs = [ mpiCheckPhaseHook ];
60 propagatedBuildInputs = [ mpi ];
61 hardeningDisable = lib.optionals (stdenv.hostPlatform.isAarch64 && stdenv.hostPlatform.isDarwin) [
65 # xslu and xsllt tests seem to time out on x86_64-darwin.
66 # this line is left so those who force installation on x86_64-darwin can still build
67 doCheck = !(stdenv.hostPlatform.isx86_64 && stdenv.hostPlatform.isDarwin);
71 -DBUILD_SHARED_LIBS=ON -DBUILD_STATIC_LIBS=OFF
72 -DLAPACK_LIBRARIES="-llapack"
73 -DBLAS_LIBRARIES="-lblas"
74 -DCMAKE_Fortran_COMPILER=${lib.getDev mpi}/bin/mpif90
76 lib.concatStringsSep " " [
77 "-Wno-implicit-function-declaration"
78 (lib.optionalString passthru.isILP64 "-DInt=long")
81 ${lib.optionalString passthru.isILP64 ''-DCMAKE_Fortran_FLAGS="-fdefault-integer-8"''}
85 # Increase individual test timeout from 1500s to 10000s because hydra's builds
86 # sometimes fail due to this
87 checkFlags = [ "ARGS=--timeout 10000" ];
90 # _IMPORT_PREFIX, used to point to lib, points to dev output. Every package using the generated
91 # cmake file will thus look for the library in the dev output instead of out.
92 # Use the absolute path to $out instead to fix the issue.
93 substituteInPlace $dev/lib/cmake/scalapack-${version}/scalapack-targets-release.cmake \
94 --replace "\''${_IMPORT_PREFIX}" "$out"
98 homepage = "http://www.netlib.org/scalapack/";
99 description = "Library of high-performance linear algebra routines for parallel distributed memory machines";
100 license = licenses.bsd3;
101 platforms = platforms.unix;
102 maintainers = with maintainers; [
107 # xslu and xsllt tests fail on x86 darwin
108 broken = stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64;