From 82cb42395a4935ae323c9d33718a4100383fa12e Mon Sep 17 00:00:00 2001 From: Dustin Frisch Date: Mon, 15 Jan 2024 17:41:06 +0100 Subject: [PATCH] all: install edumpi --- packages/edumpi.nix | 114 ++++++++++++++++++++++++++++++++++++++++++++ shared/default.nix | 1 + shared/edumpi.nix | 14 ++++++ 3 files changed, 129 insertions(+) create mode 100644 packages/edumpi.nix create mode 100644 shared/edumpi.nix diff --git a/packages/edumpi.nix b/packages/edumpi.nix new file mode 100644 index 0000000..2266a67 --- /dev/null +++ b/packages/edumpi.nix @@ -0,0 +1,114 @@ +{ lib +, stdenv +, fetchFromGitHub +, git +, autoconf +, automake +, pkg-config +, gfortran +, perl +, python3 +, flex +, libnl +, rdma-core +, zlib +, numactl +, libevent +, hwloc +, targetPackages +, symlinkJoin +, libpsm2 +, libfabric +, libtool +, libbfd +, libiberty +, pmix +, ucx +, ucc +, postgresql +, ... +}: + +stdenv.mkDerivation { + pname = "edumpi"; + version = "ee0735"; + + src = fetchFromGitHub { + owner = "AnnaLena77"; + repo = "EduMPI"; + rev = "ee07355904db5b1e7f637498259b34d85edd2023"; + hash = "sha256-0EQdVLHUAiMUufCy9CfBvWbXmYDpy/i/Cw77DZU+0mc="; + fetchSubmodules = true; + }; + + postPatch = '' + patchShebangs ./ + ''; + + nativeBuildInputs = [ + autoconf + automake + perl + python3 + gfortran + git + flex + ]; + + buildInputs = [ + zlib + libnl + numactl + pmix + ucx + libevent + hwloc + rdma-core + libpsm2 + libfabric + libtool + libbfd + libiberty + postgresql + ]; + + LIBS = "-lpq"; + CFLAGS = "-DENABLE_ANALYSIS=1"; + + preConfigure = '' + ./autogen.pl + ''; + + configureFlags = [ + "--disable-mca-dso" + "--with-libnl=${lib.getDev libnl}" + "--with-pmix=${lib.getDev pmix}" + "--with-pmix-libdir=${pmix}/lib" + "--with-psm2=${lib.getDev libpsm2}" + "--with-libfabric=${lib.getDev libfabric}" + "--with-libfabric-libdir=${libfabric}/lib" + ]; + + enableParallelBuilding = true; + + postInstall = '' + find $out/lib/ -name "*.la" -exec rm -f \{} \; + ''; + + #postFixup = '' + # sed -i 's:compiler=.*:compiler=${targetPackages.stdenv.cc}/bin/${targetPackages.stdenv.cc.targetPrefix}cc:' \ + # $out/share/openmpi/mpicc-wrapper-data.txt + + # sed -i 's:compiler=.*:compiler=${targetPackages.stdenv.cc}/bin/${targetPackages.stdenv.cc.targetPrefix}cc:' \ + # $out/share/openmpi/ortecc-wrapper-data.txt + + # sed -i 's:compiler=.*:compiler=${targetPackages.stdenv.cc}/bin/${targetPackages.stdenv.cc.targetPrefix}c++:' \ + # $out/share/openmpi/mpic++-wrapper-data.txt + + # sed -i 's:compiler=.*:compiler=${gfortran}/bin/${gfortran.targetPrefix}gfortran:' \ + # $out/share/openmpi/mpifort-wrapper-data.txt + #''; + + doCheck = true; +} + diff --git a/shared/default.nix b/shared/default.nix index 4137da3..82dd7f1 100644 --- a/shared/default.nix +++ b/shared/default.nix @@ -9,6 +9,7 @@ ./rdma.nix ./ssl.nix ./slurm.nix + ./edumpi.nix "${modulesPath}/profiles/headless.nix" "${modulesPath}/profiles/all-hardware.nix" diff --git a/shared/edumpi.nix b/shared/edumpi.nix new file mode 100644 index 0000000..7162222 --- /dev/null +++ b/shared/edumpi.nix @@ -0,0 +1,14 @@ +{ pkgs, lib, ... }: + +with lib; + +let + edumpi = pkgs.callPackage ../packages/edumpi.nix { }; + +in +{ + systemd.tmpfiles.rules = [ + ''L+ /opt/edumpi - - - - ${edumpi}'' + ]; +} +