From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Bavier Subject: [PATCH 4/4] gnu: Add superlu-dist package. Date: Sat, 17 May 2014 00:58:22 -0500 Message-ID: <874n0p7xq9.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:33105) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WlXak-0004hH-P1 for guix-devel@gnu.org; Sat, 17 May 2014 01:55:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WlXag-0003sk-9A for guix-devel@gnu.org; Sat, 17 May 2014 01:55:30 -0400 Received: from mail-ig0-x235.google.com ([2607:f8b0:4001:c05::235]:41768) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WlXag-0003sY-0B for guix-devel@gnu.org; Sat, 17 May 2014 01:55:26 -0400 Received: by mail-ig0-f181.google.com with SMTP id h3so1649130igd.8 for ; Fri, 16 May 2014 22:55:25 -0700 (PDT) Received: from cooper.gmail.com (chippewa-nat.cray.com. [136.162.34.1]) by mx.google.com with ESMTPSA id b8sm3324562igx.3.2014.05.16.22.55.24 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 16 May 2014 22:55:24 -0700 (PDT) List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: guix-devel@gnu.org --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0004-gnu-Add-superlu-dist-package.patch >From d288395409ba945ecd0c8533842283080e52bde3 Mon Sep 17 00:00:00 2001 From: Eric Bavier Date: Sat, 17 May 2014 00:44:20 -0500 Subject: [PATCH 4/4] gnu: Add superlu-dist package. * gnu/packages/maths.scm (superlu-dist): New variable. * gnu/packages/patches/superlu-dist-scotchmetis.patch: New patch. * gnu-system.am (dist_patch_DATA): Add it. --- gnu-system.am | 1 + gnu/packages/maths.scm | 102 ++++++++++++++++++++ .../patches/superlu-dist-scotchmetis.patch | 21 ++++ 3 files changed, 124 insertions(+) create mode 100644 gnu/packages/patches/superlu-dist-scotchmetis.patch diff --git a/gnu-system.am b/gnu-system.am index 829c997..3646292 100644 --- a/gnu-system.am +++ b/gnu-system.am @@ -346,6 +346,7 @@ dist_patch_DATA = \ gnu/packages/patches/soprano-find-clucene.patch \ gnu/packages/patches/source-highlight-regexrange-test.patch \ gnu/packages/patches/sqlite-large-page-size-fix.patch \ + gnu/packages/patches/superlu-dist-scotchmetis.patch \ gnu/packages/patches/tcsh-fix-autotest.patch \ gnu/packages/patches/teckit-cstdio.patch \ gnu/packages/patches/valgrind-glibc.patch \ diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm index d9f846e..6cd82fa 100644 --- a/gnu/packages/maths.scm +++ b/gnu/packages/maths.scm @@ -589,6 +589,108 @@ library routines perform an LU decomposition with partial pivoting and triangular system solves through forward and back substitution. The library also provides threshold-based ILU factorization preconditioners.") (license license:bsd-3))) + +(define-public superlu-dist + (package + (name "superlu-dist") + (version "3.3") + (source + (origin + (method url-fetch) + (uri (string-append "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/" + "superlu_dist_" version ".tar.gz")) + (sha256 + (base32 "1hnak09yxxp026blq8zhrl7685yip16svwngh1wysqxf8z48vzfj")) + (patches (list (search-patch "superlu-dist-scotchmetis.patch"))))) + (build-system gnu-build-system) + (native-inputs + `(("tcsh" ,tcsh))) + (inputs + `(("gfortran" ,gfortran-4.8))) + (propagated-inputs + `(("lapack" ,lapack) + ("openmpi" ,openmpi) + ("pt-scotch" ,pt-scotch))) + (arguments + `(#:parallel-build? #f ;race conditions using ar + #:phases + (alist-replace + 'configure + (lambda* (#:key inputs outputs #:allow-other-keys) + (call-with-output-file "make.inc" + (lambda (port) + (format port " +PLAT = +DSuperLUroot = ~a +DSUPERLULIB = ~a/lib/libsuperlu_dist.a +BLASDEF = -DUSE_VENDOR_BLAS +BLASLIB = -L~a/lib -lblas +PARMETISLIB = -L~a/lib \ + -lptscotchparmetis -lptscotch -lptscotcherr -lptscotcherrexit \ + -lscotch -lscotcherr -lscotcherrexit +METISLIB = -L~:*~a/lib \ + -lscotchmetis -lscotch -lscotcherr -lscotcherrexit +LIBS = $(DSUPERLULIB) $(PARMETISLIB) $(METISLIB) $(BLASLIB) +ARCH = ar +ARCHFLAGS = cr +RANLIB = ranlib +CC = mpicc +PIC = -fPIC +CFLAGS = -O3 -g -DPRNTlevel=0 $(PIC) +NOOPTS = -O0 -g $(PIC) +FORTRAN = mpifort +FFLAGS = -O2 -g $(PIC) +LOADER = $(CC) +CDEFS = -DAdd_" + (getcwd) + (assoc-ref outputs "out") + (assoc-ref inputs "lapack") + (assoc-ref inputs "pt-scotch"))))) + (alist-cons-after + 'unpack 'remove-broken-symlinks + (lambda _ + (for-each delete-file + (find-files "MAKE_INC" "\\.#make\\..*"))) + (alist-cons-before + 'build 'create-install-directories + (lambda* (#:key outputs #:allow-other-keys) + (for-each + (lambda (dir) + (mkdir-p (string-append (assoc-ref outputs "out") + "/" dir))) + '("lib" "include"))) + (alist-replace + 'check + (lambda _ + (with-directory-excursion "EXAMPLE" + (and + (zero? (system* "mpirun" "-n" "2" + "./pddrive" "-r" "1" "-c" "2" "g20.rua")) + (zero? (system* "mpirun" "-n" "2" + "./pzdrive" "-r" "1" "-c" "2" "cg20.cua"))))) + (alist-replace + 'install + (lambda* (#:key outputs #:allow-other-keys) + ;; Library is placed in lib during the build phase. Copy over + ;; headers to include. + (let* ((out (assoc-ref outputs "out")) + (incdir (string-append out "/include"))) + (for-each (lambda (file) + (let ((base (basename file))) + (format #t "installing `~a' to `~a'~%" + base incdir) + (copy-file file + (string-append incdir "/" base)))) + (find-files "SRC" ".*\\.h$")))) + %standard-phases))))))) + (home-page (package-home-page superlu)) + (synopsis "Parallel supernodal direct solver") + (description + "SuperLU_DIST is a parallel extension to the serial SuperLU library. +It is targeted for distributed memory parallel machines. SuperLU_DIST is +implemented in ANSI C, and MPI for communications.") + (license license:bsd-3))) + (define-public scotch (package (name "scotch") diff --git a/gnu/packages/patches/superlu-dist-scotchmetis.patch b/gnu/packages/patches/superlu-dist-scotchmetis.patch new file mode 100644 index 0000000..3d78380 --- /dev/null +++ b/gnu/packages/patches/superlu-dist-scotchmetis.patch @@ -0,0 +1,21 @@ +The METIS interface from Scotch may segfault if passed NULL to indicate a +default parameter, so use the older calling style. + +--- a/SRC/get_perm_c.c 2014-05-16 23:38:30.070835316 -0500 ++++ b/SRC/get_perm_c.c 2014-05-16 23:39:04.582836211 -0500 +@@ -70,11 +70,13 @@ + #else + + /* Earlier version 3.x.x */ +- /* METIS_NodeND(&nm, b_colptr, b_rowind, &numflag, metis_options, +- perm, iperm);*/ ++ METIS_NodeND(&nm, b_colptr, b_rowind, &numflag, metis_options, ++ perm, iperm); + + /* Latest version 4.x.x */ ++#if 0 + METIS_NodeND(&nm, b_colptr, b_rowind, NULL, NULL, perm, iperm); ++#endif + + /*check_perm_dist("metis perm", n, perm);*/ + #endif -- 1.7.9.5 --=-=-= -- Eric Bavier Please avoid sending me Word or PowerPoint attachments. See http://www.gnu.org/philosophy/no-word-attachments.html --=-=-=--