From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([209.51.188.92]:58459) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1qzS-0007bI-P5 for guix-patches@gnu.org; Thu, 07 Mar 2019 06:15:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h1qzP-0000Mp-S8 for guix-patches@gnu.org; Thu, 07 Mar 2019 06:15:06 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:49685) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h1qzO-0000Kt-9o for guix-patches@gnu.org; Thu, 07 Mar 2019 06:15:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1h1qzN-0001nw-Vd for guix-patches@gnu.org; Thu, 07 Mar 2019 06:15:01 -0500 Subject: [bug#34780] [PATCH] gnu: openmpi: Add Java support. References: <877edbufh8.fsf@mdc-berlin.de> In-Reply-To: <877edbufh8.fsf@mdc-berlin.de> Resent-Message-ID: From: Ricardo Wurmus Message-ID: <20190307111422.12381-1-rekado@elephly.net> Date: Thu, 7 Mar 2019 12:14:22 +0100 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf8 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 34780@debbugs.gnu.org Cc: ericbavier@centurylink.net * gnu/packages/mpi.scm (openmpi)[native-inputs]: Add openjdk11. [outputs]: Add "java". [arguments]: Add "--enable-mpi-java" to configure flags; add build phases "set-JAVA_HOME" and "move-java". --- gnu/packages/mpi.scm | 36 ++++++++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/gnu/packages/mpi.scm b/gnu/packages/mpi.scm index 10de6dee5b..316b2a5cd8 100644 --- a/gnu/packages/mpi.scm +++ b/gnu/packages/mpi.scm @@ -35,6 +35,7 @@ #: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) @@ -190,8 +191,9 @@ bind processes, and much more.") ("slurm" ,slurm))) ;for PMI support (launching via "sr= un") (native-inputs `(("pkg-config" ,pkg-config) - ("perl" ,perl))) - (outputs '("out" "debug")) + ("perl" ,perl) + ("jdk" ,openjdk11 "jdk"))) + (outputs '("out" "debug" "java")) (arguments `(#:configure-flags `("--enable-mpi-ext=3Daffinity" ;cr doesn't work "--enable-memchecker" @@ -200,6 +202,8 @@ bind processes, and much more.") "--with-hwloc=3Dexternal" "--with-libevent" =20 + "--enable-mpi-java" + ;; InfiniBand support "--enable-openib-control-hdr-padding" "--enable-openib-dynamic-sl" @@ -224,6 +228,14 @@ bind processes, and much more.") "/include/infiniband/:" (getenv "CPLUS_INCLUDE_PATH")= )) #t)) + ;; We could provide the location of the JDK in the confi= gure + ;; 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-before 'build 'remove-absolute (lambda _ ;; Remove compiler absolute file names (OPAL_FC_ABSO= LUTE @@ -252,6 +264,26 @@ bind processes, and much more.") (lambda* (#:key outputs #:allow-other-keys) (let ((out (assoc-ref outputs "out"))) (for-each delete-file (find-files out "config.log"= )) + #t))) + (add-after 'install 'move-java + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out")) + (java (assoc-ref outputs "java"))) + (for-each (lambda (item) + (let ((source (string-append out item)= ) + (target (string-append java item= ))) + (mkdir-p (dirname target)) + (rename-file source target))) + '("/share/man/man1/mpijavac.1" + "/share/doc/openmpi/javadoc-openmpi" + "/lib/mpi.jar" + "/lib/libmpi_java.la" + "/lib/libmpi_java.so.40.20.0" + "/lib/libmpi_java.so.40" + "/lib/libmpi_java.so" + "/bin/mpijavac.pl" + "/bin/mpijavac" + "/include/openmpi/ompi/mpi/java")) #t)))))) (home-page "http://www.open-mpi.org") (synopsis "MPI-3 implementation") --=20 2.20.1