Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

openmpi: make fortran support optional, disable fortran on aarch64-darwin #127694

Merged
merged 1 commit into from
Jun 29, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions pkgs/development/libraries/openmpi/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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"
Expand Down Expand Up @@ -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
Expand Down