2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, perl, autoconf, automake
|
2024-01-25 14:12:00 +00:00
|
|
|
, removeReferencesTo, libtool, python3, flex, libevent
|
|
|
|
, targetPackages, makeWrapper
|
|
|
|
, hwloc, munge, zlib, pandoc, gitMinimal
|
2020-07-18 16:06:22 +00:00
|
|
|
} :
|
|
|
|
|
2021-07-18 21:22:44 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2020-07-18 16:06:22 +00:00
|
|
|
pname = "pmix";
|
2023-11-16 04:20:00 +00:00
|
|
|
version = "5.0.1";
|
2020-07-18 16:06:22 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
repo = "openpmix";
|
|
|
|
owner = "openpmix";
|
|
|
|
rev = "v${version}";
|
2023-11-16 04:20:00 +00:00
|
|
|
hash = "sha256-ZuuzQ8j5zqQ/9mBFEODAaoX9/doWB9Nt9Sl75JkJyqU=";
|
|
|
|
fetchSubmodules = true;
|
2020-07-18 16:06:22 +00:00
|
|
|
};
|
|
|
|
|
2024-01-25 14:12:00 +00:00
|
|
|
outputs = [ "out" "dev" ];
|
|
|
|
|
2020-07-18 16:06:22 +00:00
|
|
|
postPatch = ''
|
|
|
|
patchShebangs ./autogen.pl
|
|
|
|
patchShebangs ./config
|
|
|
|
'';
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
pandoc
|
|
|
|
perl
|
|
|
|
autoconf
|
|
|
|
automake
|
|
|
|
libtool
|
|
|
|
flex
|
|
|
|
gitMinimal
|
|
|
|
python3
|
2024-01-25 14:12:00 +00:00
|
|
|
removeReferencesTo
|
|
|
|
makeWrapper
|
2023-11-16 04:20:00 +00:00
|
|
|
];
|
2020-07-18 16:06:22 +00:00
|
|
|
|
|
|
|
buildInputs = [ libevent hwloc munge zlib ];
|
|
|
|
|
|
|
|
configureFlags = [
|
2023-10-19 13:55:26 +00:00
|
|
|
"--with-libevent=${lib.getDev libevent}"
|
2023-11-16 04:20:00 +00:00
|
|
|
"--with-libevent-libdir=${lib.getLib libevent}/lib"
|
2020-07-18 16:06:22 +00:00
|
|
|
"--with-munge=${munge}"
|
2023-10-19 13:55:26 +00:00
|
|
|
"--with-hwloc=${lib.getDev hwloc}"
|
2023-11-16 04:20:00 +00:00
|
|
|
"--with-hwloc-libdir=${lib.getLib hwloc}/lib"
|
2020-07-18 16:06:22 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
./autogen.pl
|
|
|
|
'';
|
|
|
|
|
2023-10-19 13:55:26 +00:00
|
|
|
postInstall = ''
|
|
|
|
find $out/lib/ -name "*.la" -exec rm -f \{} \;
|
2024-01-25 14:12:00 +00:00
|
|
|
|
|
|
|
moveToOutput "bin/pmix_info" "''${!outputDev}"
|
|
|
|
moveToOutput "bin/pmixcc" "''${!outputDev}"
|
|
|
|
moveToOutput "share/pmix/pmixcc-wrapper-data.txt" "''${!outputDev}"
|
|
|
|
|
|
|
|
# The path to the pmixcc-wrapper-data.txt is hard coded and
|
|
|
|
# points to $out instead of dev. Use wrapper to fix paths.
|
|
|
|
wrapProgram $dev/bin/pmixcc \
|
|
|
|
--set PMIX_INCLUDEDIR $dev/include \
|
|
|
|
--set PMIX_PKGDATADIR $dev/share/pmix
|
|
|
|
'';
|
|
|
|
|
|
|
|
postFixup = ''
|
|
|
|
# The build info (parameters to ./configure) are hardcoded
|
|
|
|
# into the library. This clears all references to $dev/include.
|
|
|
|
remove-references-to -t $dev $(readlink -f $out/lib/libpmix.so)
|
|
|
|
|
|
|
|
# Pin the compiler to the current version in a cross compiler friendly way.
|
|
|
|
# Same pattern as for openmpi (see https://github.com/NixOS/nixpkgs/pull/58964#discussion_r275059427).
|
|
|
|
sed -i 's:compiler=.*:compiler=${targetPackages.stdenv.cc}/bin/${targetPackages.stdenv.cc.targetPrefix}cc:' \
|
|
|
|
$dev/share/pmix/pmixcc-wrapper-data.txt
|
2023-10-19 13:55:26 +00:00
|
|
|
'';
|
|
|
|
|
2020-07-18 16:06:22 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-07-18 16:06:22 +00:00
|
|
|
description = "Process Management Interface for HPC environments";
|
|
|
|
homepage = "https://openpmix.github.io/";
|
|
|
|
license = licenses.bsd3;
|
|
|
|
maintainers = [ maintainers.markuskowa ];
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|