Commit 06c1631b authored by qbisi's avatar qbisi
Browse files

superlu_dist: fix build failure on darwin platform

parent 71b6f2f4
Loading
Loading
Loading
Loading
+15 −6
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@
  lib,
  stdenv,
  fetchFromGitHub,
  fetchurl,
  cmake,
  gfortran,
  blas,
@@ -11,6 +12,7 @@
  metis,
  parmetis,
  withExamples ? false,
  fortranSupport ? stdenv.hostPlatform.isLinux,
  # Todo: ask for permission of unfree parmetis
  withParmetis ? false,
}:
@@ -34,6 +36,10 @@ stdenv.mkDerivation (finalAttrs: {

  patches = [
    ./mc64ad_dist-stub.patch
    (fetchurl {
      url = "https://github.com/xiaoyeli/superlu_dist/commit/8ef3f7fda091529d7e7f16087864fee66c4834c9.patch";
      hash = "sha256-kCSqojYKpk75m+FwhS0hXHSybm+GZzOYikePcf2U3Fw=";
    })
  ];

  postPatch = ''
@@ -41,8 +47,11 @@ stdenv.mkDerivation (finalAttrs: {
      --replace-fail "LargeDiag_MC64" "NOROWPERM"
  '';

  nativeBuildInputs = [
  nativeBuildInputs =
    [
      cmake
    ]
    ++ lib.optionals fortranSupport [
      gfortran
    ];

@@ -63,7 +72,7 @@ stdenv.mkDerivation (finalAttrs: {
      (lib.cmakeBool "enable_examples" withExamples)
      (lib.cmakeBool "BUILD_SHARED_LIBS" (!stdenv.hostPlatform.isStatic))
      (lib.cmakeBool "BUILD_STATIC_LIBS" stdenv.hostPlatform.isStatic)
      (lib.cmakeBool "enable_fortran" true)
      (lib.cmakeBool "XSDK_ENABLE_Fortran" fortranSupport)
      (lib.cmakeBool "TPL_ENABLE_INTERNAL_BLASLIB" false)
      (lib.cmakeBool "TPL_ENABLE_LAPACKLIB" true)
      (lib.cmakeBool "TPL_ENABLE_PARMETISLIB" withParmetis)
@@ -97,7 +106,7 @@ stdenv.mkDerivation (finalAttrs: {
      asl20
    ];
    description = "Library for the solution of large, sparse, nonsymmetric systems of linear equations";
    platforms = lib.platforms.linux;
    platforms = lib.platforms.unix;
    maintainers = with lib.maintainers; [ qbisi ];
  };
})