mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-29 17:10:48 +00:00
Merge pull request #127694 from prusnak/openmpi
openmpi: make fortran support optional, disable fortran on aarch64-darwin
This commit is contained in:
commit
f50633d081
|
@ -13,20 +13,21 @@
|
|||
|
||||
# Enable libfabric support (necessary for Omnipath networks) on x86_64 linux
|
||||
, fabricSupport ? stdenv.isLinux && stdenv.isx86_64
|
||||
|
||||
# Enable Fortran support
|
||||
, fortranSupport ? !(stdenv.isDarwin && stdenv.isAarch64)
|
||||
}:
|
||||
|
||||
assert !cudaSupport || cudatoolkit != null;
|
||||
|
||||
let
|
||||
version = "4.1.1";
|
||||
|
||||
cudatoolkit_joined = symlinkJoin {
|
||||
name = "${cudatoolkit.name}-unsplit";
|
||||
paths = [ cudatoolkit.out cudatoolkit.lib ];
|
||||
};
|
||||
in stdenv.mkDerivation rec {
|
||||
pname = "openmpi";
|
||||
inherit version;
|
||||
version = "4.1.1";
|
||||
|
||||
src = with lib.versions; fetchurl {
|
||||
url = "https://www.open-mpi.org/software/ompi/v${major version}.${minor version}/downloads/${pname}-${version}.tar.bz2";
|
||||
|
@ -44,17 +45,19 @@ in stdenv.mkDerivation rec {
|
|||
find -name "Makefile.in" -exec sed -i "s/\`date\`/$ts/" \{} \;
|
||||
'';
|
||||
|
||||
buildInputs = with stdenv; [ gfortran zlib ]
|
||||
++ lib.optionals isLinux [ libnl numactl pmix ucx ]
|
||||
buildInputs = [ zlib ]
|
||||
++ lib.optionals fortranSupport [ gfortran ]
|
||||
++ lib.optionals stdenv.isLinux [ libnl numactl pmix ucx ]
|
||||
++ lib.optionals cudaSupport [ cudatoolkit ]
|
||||
++ [ libevent hwloc ]
|
||||
++ lib.optional (isLinux || isFreeBSD) rdma-core
|
||||
++ lib.optional (stdenv.isLinux || stdenv.isFreeBSD) rdma-core
|
||||
++ lib.optional fabricSupport [ libpsm2 libfabric ];
|
||||
|
||||
nativeBuildInputs = [ perl ];
|
||||
|
||||
configureFlags = with stdenv; lib.optional (!cudaSupport) "--disable-mca-dso"
|
||||
++ lib.optionals isLinux [
|
||||
configureFlags = lib.optional (!cudaSupport) "--disable-mca-dso"
|
||||
++ lib.optional (!fortranSupport) "--disable-mpi-fortran"
|
||||
++ lib.optionals stdenv.isLinux [
|
||||
"--with-libnl=${libnl.dev}"
|
||||
"--with-pmix=${pmix}"
|
||||
"--with-pmix-libdir=${pmix}/lib"
|
||||
|
@ -86,6 +89,7 @@ in stdenv.mkDerivation rec {
|
|||
|
||||
sed -i 's:compiler=.*:compiler=${targetPackages.stdenv.cc}/bin/${targetPackages.stdenv.cc.targetPrefix}c++:' \
|
||||
$out/share/openmpi/mpic++-wrapper-data.txt
|
||||
'' + lib.optionalString fortranSupport ''
|
||||
|
||||
sed -i 's:compiler=.*:compiler=${gfortran}/bin/${gfortran.targetPrefix}gfortran:' \
|
||||
$out/share/openmpi/mpifort-wrapper-data.txt
|
||||
|
|
Loading…
Reference in a new issue