From b8f2bc0768ef9f01f76d08f1b4d9cfeb0f033a6e Mon Sep 17 00:00:00 2001 From: Markus Kowalewski Date: Tue, 31 Oct 2023 11:08:33 +0100 Subject: [PATCH] mvapich: fix RPATH issues and infiniband build The rpath fix elimnated too much and thus disabled the mpichversion binary. Diasabling dlopen for infiniband libraries fixes the build for the infinband interface option. With this patch scalapack completes all tests for the infiniband and omnipath interface selection. However, ethernet is still broken with for the scalapack tests. See https://github.com/NixOS/nixpkgs/issues/258599 --- pkgs/development/libraries/mvapich/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/mvapich/default.nix b/pkgs/development/libraries/mvapich/default.nix index 9c5046415e64..2182c4083376 100644 --- a/pkgs/development/libraries/mvapich/default.nix +++ b/pkgs/development/libraries/mvapich/default.nix @@ -45,7 +45,7 @@ stdenv.mkDerivation rec { "FFLAGS=-fallow-argument-mismatch" # fix build with gfortran 10 ] ++ optional useSlurm "--with-pm=slurm" ++ optional (network == "ethernet") "--with-device=ch3:sock" - ++ optionals (network == "infiniband") [ "--with-device=ch3:mrail" "--with-rdma=gen2" ] + ++ optionals (network == "infiniband") [ "--with-device=ch3:mrail" "--with-rdma=gen2" "--disable-ibv-dlopen" ] ++ optionals (network == "omnipath") ["--with-device=ch3:psm" "--with-psm2=${libpsm2}"]; doCheck = true; @@ -54,7 +54,7 @@ stdenv.mkDerivation rec { # /tmp/nix-build... ends up in the RPATH, fix it manually for entry in $out/bin/mpichversion $out/bin/mpivars; do echo "fix rpath: $entry" - patchelf --set-rpath "$out/lib" $entry + patchelf --allowed-rpath-prefixes ${builtins.storeDir} --shrink-rpath $entry done # Ensure the default compilers are the ones mvapich was built with