From: Eric Bavier <ericbavier@gmail.com>
To: guix-devel@gnu.org
Subject: [PATCH 4/4] gnu: Add superlu-dist package.
Date: Sat, 17 May 2014 00:58:22 -0500 [thread overview]
Message-ID: <874n0p7xq9.fsf@gmail.com> (raw)
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: 0004-gnu-Add-superlu-dist-package.patch --]
[-- Type: text/x-diff, Size: 6638 bytes --]
From d288395409ba945ecd0c8533842283080e52bde3 Mon Sep 17 00:00:00 2001
From: Eric Bavier <bavier@member.fsf.org>
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
[-- Attachment #2: Type: text/plain, Size: 133 bytes --]
--
Eric Bavier
Please avoid sending me Word or PowerPoint attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html
next reply other threads:[~2014-05-17 5:55 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-17 5:58 Eric Bavier [this message]
2014-05-17 10:45 ` [PATCH 4/4] gnu: Add superlu-dist package Ludovic Courtès
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=874n0p7xq9.fsf@gmail.com \
--to=ericbavier@gmail.com \
--cc=guix-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.