gnu: quilt: Update to 0.66.
[jackhill/guix/guix.git] / gnu / packages / mpi.scm
index 0a43c55..952edca 100644 (file)
@@ -7,6 +7,7 @@
 ;;; Copyright © 2017 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2018 Paul Garlick <pgarlick@tourbillion-technology.com>
+;;; Copyright © 2019 Ricardo Wurmus <rekado@elephly.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -32,7 +33,9 @@
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system python)
   #:use-module (gnu packages)
+  #:use-module (gnu packages fabric-management)
   #:use-module (gnu packages gcc)
+  #:use-module (gnu packages java)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages pciutils)
@@ -174,6 +177,7 @@ bind processes, and much more.")
        ("gfortran" ,gfortran)
        ("libfabric" ,libfabric)
        ("libevent" ,libevent)
+       ("opensm" ,opensm)
        ,@(if (and (not (%current-target-system))
                   (member (%current-system) (package-supported-systems psm)))
              `(("psm" ,psm))
@@ -193,16 +197,34 @@ bind processes, and much more.")
      `(#:configure-flags `("--enable-mpi-ext=affinity" ;cr doesn't work
                            "--enable-memchecker"
                            "--with-sge"
-                           "--with-psm"
-                           "--with-psm2"
                            "--with-valgrind"
                            "--with-hwloc=external"
                            "--with-libevent"
+
+                           ;; InfiniBand support
+                           "--enable-openib-control-hdr-padding"
+                           "--enable-openib-dynamic-sl"
+                           "--enable-openib-udcm"
+                           "--enable-openib-rdmacm"
+                           "--enable-openib-rdmacm-ibaddr"
+
                            ;; Enable support for SLURM's Process Manager
                            ;; Interface (PMI).
                            ,(string-append "--with-pmi="
                                            (assoc-ref %build-inputs "slurm")))
        #:phases (modify-phases %standard-phases
+                  ;; opensm is needed for InfiniBand support.
+                  (add-after 'unpack 'find-opensm-headers
+                    (lambda* (#:key inputs #:allow-other-keys)
+                      (setenv "C_INCLUDE_PATH"
+                              (string-append (assoc-ref inputs "opensm")
+                                             "/include/infiniband/:"
+                                             (getenv "C_INCLUDE_PATH")))
+                      (setenv "CPLUS_INCLUDE_PATH"
+                              (string-append (assoc-ref inputs "opensm")
+                                             "/include/infiniband/:"
+                                             (getenv "CPLUS_INCLUDE_PATH")))
+                      #t))
                   (add-before 'build 'remove-absolute
                     (lambda _
                       ;; Remove compiler absolute file names (OPAL_FC_ABSOLUTE
@@ -244,6 +266,51 @@ software vendors, application developers and computer science researchers.")
     ;; See file://LICENSE
     (license bsd-2)))
 
+;; TODO: javadoc files contain timestamps.
+(define-public java-openmpi
+  (package (inherit openmpi)
+    (name "java-openmpi")
+    (inputs
+     `(("openmpi" ,openmpi)
+       ,@(package-inputs openmpi)))
+    (native-inputs
+     `(("jdk" ,openjdk11 "jdk")
+       ("zip" ,(@ (gnu packages compression) zip))
+       ,@(package-native-inputs openmpi)))
+    (outputs '("out"))
+    (arguments
+     `(#:modules ((guix build gnu-build-system)
+                  ((guix build ant-build-system) #:prefix ant:)
+                  (guix build utils))
+       #:imported-modules ((guix build ant-build-system)
+                           (guix build syscalls)
+                           ,@%gnu-build-system-modules)
+       ,@(substitute-keyword-arguments (package-arguments openmpi)
+           ((#:configure-flags flags)
+            `(cons "--enable-mpi-java" ,flags))
+           ((#:make-flags flags ''())
+            `(append '("-C" "ompi/mpi/java")
+                     ,flags))
+           ((#:phases phases)
+            `(modify-phases ,phases
+               ;; We could provide the location of the JDK in the configure
+               ;; flags, but since the configure flags are embedded in the
+               ;; info binaries that would leave a reference to the JDK in
+               ;; the "out" output.  To avoid this we set JAVA_HOME.
+               (add-after 'unpack 'set-JAVA_HOME
+                 (lambda* (#:key inputs #:allow-other-keys)
+                   (setenv "JAVA_HOME" (assoc-ref inputs "jdk"))
+                   #t))
+               (add-after 'unpack 'link-with-existing-mpi-libraries
+                 (lambda* (#:key inputs #:allow-other-keys)
+                   (substitute* "ompi/mpi/java/c/Makefile.in"
+                     (("\\$\\(top_builddir\\)/ompi/lib@OMPI_LIBMPI_NAME@.la")
+                      (string-append (assoc-ref inputs "openmpi") "/lib/libmpi.la")))
+                   #t))
+               (add-after 'install 'strip-jar-timestamps
+                 (assoc-ref ant:%standard-phases 'strip-jar-timestamps)))))))
+    (synopsis "Java bindings for MPI")))
+
 (define-public openmpi-thread-multiple
   (package
     (inherit openmpi)
@@ -273,14 +340,14 @@ only provides @code{MPI_THREAD_FUNNELED}.")))
 (define-public python-mpi4py
   (package
     (name "python-mpi4py")
-    (version "3.0.0")
+    (version "3.0.1")
     (source
       (origin
         (method url-fetch)
         (uri (pypi-uri "mpi4py" version))
         (sha256
           (base32
-            "1mzgd26dfv4vwbci8gq77ss9f0x26i9aqzq9b9vs9ndxhlnv0mxl"))))
+            "0ld8rjmsjr0dklvj2g1gr3ax32sdq0xjxyh0cspknc1i36waajb5"))))
     (build-system python-build-system)
     (arguments
      `(#:phases