Merge pull request #333016 from doronbehar/pkg/openmpi@darwin
openmpi & pmix: fix build & evaluation on Darwin
This commit is contained in:
@@ -40,11 +40,11 @@
|
||||
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "openmpi";
|
||||
version = "5.0.3";
|
||||
version = "5.0.5";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://www.open-mpi.org/software/ompi/v${lib.versions.majorMinor finalAttrs.version}/downloads/openmpi-${finalAttrs.version}.tar.bz2";
|
||||
sha256 = "sha256-mQWC8gazqzLpOKoxu/B8Y5No5EBdyhlvq+fw927tqQs=";
|
||||
sha256 = "sha256-ZYjVfApL0pmiQQP04ZYFGynotV+9pJ4R1bPTIDCjJ3Y=";
|
||||
};
|
||||
|
||||
postPatch = ''
|
||||
@@ -116,8 +116,8 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
(lib.enableFeature cudaSupport "mca-dso")
|
||||
(lib.enableFeature fortranSupport "mpi-fortran")
|
||||
(lib.withFeatureAs stdenv.isLinux "libnl" (lib.getDev libnl))
|
||||
"--with-pmix=${if stdenv.isLinux then (lib.getDev pmix) else "internal"}"
|
||||
(lib.withFeatureAs stdenv.isLinux "pmix-libdir" "${lib.getLib pmix}/lib")
|
||||
"--with-pmix=${lib.getDev pmix}"
|
||||
"--with-pmix-libdir=${lib.getLib pmix}/lib"
|
||||
# Puts a "default OMPI_PRTERUN" value to mpirun / mpiexec executables
|
||||
(lib.withFeatureAs stdenv.isLinux "prrte" (lib.getBin prrte))
|
||||
(lib.withFeature enableSGE "sge")
|
||||
@@ -212,7 +212,12 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
${lib.pipe wrapperDataFileNames [
|
||||
(lib.mapCartesianProduct (
|
||||
{ part1, part2 }:
|
||||
''
|
||||
# From some reason the Darwin build doesn't include some of these
|
||||
# wrapperDataSubstitutions strings and even some of the files. Hence
|
||||
# we currently don't perform these substitutions on other platforms,
|
||||
# until a Darwin user will care enough about this cross platform
|
||||
# related substitution.
|
||||
lib.optionalString stdenv.isLinux ''
|
||||
substituteInPlace "''${!outputDev}/share/openmpi/${part1}${part2}-wrapper-data.txt" \
|
||||
--replace-fail \
|
||||
compiler=${lib.elemAt wrapperDataSubstitutions.${part2} 0} \
|
||||
@@ -263,7 +268,10 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
homepage = "https://www.open-mpi.org/";
|
||||
description = "Open source MPI-3 implementation";
|
||||
longDescription = "The Open MPI Project is an open source MPI-3 implementation that is developed and maintained by a consortium of academic, research, and industry partners. Open MPI is therefore able to combine the expertise, technologies, and resources from all across the High Performance Computing community in order to build the best MPI library available. Open MPI offers advantages for system and software vendors, application developers and computer science researchers.";
|
||||
maintainers = with lib.maintainers; [ markuskowa ];
|
||||
maintainers = with lib.maintainers; [
|
||||
markuskowa
|
||||
doronbehar
|
||||
];
|
||||
license = lib.licenses.bsd3;
|
||||
platforms = lib.platforms.unix;
|
||||
};
|
||||
|
||||
@@ -1,22 +1,37 @@
|
||||
{ lib, stdenv, fetchFromGitHub, perl, autoconf, automake
|
||||
, removeReferencesTo, libtool, python3, flex, libevent
|
||||
, targetPackages, makeWrapper
|
||||
, hwloc, munge, zlib, pandoc, gitMinimal
|
||||
} :
|
||||
{
|
||||
lib,
|
||||
stdenv,
|
||||
fetchFromGitHub,
|
||||
perl,
|
||||
autoconf,
|
||||
automake,
|
||||
removeReferencesTo,
|
||||
libtool,
|
||||
python3,
|
||||
flex,
|
||||
libevent,
|
||||
targetPackages,
|
||||
makeWrapper,
|
||||
hwloc,
|
||||
munge,
|
||||
zlib,
|
||||
pandoc,
|
||||
gitMinimal,
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "pmix";
|
||||
version = "5.0.3";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
repo = "openpmix";
|
||||
owner = "openpmix";
|
||||
rev = "v${version}";
|
||||
rev = "v${finalAttrs.version}";
|
||||
hash = "sha256-5qBZj4L0Qu/RvNj8meL0OlLCdfGvBP0D916Mr+0XOCQ=";
|
||||
fetchSubmodules = true;
|
||||
};
|
||||
|
||||
outputs = [ "out" "dev" ];
|
||||
outputs = [ "out" ] ++ lib.optionals stdenv.isLinux [ "dev" ];
|
||||
|
||||
postPatch = ''
|
||||
patchShebangs ./autogen.pl
|
||||
@@ -36,7 +51,12 @@ stdenv.mkDerivation rec {
|
||||
makeWrapper
|
||||
];
|
||||
|
||||
buildInputs = [ libevent hwloc munge zlib ];
|
||||
buildInputs = [
|
||||
libevent
|
||||
hwloc
|
||||
munge
|
||||
zlib
|
||||
];
|
||||
|
||||
configureFlags = [
|
||||
"--with-libevent=${lib.getDev libevent}"
|
||||
@@ -50,40 +70,47 @@ stdenv.mkDerivation rec {
|
||||
./autogen.pl
|
||||
'';
|
||||
|
||||
postInstall = ''
|
||||
find $out/lib/ -name "*.la" -exec rm -f \{} \;
|
||||
postInstall =
|
||||
''
|
||||
find $out/lib/ -name "*.la" -exec rm -f \{} \;
|
||||
|
||||
moveToOutput "bin/pmix_info" "''${!outputDev}"
|
||||
moveToOutput "bin/pmixcc" "''${!outputDev}"
|
||||
moveToOutput "share/pmix/pmixcc-wrapper-data.txt" "''${!outputDev}"
|
||||
moveToOutput "bin/pmix_info" "''${!outputDev}"
|
||||
moveToOutput "bin/pmixcc" "''${!outputDev}"
|
||||
moveToOutput "share/pmix/pmixcc-wrapper-data.txt" "''${!outputDev}"
|
||||
|
||||
''
|
||||
# From some reason the Darwin build doesn't include this file, so we
|
||||
# currently disable this substitution for any non-Linux platform, until a
|
||||
# Darwin user will care enough about this cross platform fix.
|
||||
+ lib.optionalString stdenv.isLinux ''
|
||||
# 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).
|
||||
substituteInPlace "''${!outputDev}"/share/pmix/pmixcc-wrapper-data.txt \
|
||||
--replace-fail compiler=gcc \
|
||||
compiler=${targetPackages.stdenv.cc}/bin/${targetPackages.stdenv.cc.targetPrefix}cc
|
||||
'';
|
||||
|
||||
postFixup = lib.optionalString (lib.elem "dev" finalAttrs.outputs) ''
|
||||
# The build info (parameters to ./configure) are hardcoded
|
||||
# into the library. This clears all references to $dev/include.
|
||||
remove-references-to -t "''${!outputDev}" $(readlink -f $out/lib/libpmix.so)
|
||||
|
||||
# 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).
|
||||
substituteInPlace $dev/share/pmix/pmixcc-wrapper-data.txt \
|
||||
--replace-fail compiler=gcc \
|
||||
compiler=${targetPackages.stdenv.cc}/bin/${targetPackages.stdenv.cc.targetPrefix}cc
|
||||
wrapProgram "''${!outputDev}"/bin/pmixcc \
|
||||
--set PMIX_INCLUDEDIR "''${!outputDev}"/include \
|
||||
--set PMIX_PKGDATADIR "''${!outputDev}"/share/pmix
|
||||
'';
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
meta = with lib; {
|
||||
meta = {
|
||||
description = "Process Management Interface for HPC environments";
|
||||
homepage = "https://openpmix.github.io/";
|
||||
license = licenses.bsd3;
|
||||
maintainers = [ maintainers.markuskowa ];
|
||||
platforms = platforms.linux;
|
||||
license = lib.licenses.bsd3;
|
||||
maintainers = with lib.maintainers; [
|
||||
markuskowa
|
||||
doronbehar
|
||||
];
|
||||
};
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user