diff options
author | Sam Stites <stites@users.noreply.github.com> | 2019-10-20 17:05:35 -0400 |
---|---|---|
committer | Jon <jonringer@users.noreply.github.com> | 2019-10-23 10:57:43 -0700 |
commit | cfdcce705291ebb4659dfaf8684f2cf950ecdebb (patch) | |
tree | ff4d7d288872963685d289b3b9604566a9af6430 /pkgs/development/libraries/openmpi | |
parent | 941cf345caeb7386d56f9c373a88659af62d9964 (diff) | |
download | nixlib-cfdcce705291ebb4659dfaf8684f2cf950ecdebb.tar nixlib-cfdcce705291ebb4659dfaf8684f2cf950ecdebb.tar.gz nixlib-cfdcce705291ebb4659dfaf8684f2cf950ecdebb.tar.bz2 nixlib-cfdcce705291ebb4659dfaf8684f2cf950ecdebb.tar.lz nixlib-cfdcce705291ebb4659dfaf8684f2cf950ecdebb.tar.xz nixlib-cfdcce705291ebb4659dfaf8684f2cf950ecdebb.tar.zst nixlib-cfdcce705291ebb4659dfaf8684f2cf950ecdebb.zip |
openmpi: enable cuda support
Diffstat (limited to 'pkgs/development/libraries/openmpi')
-rw-r--r-- | pkgs/development/libraries/openmpi/default.nix | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/pkgs/development/libraries/openmpi/default.nix b/pkgs/development/libraries/openmpi/default.nix index 2a293e0b8562..5996dda1e74e 100644 --- a/pkgs/development/libraries/openmpi/default.nix +++ b/pkgs/development/libraries/openmpi/default.nix @@ -1,5 +1,8 @@ { stdenv, fetchurl, fetchpatch, gfortran, perl, libnl -, rdma-core, zlib, numactl, libevent, hwloc, pkgsTargetTarget +, rdma-core, zlib, numactl, libevent, hwloc, pkgsTargetTarget, symlinkJoin + +# Enable CUDA support +, cudaSupport ? false, cudatoolkit ? null # Enable the Sun Grid Engine bindings , enableSGE ? false @@ -8,9 +11,15 @@ , enablePrefix ? false }: +assert !cudaSupport || cudatoolkit != null; + let version = "4.0.2"; + cudatoolkit_joined = symlinkJoin { + name = "${cudatoolkit.name}-unsplit"; + paths = [ cudatoolkit.out cudatoolkit.lib ]; + }; in stdenv.mkDerivation rec { pname = "openmpi"; inherit version; @@ -33,15 +42,20 @@ in stdenv.mkDerivation rec { buildInputs = with stdenv; [ gfortran zlib ] ++ lib.optionals isLinux [ libnl numactl ] + ++ lib.optionals cudaSupport [ cudatoolkit ] ++ [ libevent hwloc ] ++ lib.optional (isLinux || isFreeBSD) rdma-core; nativeBuildInputs = [ perl ]; - configureFlags = with stdenv; [ "--disable-mca-dso" ] + configureFlags = with stdenv; lib.optional (!cudaSupport) "--disable-mca-dso" ++ lib.optional isLinux "--with-libnl=${libnl.dev}" ++ lib.optional enableSGE "--with-sge" ++ lib.optional enablePrefix "--enable-mpirun-prefix-by-default" + # TODO: add UCX support, which is recommended to use with cuda for the most robust OpenMPI build + # https://github.com/openucx/ucx + # https://www.open-mpi.org/faq/?category=buildcuda + ++ lib.optionals cudaSupport [ "--with-cuda=${cudatoolkit_joined}" "--enable-dlopen" ] ; enableParallelBuilding = true; @@ -69,6 +83,10 @@ in stdenv.mkDerivation rec { doCheck = true; + passthru = { + inherit cudaSupport cudatoolkit; + }; + meta = with stdenv.lib; { homepage = https://www.open-mpi.org/; description = "Open source MPI-3 implementation"; |