Unverified Commit 8909ef00 authored by Markus Kowalewski's avatar Markus Kowalewski Committed by GitHub
Browse files

octopus: fix build (#374380)

parents 9dee4ae9 f6f5a876
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -40,6 +40,11 @@ stdenv.mkDerivation rec {
    hash = "sha256-vG1HUkuNUZkhBumoJJy3AyFU6cZOo1YGmaOYcU6bPOM=";
  };

  patches = [
    # Discover all MPI languages components to avoid scalpack discovery failure
    ./scalapack-mpi-alias.patch
  ];

  nativeBuildInputs = [
    which
    perl
+13 −0
Original line number Diff line number Diff line
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 70d89efb5e..47ba750d7a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -131,7 +131,7 @@ set(Octopus_ext_libs)
 find_package(GSL)
 if (OCTOPUS_MPI)
 	set(MPI_DETERMINE_LIBRARY_VERSION ON)
-	find_package(MPI 3 COMPONENTS Fortran)
+	find_package(MPI 3)
 	# Further set MKL variables
 	if (MPI_Fortran_LIBRARY_VERSION_STRING MATCHES Intel)
 		set(MKL_MPI intelmpi CACHE STRING "Octopus: Overloaded")
+19 −2
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@
  lib,
  stdenv,
  fetchFromGitHub,
  fetchpatch,
  cmake,
  mpiCheckPhaseHook,
  mpi,
@@ -18,14 +19,22 @@ stdenv.mkDerivation rec {
  src = fetchFromGitHub {
    owner = "Reference-ScaLAPACK";
    repo = pname;
    rev = "v${version}";
    sha256 = "sha256-KDMW/D7ubGaD2L7eTwULJ04fAYDPAKl8xKPZGZMkeik=";
    tag = "v${version}";
    hash = "sha256-KDMW/D7ubGaD2L7eTwULJ04fAYDPAKl8xKPZGZMkeik=";
  };

  passthru = { inherit (blas) isILP64; };

  __structuredAttrs = true;

  patches = [
    (fetchpatch {
      name = "version-string";
      url = "https://github.com/Reference-ScaLAPACK/scalapack/commit/76cc1ed3032e9a4158a4513c9047c3746b269f04.patch";
      hash = "sha256-kmllLa9GUeTrHRYeS0yIk9I8LwaIoEytdyQGRuinn3A=";
    })
  ];

  # Required to activate ILP64.
  # See https://github.com/Reference-ScaLAPACK/scalapack/pull/19
  postPatch = lib.optionalString passthru.isILP64 ''
@@ -76,6 +85,14 @@ stdenv.mkDerivation rec {
  # sometimes fail due to this
  checkFlags = [ "ARGS=--timeout 10000" ];

  postFixup = ''
    # _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.
    substituteInPlace  $dev/lib/cmake/scalapack-${version}/scalapack-targets-release.cmake \
      --replace "\''${_IMPORT_PREFIX}" "$out"
  '';

  meta = with lib; {
    homepage = "http://www.netlib.org/scalapack/";
    description = "Library of high-performance linear algebra routines for parallel distributed memory machines";