[PATCH 12/14] gnu: Add arpack-ng-openmpi.

2015-06-27 Thread ericbavier
From: Eric Bavier 

* gnu/packages/maths.scm (arpack-ng-openmpi): New variable.
---
 gnu/packages/maths.scm | 9 +
 1 file changed, 9 insertions(+)

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index a6c4bba..343b56c 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -274,6 +274,15 @@ large scale eigenvalue problems.")
 (license (license:non-copyleft "file://COPYING"
 "See COPYING in the distribution."
 
+(define-public arpack-ng-openmpi
+  (package (inherit arpack-ng)
+(name "arpack-ng-openmpi")
+(inputs
+ `(("mpi" ,openmpi)
+   ,@(package-inputs arpack-ng)))
+(arguments `(#:configure-flags '("--enable-mpi")))
+(synopsis "Fortran subroutines for solving eigenvalue problems with MPI")))
+
 (define-public lapack
   (package
 (name "lapack")
-- 
2.2.1




[PATCH 11/14] gnu: petsc: Upgrade to 3.6.0.

2015-06-27 Thread ericbavier
From: Eric Bavier 

* gnu/packages/maths.scm (petsc): Upgrade to 3.6.0.
* gnu/packages/patches/petsc-fix-threadcomm.patch: Delete patch.
* gnu-system.am (dist_patch_DATA): Remove it.
---
 gnu-system.am   |  1 -
 gnu/packages/maths.scm  | 26 ++---
 gnu/packages/patches/petsc-fix-threadcomm.patch | 15 --
 3 files changed, 10 insertions(+), 32 deletions(-)
 delete mode 100644 gnu/packages/patches/petsc-fix-threadcomm.patch

diff --git a/gnu-system.am b/gnu-system.am
index af2c0eb..16b71e9 100644
--- a/gnu-system.am
+++ b/gnu-system.am
@@ -544,7 +544,6 @@ dist_patch_DATA =   
\
   gnu/packages/patches/perl-net-ssleay-disable-ede-test.patch  \
   gnu/packages/patches/perl-no-sys-dirs.patch  \
   gnu/packages/patches/perl-tk-x11-discover.patch  \
-  gnu/packages/patches/petsc-fix-threadcomm.patch  \
   gnu/packages/patches/pingus-sdl-libs-config.patch\
   gnu/packages/patches/plotutils-libpng-jmpbuf.patch   \
   gnu/packages/patches/polkit-drop-test.patch  \
diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 369457d..a6c4bba 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -501,7 +501,7 @@ ASCII text files using Gmsh's own scripting language.")
 (define-public petsc
   (package
 (name "petsc")
-(version "3.4.4")
+(version "3.6.0")
 (source
  (origin
   (method url-fetch)
@@ -509,9 +509,7 @@ ASCII text files using Gmsh's own scripting language.")
   (uri (string-append "http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/";
   "petsc-lite-" version ".tar.gz"))
   (sha256
-   (base32 "0v5dg6dhdjpi5ianvd4mm6hsvxzv1bsxwnh9f9myag0a0d9xk9iv"))
-  (patches
-   (list (search-patch "petsc-fix-threadcomm.patch")
+   (base32 "0lzhk1flgszks1wlhz2b92rnlx5np7bgad8vqy9fcqziz5b4pr26"
 (build-system gnu-build-system)
 (native-inputs
  `(("python" ,python-2)
@@ -525,7 +523,7 @@ ASCII text files using Gmsh's own scripting language.")
))
 (arguments
  `(#:test-target "test"
-   #:parallel-build? #f
+   #:parallel-build? #f ;build is parallel by default
#:configure-flags
`("--with-mpi=0"
  "--with-openmp=1"
@@ -561,26 +559,22 @@ ASCII text files using Gmsh's own scripting language.")
 (let ((out (assoc-ref outputs "out"))
   (fortran (assoc-ref inputs  "gfortran")))
   (substitute* (map (lambda (file)
-  (string-append out "/" file))
-'("conf/petscvariables"
-  "conf/PETScConfig.cmake"))
+  (string-append out "/lib/petsc/conf/" file))
+'("petscvariables" "PETScConfig.cmake"))
 (((getcwd)) out))
   ;; Make compiler references point to the store
-  (substitute* (string-append out "/conf/petscvariables")
+  (substitute* (string-append out "/lib/petsc/conf/petscvariables")
 (("= g(cc|\\+\\+|fortran)" _ suffix)
  (string-append "= " fortran "/bin/g" suffix)))
   ;; PETSc installs some build logs, which aren't necessary.
   (for-each (lambda (file)
-  (let ((f (string-append out "/" file)))
+  (let ((f (string-append out "/lib/petsc/conf/" 
file)))
 (when (file-exists? f)
   (delete-file f
-'("conf/configure.log"
-  "conf/make.log"
-  "conf/test.log"
-  "conf/error.log"
-  "conf/RDict.db"
+'("configure.log" "make.log" "gmake.log"
+  "test.log" "error.log" "RDict.db"
   ;; Once installed, should uninstall with Guix
-  "conf/uninstall.py"
+  "uninstall.py"
   %standard-phases)
 (home-page "http://www.mcs.anl.gov/petsc";)
 (synopsis "Library to solve PDEs")
diff --git a/gnu/packages/patches/petsc-fix-threadcomm.patch 
b/gnu/packages/patches/petsc-fix-threadcomm.patch
deleted file mode 100644
index 3ef4f2d..000
--- a/gnu/packages/patches/petsc-fix-threadcomm.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-Fix "error: unknown type name 'cpu_set_t'".  Patch submitted upstream
-http://lists.mcs.anl.gov/pipermail/petsc-dev/2014-May/015345.html
-
 a/src/sys/threadcomm/impls/openmp/tcopenmp.c   2014-03-13 
21:47:22.0 -0500
-+++ b/src/sys/threadcomm/impls/openmp/tcopenmp.c   2014-04-02 
14:44:57.185170151 -0500
-@@ -1,6 +1,9 @@
- #define PETSC_DESIRE_FEATURE_TEST_MACROS
- #inclu

[PATCH 10/14] gnu: Add MUMPS.

2015-06-27 Thread ericbavier
From: Eric Bavier 

* gnu/packages/maths.scm (mumps, mumps-metis, mumps-openmpi)
  (mumps-metis-openmpi): New variables.
* gnu/packages/patches/mumps-build-parallelism.patch: New patch.
* gnu-system.am (dist_patch_DATA): Add it.
---
 gnu-system.am  |   1 +
 gnu/packages/maths.scm | 165 +
 gnu/packages/patches/mumps-build-parallelism.patch |  13 ++
 3 files changed, 179 insertions(+)
 create mode 100644 gnu/packages/patches/mumps-build-parallelism.patch

diff --git a/gnu-system.am b/gnu-system.am
index 0c9a2eb..af2c0eb 100644
--- a/gnu-system.am
+++ b/gnu-system.am
@@ -518,6 +518,7 @@ dist_patch_DATA =   
\
   gnu/packages/patches/mpc123-initialize-ao.patch  \
   gnu/packages/patches/mplayer2-theora-fix.patch   \
   gnu/packages/patches/module-init-tools-moduledir.patch   \
+  gnu/packages/patches/mumps-build-parallelism.patch   \
   gnu/packages/patches/mupdf-buildsystem-fix.patch \
   gnu/packages/patches/mutt-CVE-2014-9116.patch\
   gnu/packages/patches/net-tools-bitrot.patch  \
diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index bc13fd5..369457d 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -32,6 +32,7 @@
   #:use-module (guix download)
   #:use-module (guix svn-download)
   #:use-module (guix utils)
+  #:use-module (guix build utils)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system gnu)
   #:use-module (gnu packages algebra)
@@ -628,6 +629,170 @@ scientific applications modeled by partial differential 
equations.")
,@(delete "--with-mpi=0" ,cf)
 (synopsis "Library to solve PDEs (with complex scalars and MPI support)")))
 
+(define-public mumps
+  (package
+(name "mumps")
+(version "5.0.0")
+(source
+ (origin
+   (method url-fetch)
+   (uri (string-append "http://mumps.enseeiht.fr/MUMPS_";
+   version ".tar.gz"))
+   (sha256
+(base32
+ "0690yp73sqk8zn2jnrzdr5swnjdyd7j0774s4xamjjwcxarw87hr"))
+   (patches (list (search-patch "mumps-build-parallelism.patch")
+(build-system gnu-build-system)
+(inputs
+ `(("fortran" ,gfortran)
+   ;; These are required for linking against mumps, but we let the user
+   ;; declare the dependency.
+   ("blas" ,openblas)
+   ("metis" ,metis)
+   ("scotch" ,scotch)))
+(arguments
+ `(#:modules ((ice-9 match)
+  (guix build gnu-build-system)
+  (guix build utils))
+   #:phases
+   (modify-phases %standard-phases
+ (replace
+  'configure
+  (lambda* (#:key inputs #:allow-other-keys)
+(call-with-output-file "Makefile.inc"
+  (lambda (port)
+(format port "
+PLAT =
+LIBEXT   = .a
+OUTC = -o
+OUTF = -o
+RM   = rm -f~:[
+CC   = gcc
+FC   = gfortran
+FL   = gfortran
+INCSEQ   = -I$(topdir)/libseq
+LIBSEQ   = -L$(topdir)/libseq -lmpiseq
+LIBSEQNEEDED = libseqneeded~;
+CC   = mpicc
+FC   = mpifort
+FL   = mpifort~]
+AR   = ar vr # rules require trailing space, ugh...
+RANLIB   = ranlib
+LIBBLAS  = -L~a -lopenblas~@[
+SCALAP   = -L~a -lscalapack~]
+LIBOTHERS= -pthread
+CDEFS= -DAdd_
+PIC  = -fPIC
+OPTF = -O2 -DALLOW_NON_INIT $(PIC)
+OPTL = -O2 $(PIC)
+OPTC = -O2 $(PIC)
+INCS = $(INCSEQ)
+LIBS = $(SCALAP) $(LIBSEQ)
+LPORDDIR = $(topdir)/PORD/lib
+IPORD= -I$(topdir)/PORD/include
+LPORD= -L$(LPORDDIR) -lpord
+ORDERINGSF   = -Dpord~@[
+METISDIR = ~a
+IMETIS   = -I$(METISDIR)/include
+LMETIS   = -L$(METISDIR)/lib -lmetis
+ORDERINGSF  += -Dmetis~]~@[~:{
+SCOTCHDIR= ~a
+ISCOTCH  = -I$(SCOTCHDIR)/include
+LSCOTCH  = -L$(SCOTCHDIR)/lib ~a-lesmumps -lscotch -lscotcherr
+ORDERINGSF  += ~a~}~]
+ORDERINGSC   = $(ORDERINGSF)
+LORDERINGS   = $(LPORD) $(LMETIS) $(LSCOTCH)
+IORDERINGSF  = $(ISCOTCH)
+IORDERINGSC  = $(IPORD) $(IMETIS) $(ISCOTCH)"
+(assoc-ref inputs "mpi")
+(assoc-ref inputs "blas")
+(assoc-ref inputs "scalapack")
+(assoc-ref inputs "metis")
+(match (list (assoc-ref inputs "pt-scotch")
+ (assoc-ref inputs "scotch"))
+  ((#f #f)
+   #f)
+  ((#f scotch)
+   `((,scotch "" "-Dscotch")))
+  ((ptscotch _)
+   `((,ptscotch
+  "-lptesmumps -lptscotch -lptscotcherr "
+  "-Dptscotch")
+ (replace
+  'build
+   

[PATCH 08/14] gnu: Add p4est.

2015-06-27 Thread ericbavier
From: Eric Bavier 

* gnu/packages/maths.scm (p4est, p4est-openmpi): New variables.
---
 gnu/packages/maths.scm | 46 ++
 1 file changed, 46 insertions(+)

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index b67ae9c..3852311 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -928,6 +928,52 @@ bio-chemistry.")
 (lambda _ (zero? (system* "make" "ptcheck"
 (synopsis "Programs and libraries for graph algorithms (with MPI)")))
 
+(define-public p4est
+  (package
+(name "p4est")
+(version "1.1")
+(source
+ (origin
+   (method url-fetch)
+   (uri (string-append "http://p4est.github.io/release/p4est-";
+   version ".tar.gz"))
+   (sha256
+(base32
+ "0faina2h5qsx3m2izbzaj9bbakma1krbbjmq43wrp1hcbyijflqb"
+(build-system gnu-build-system)
+(inputs
+ `(("fortran" ,gfortran)
+   ("blas" ,openblas)
+   ("lapack" ,lapack)
+   ("zlib" ,zlib)))
+(arguments
+ `(#:configure-flags `(,(string-append "BLAS_LIBS=-L"
+   (assoc-ref %build-inputs "blas")
+   " -lopenblas")
+   ,(string-append "LAPACK_LIBS=-L"
+   (assoc-ref %build-inputs "lapack")
+   " -llapack"
+(home-page "http://www.p4est.org";)
+(synopsis "AMR on Forests of Octrees")
+(description
+ "The p4est software library enables the dynamic management of a
+collection of adaptive octrees, conveniently called a forest of octrees.
+p4est is designed to work in parallel and scales to hundreds of thousands of
+processor cores.")
+(license license:gpl2+)))
+
+(define-public p4est-openmpi
+  (package (inherit p4est)
+(name "p4est-openmpi")
+(inputs
+ `(("mpi" ,openmpi)
+   ,@(package-inputs p4est)))
+(arguments
+ (substitute-keyword-arguments (package-arguments p4est)
+   ((#:configure-flags cf)
+``("--enable-mpi" ,@,cf
+(synopsis "Parallel AMR on Forests of Octrees")))
+
 (define-public gsegrafix
   (package
 (name "gsegrafix")
-- 
2.2.1




[PATCH 09/14] gnu: Add METIS.

2015-06-27 Thread ericbavier
From: Eric Bavier 

* gnu/packages/maths.scm (metis): New variable.
---
 gnu/packages/maths.scm | 30 ++
 1 file changed, 30 insertions(+)

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 3852311..bc13fd5 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -928,6 +928,36 @@ bio-chemistry.")
 (lambda _ (zero? (system* "make" "ptcheck"
 (synopsis "Programs and libraries for graph algorithms (with MPI)")))
 
+(define-public metis
+  (package
+(name "metis")
+(version "5.1.0")
+(source
+ (origin
+   (method url-fetch)
+   (uri (string-append "http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/";
+   "metis-" version ".tar.gz"))
+   (sha256
+(base32
+ "1cjxgh41r8k6j029yxs8msp3z6lcnpm16g5pvckk35kc7zhfpykn"
+(build-system cmake-build-system)
+(inputs
+ `(("blas" ,openblas)))
+(arguments
+ `(#:tests? #f  ;no tests
+   #:configure-flags `("-DSHARED=ON"
+   ,(string-append "-DGKLIB_PATH=" (getcwd)
+   "/metis-" ,version "/GKlib"
+(home-page "http://glaros.dtc.umn.edu/gkhome/metis/metis/overview";)
+(synopsis "Graph partitioning and fill-reducing matrix ordering library")
+(description
+ "METIS is a set of serial programs for partitioning graphs, partitioning
+finite element meshes, and producing fill-reducing orderings for sparse
+matrices.  The algorithms implemented in METIS are based on the multilevel
+recursive-bisection, multilevel k-way, and multi-constraint partitioning
+schemes.")
+(license license:asl2.0)))  ;As of version 5.0.3
+
 (define-public p4est
   (package
 (name "p4est")
-- 
2.2.1




[PATCH 14/14] gnu: Add deal.II.

2015-06-27 Thread ericbavier
From: Eric Bavier 

* gnu/packages/maths.scm (deal.II, deal.II-openmpi): New variables.
* gnu/packages/patches/deal.II-p4est-interface.patch: New patch.
* gnu-system.am (dist_patch_DATA): Add it.
---
 gnu-system.am  |  1 +
 gnu/packages/maths.scm | 84 +-
 gnu/packages/patches/deal.II-p4est-interface.patch | 62 
 3 files changed, 146 insertions(+), 1 deletion(-)
 create mode 100644 gnu/packages/patches/deal.II-p4est-interface.patch

diff --git a/gnu-system.am b/gnu-system.am
index 16b71e9..3eb9f54 100644
--- a/gnu-system.am
+++ b/gnu-system.am
@@ -412,6 +412,7 @@ dist_patch_DATA =   
\
   gnu/packages/patches/clucene-contribs-lib.patch   \
   gnu/packages/patches/cursynth-wave-rand.patch\
   gnu/packages/patches/dbus-localstatedir.patch\
+  gnu/packages/patches/deal.II-p4est-interface.patch   \
   gnu/packages/patches/diffutils-gets-undeclared.patch \
   gnu/packages/patches/dfu-programmer-fix-libusb.patch \
   gnu/packages/patches/doxygen-test.patch  \
diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index ff3a048..e2c7d89 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -37,6 +37,7 @@
   #:use-module (guix build-system gnu)
   #:use-module (gnu packages algebra)
   #:use-module (gnu packages bison)
+  #:use-module (gnu packages boost)
   #:use-module (gnu packages check)
   #:use-module (gnu packages cmake)
   #:use-module (gnu packages compression)
@@ -72,7 +73,8 @@
   #:use-module (gnu packages texlive)
   #:use-module (gnu packages wxwidgets)
   #:use-module (gnu packages xml)
-  #:use-module (gnu packages zip))
+  #:use-module (gnu packages zip)
+  #:use-module (srfi srfi-1))
 
 (define-public units
   (package
@@ -1842,3 +1844,83 @@ specifications.")
  "lp_solve is a mixed integer linear programming solver based on the
 revised simplex and the branch-and-bound methods.")
 (license license:lgpl2.1+)))
+
+(define-public deal.II
+  (package
+(name "deal.II")
+(version "8.2.1")
+(source
+ (origin
+   (method url-fetch)
+   (uri (string-append "https://github.com/dealii/dealii/releases/";
+   "download/v" version "/dealii-" version ".tar.gz"))
+   (sha256
+(base32
+ "185jych0gdnpkjwxni7pd0dda149492zwq2457xdjg76bzj78mnp"))
+   (patches (list (search-patch "deal.II-p4est-interface.patch")))
+   (modules '((guix build utils)))
+   (snippet
+;; Remove bundled sources: UMFPACK, TBB, muParser, and boost
+'(delete-file-recursively "bundled"
+(build-system cmake-build-system)
+(inputs
+ `(("tbb" ,tbb)
+   ("zlib" ,zlib)
+   ("boost" ,boost)
+   ("p4est" ,p4est)
+   ("blas" ,openblas)
+   ("lapack" ,lapack)
+   ("arpack" ,arpack-ng)
+   ("muparser" ,muparser)
+   ("gfortran" ,gfortran)
+   ("suitesparse" ,suitesparse)))   ;for UMFPACK
+(arguments
+ `(#:build-type "DebugRelease" ;only supports Release, Debug, or 
DebugRelease
+   #:configure-flags '("-DCOMPAT_FILES=OFF") ;Follow new directory 
structure
+   #:phases (modify-phases %standard-phases
+  (add-after
+   'install 'hint-example-prefix
+   ;; Set Cmake hints in examples so that they can find this
+   ;; deal.II when configuring.
+   (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((out (assoc-ref %outputs "out"))
+(exmpl (string-append out "/share/doc"
+  "/deal.II/examples")))
+   (substitute* (find-files exmpl "CMakeLists.txt")
+ (("([[:space:]]*HINTS.*)\n" _ line)
+  (string-append line " $ENV{HOME}/.guix-profile "
+ out "\n")))
+   #t))
+(home-page "https://www.dealii.org";)
+(synopsis "Finite element library")
+(description
+ "Deal.II is a C++ program library targeted at the computational solution
+of partial differential equations using adaptive finite elements.  The main
+aim of deal.II is to enable rapid development of modern finite element codes,
+using among other aspects adaptive meshes and a wide array of tools often used
+in finite element programs.")
+(license license:lgpl2.1+)))
+
+(define-public deal.II-openmpi
+  (package (inherit deal.II)
+(name "deal.II-openmpi")
+(inputs
+ `(("mpi" ,openmpi)
+   ;;Supported only with MPI:
+   ("p4est" ,p4est-openmpi)
+   ("petsc" ,petsc-openmpi)
+   ("slepc" ,slepc-openmpi)
+   ("metis" ,metis)   ;for MUMPS
+   ("scalapack" ,scalapack)   ;for MUMPS
+   ("mumps" ,mumps-metis-openmpi) ;

[PATCH 05/14] gnu: scotch, pt-scotch: Use modify-phases.

2015-06-27 Thread ericbavier
From: Eric Bavier 

* gnu/packages/maths.scm (scotch, pt-scotch)[arguments]: Use modify-phases.
---
 gnu/packages/maths.scm | 70 ++
 1 file changed, 31 insertions(+), 39 deletions(-)

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index e4fe03b..a3611cf 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -802,15 +802,16 @@ implemented in ANSI C, and MPI for communications.")
("bison" ,bison)))
 (arguments
  `(#:phases
-   (alist-cons-after
-'unpack 'chdir-to-src
-(lambda _ (chdir "src"))
-(alist-replace
- 'configure
- (lambda _
-   (call-with-output-file "Makefile.inc"
- (lambda (port)
-   (format port "
+   (modify-phases %standard-phases
+ (add-after
+  'unpack 'chdir-to-src
+  (lambda _ (chdir "src")))
+ (replace
+  'configure
+  (lambda _
+(call-with-output-file "Makefile.inc"
+  (lambda (port)
+(format port "
 EXE =
 LIB = .a
 OBJ = .o
@@ -831,22 +832,21 @@ MV = mv
 RANLIB = ranlib
 YACC = bison -pscotchyy -y -b y
 "
-   '("COMMON_FILE_COMPRESS_GZ"
- "COMMON_PTHREAD"
- "COMMON_RANDOM_FIXED_SEED"
- ;; XXX: Causes invalid frees in superlu-dist tests
- ;; "SCOTCH_PTHREAD"
- ;; "SCOTCH_PTHREAD_NUMBER=2"
- "restrict=__restrict")
- (alist-replace
+'("COMMON_FILE_COMPRESS_GZ"
+  "COMMON_PTHREAD"
+  "COMMON_RANDOM_FIXED_SEED"
+  ;; XXX: Causes invalid frees in superlu-dist tests
+  ;; "SCOTCH_PTHREAD"
+  ;; "SCOTCH_PTHREAD_NUMBER=2"
+  "restrict=__restrict"))
+ (replace
   'install
   (lambda* (#:key outputs #:allow-other-keys)
 (let ((out (assoc-ref outputs "out")))
   (mkdir out)
   (zero? (system* "make"
   (string-append "prefix=" out)
-  "install"
-  %standard-phases)
+  "install"
 (home-page "http://www.labri.fr/perso/pelegrin/scotch/";)
 (synopsis "Programs and libraries for graph algorithms")
 (description "SCOTCH is a set of programs and libraries which implement
@@ -867,26 +867,18 @@ bio-chemistry.")
 (arguments
  (substitute-keyword-arguments (package-arguments scotch)
((#:phases scotch-phases)
-`(alist-replace
-  'build
-  ;; TODO: Would like to add parallelism here
-  (lambda _
-(and
- (zero? (system* "make" "ptscotch"))
- ;; Install the serial metis compatibility library
- (zero? (system* "make" "-C" "libscotchmetis" "install"
-  (alist-replace
-   'check
-   (lambda _ (zero? (system* "make" "ptcheck")))
-   (alist-replace
-'install
-(lambda* (#:key outputs #:allow-other-keys)
-  (let ((out (assoc-ref outputs "out")))
-(mkdir out)
-(zero? (system* "make"
-(string-append "prefix=" out)
-"install"
-,scotch-phases))
+`(modify-phases ,scotch-phases
+   (replace
+'build
+;; TODO: Would like to add parallelism here
+(lambda _
+  (and
+   (zero? (system* "make" "ptscotch"))
+   ;; Install the serial metis compatibility library
+   (zero? (system* "make" "-C" "libscotchmetis" "install")
+   (replace
+'check
+(lambda _ (zero? (system* "make" "ptcheck"
 (synopsis "Programs and libraries for graph algorithms (with MPI)")))
 
 (define-public gsegrafix
-- 
2.2.1




[PATCH 07/14] gnu: Add ScaLAPACK.

2015-06-27 Thread ericbavier
From: Eric Bavier 

* gnu/packages/maths.scm (scalapack): New variable.
---
 gnu/packages/maths.scm | 29 +
 1 file changed, 29 insertions(+)

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 765a111..b67ae9c 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -305,6 +305,35 @@ problems in numerical linear algebra.")
 (license (license:non-copyleft "file://LICENSE"
 "See LICENSE in the distribution."
 
+(define-public scalapack
+  (package
+(name "scalapack")
+(version "2.0.2")
+(source
+ (origin
+   (method url-fetch)
+   (uri (string-append "http://www.netlib.org/scalapack/scalapack-";
+   version ".tgz"))
+   (sha256
+(base32
+ "0p1r61ss1fq0bs8ynnx7xq4wwsdvs32ljvwjnx6yxr8gd6pawx0c"
+(build-system cmake-build-system)
+(inputs
+ `(("mpi" ,openmpi)
+   ("fortran" ,gfortran)
+   ("lapack" ,lapack))) ;for testing only
+(arguments
+ `(#:configure-flags `("-DBUILD_SHARED_LIBS:BOOL=YES")))
+(home-page "http://www.netlib.org/scalapack/";)
+(synopsis "Library for scalable numerical linear algebra")
+(description
+ "ScaLAPACK is a Fortran 90 library of high-performance linear algebra
+routines on parallel distributed memory machines.  ScaLAPACK solves dense and
+banded linear systems, least squares problems, eigenvalue problems, and
+singular value problems.")
+(license (license:bsd-style "file://LICENSE"
+"See LICENSE in the distribution."
+
 (define-public gnuplot
   (package
 (name "gnuplot")
-- 
2.2.1




[PATCH 06/14] gnu: scotch, pt-scotch: Build esmumps libraries.

2015-06-27 Thread ericbavier
From: Eric Bavier 

* gnu/packages/maths.scm (scotch)[arguments]: Add 'build-esmumps
  phase.  Install esmumps libraries and headers in 'install phase.
  (pt-scotch)[arguments]: Build ptesmumps in 'build phase.  Add
  make parallelism.
---
 gnu/packages/maths.scm | 22 --
 1 file changed, 20 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index a3611cf..765a111 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -818,6 +818,7 @@ OBJ = .o
 MAKE = make
 AR = ar
 ARFLAGS = -ruv
+CAT = cat
 CCS = gcc
 CCP = mpicc
 CCD = gcc
@@ -835,10 +836,18 @@ YACC = bison -pscotchyy -y -b y
 '("COMMON_FILE_COMPRESS_GZ"
   "COMMON_PTHREAD"
   "COMMON_RANDOM_FIXED_SEED"
+  ;; Prevents symbolc clashes with libesmumps
+  "SCOTCH_RENAME"
   ;; XXX: Causes invalid frees in superlu-dist tests
   ;; "SCOTCH_PTHREAD"
   ;; "SCOTCH_PTHREAD_NUMBER=2"
   "restrict=__restrict"))
+ (add-after
+  'build 'build-esmumps
+  (lambda _
+(zero? (system* "make"
+(format #f "-j~a" (current-processor-count))
+"esmumps"
  (replace
   'install
   (lambda* (#:key outputs #:allow-other-keys)
@@ -846,7 +855,14 @@ YACC = bison -pscotchyy -y -b y
   (mkdir out)
   (zero? (system* "make"
   (string-append "prefix=" out)
-  "install"
+  "install"))
+  ;; esmumps files are not installed with the above
+  (for-each (lambda (f)
+  (copy-file f (string-append out "/include/" f)))
+(find-files "../include" ".*esmumps.h$"))
+  (for-each (lambda (f)
+  (copy-file f (string-append out "/lib/" f)))
+(find-files "../lib" "^lib.*esmumps.*"
 (home-page "http://www.labri.fr/perso/pelegrin/scotch/";)
 (synopsis "Programs and libraries for graph algorithms")
 (description "SCOTCH is a set of programs and libraries which implement
@@ -873,7 +889,9 @@ bio-chemistry.")
 ;; TODO: Would like to add parallelism here
 (lambda _
   (and
-   (zero? (system* "make" "ptscotch"))
+   (zero? (system* "make"
+   (format #f "-j~a" (current-processor-count))
+   "ptscotch" "ptesmumps"))
;; Install the serial metis compatibility library
(zero? (system* "make" "-C" "libscotchmetis" "install")
(replace
-- 
2.2.1




[PATCH 13/14] gnu: Add SLEPc.

2015-06-27 Thread ericbavier
From: Eric Bavier 

* gnu/packages/maths.scm (slepc, slepc-complex, slepc-openmpi)
  (slepc-complex-openmpi): New variables.
---
 gnu/packages/maths.scm | 98 ++
 1 file changed, 98 insertions(+)

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 343b56c..ff3a048 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -632,6 +632,104 @@ scientific applications modeled by partial differential 
equations.")
,@(delete "--with-mpi=0" ,cf)
 (synopsis "Library to solve PDEs (with complex scalars and MPI support)")))
 
+(define-public slepc
+  (package
+(name "slepc")
+(version "3.6.0")
+(source
+ (origin
+   (method url-fetch)
+   (uri (string-append "http://slepc.upv.es/download/download.php?";
+   "filename=slepc-" version ".tar.gz"))
+   (sha256
+(base32
+ "1ij8w864spzk4cq2mmkssqyj0mbckkkvxm0wpw9gywy2jgbj07jr"
+(build-system gnu-build-system)
+(native-inputs
+ `(("python" ,python-2)))
+(inputs
+ `(("arpack" ,arpack-ng)
+   ("gfortran" ,gfortran)))
+(propagated-inputs
+ `(("petsc" ,petsc)))
+(arguments
+ `(#:parallel-build? #f ;build is parallel by default
+   #:configure-flags
+   `(,(string-append "--with-arpack-dir="
+ (assoc-ref %build-inputs "arpack")))
+   #:phases
+   (modify-phases %standard-phases
+ (replace
+  'configure
+  ;; configure is a python script, so we can't run it with bash.
+  (lambda* (#:key inputs outputs (configure-flags '())
+#:allow-other-keys)
+(let* ((prefix (assoc-ref outputs "out"))
+   (flags `(,(string-append "--prefix=" prefix)
+,@configure-flags)))
+  (format #t "build directory: ~s~%" (getcwd))
+  (format #t "configure flags: ~s~%" flags)
+  (setenv "SLEPC_DIR" (getcwd))
+  (setenv "PETSC_DIR" (assoc-ref %build-inputs "petsc"))
+  (zero? (apply system* "./configure" flags)
+ (add-after
+  'install 'delete-doc
+  ;; SLEPc installs polluting HTML documentation alongside headers in
+  ;; $out/include.  Delete these, as users can browse them online.
+  (lambda* (#:key outputs #:allow-other-keys)
+(let* ((out (assoc-ref outputs "out")))
+  (for-each delete-file (find-files out "\\.html$")
+ (add-after
+  'install 'clean-install
+  ;; Clean up unnecessary build logs from installation.
+  (lambda* (#:key outputs #:allow-other-keys)
+(let ((out (assoc-ref outputs "out")))
+  (for-each (lambda (file)
+  (let ((f (string-append out "/lib/slepc/conf/" 
file)))
+(when (file-exists? f)
+  (delete-file f
+'("configure.log" "make.log" "gmake.log"
+  "test.log" "error.log" "RDict.db"
+  "uninstall.py"
+(home-page "http://slepc.upv.es";)
+(synopsis "Scalable library for eigenproblems")
+(description "SLEPc is a software library for the solution of large sparse
+eigenproblems on parallel computers.  It can be used for the solution of
+linear eigenvalue problems formulated in either standard or generalized form,
+as well as other related problems such as the singular value decomposition.
+The emphasis of the software is on methods and techniques appropriate for
+problems in which the associated matrices are sparse, for example, those
+arising after the discretization of partial differential equations.")
+(license license:lgpl3)))
+
+(define-public slepc-complex
+  (package (inherit slepc)
+(name "slepc-complex")
+(propagated-inputs
+ `(("petsc" ,petsc-complex)
+   ,@(alist-delete "petsc" (package-propagated-inputs slepc
+(synopsis "Scalable library for eigenproblems (with complex scalars)")))
+
+(define-public slepc-openmpi
+  (package (inherit slepc)
+(name "slepc-openmpi")
+(inputs
+ `(("mpi" ,openmpi)
+   ("arpack" ,arpack-ng-openmpi)
+   ,@(alist-delete "arpack" (package-inputs slepc
+(propagated-inputs
+ `(("petsc" ,petsc-openmpi)
+   ,@(alist-delete "petsc" (package-propagated-inputs slepc
+(synopsis "Scalable library for eigenproblems (with MPI support)")))
+
+(define-public slepc-complex-openmpi
+  (package (inherit slepc-openmpi)
+(name "slepc-complex-openmpi")
+(propagated-inputs
+ `(("petsc" ,petsc-complex-openmpi)
+   ,@(alist-delete "petsc" (package-propagated-inputs slepc-openmpi
+(synopsis "Scalable library for eigenproblems (with complex scalars and 
MPI support)")))
+
 (define-public mumps
   (package
 (name "mumps")
-- 
2.2.1




[PATCH 04/14] gnu: Update scotch to 6.0.4.

2015-06-27 Thread ericbavier
From: Eric Bavier 

* gnu/packages/maths.scm (scotch): Update to 6.0.4.
  [arguments]: Add -fPIC to CFLAGS.
* gnu/packages/patches/scotch-test-threading.patch: Adjust patch for a
  new set of test fixes.
* gnu/packages/patches/pt-scotch-build-parallelism.patch: New patch.
* gnu-system.am (dist_patch_DATA): Add it.
---
 gnu-system.am  |   1 +
 gnu/packages/maths.scm |  16 +--
 .../patches/pt-scotch-build-parallelism.patch  |  13 ++
 gnu/packages/patches/scotch-test-threading.patch   | 131 ++---
 4 files changed, 29 insertions(+), 132 deletions(-)
 create mode 100644 gnu/packages/patches/pt-scotch-build-parallelism.patch

diff --git a/gnu-system.am b/gnu-system.am
index 2d45e40..0c9a2eb 100644
--- a/gnu-system.am
+++ b/gnu-system.am
@@ -549,6 +549,7 @@ dist_patch_DATA =   
\
   gnu/packages/patches/polkit-drop-test.patch  \
   gnu/packages/patches/portaudio-audacity-compat.patch \
   gnu/packages/patches/procps-make-3.82.patch  \
+  gnu/packages/patches/pt-scotch-build-parallelism.patch   \
   gnu/packages/patches/pulseaudio-fix-mult-test.patch  \
   gnu/packages/patches/pulseaudio-longer-test-timeout.patch\
   gnu/packages/patches/pycairo-wscript.patch   \
diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 4e0b1ee..e4fe03b 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -2,7 +2,7 @@
 ;;; Copyright © 2013, 2014, 2015 Andreas Enge 
 ;;; Copyright © 2013 Nikita Karetnikov 
 ;;; Copyright © 2014 John Darrington 
-;;; Copyright © 2014 Eric Bavier 
+;;; Copyright © 2014, 2015 Eric Bavier 
 ;;; Copyright © 2014 Federico Beffa 
 ;;; Copyright © 2014 Mathieu Lirzin 
 ;;; Copyright © 2015 Ricardo Wurmus 
@@ -785,15 +785,16 @@ implemented in ANSI C, and MPI for communications.")
 (define-public scotch
   (package
 (name "scotch")
-(version "6.0.0")
+(version "6.0.4")
 (source
  (origin
   (method url-fetch)
-  (uri (string-append "https://gforge.inria.fr/frs/download.php/31831/";
+  (uri (string-append "https://gforge.inria.fr/frs/download.php/34618/";
   "scotch_" version ".tar.gz"))
   (sha256
-   (base32 "0yfqf9lk7chb3h42777x42x4adx0v3n0b41q0cdqrdmscp4iczp5"))
-  (patches (list (search-patch "scotch-test-threading.patch")
+   (base32 "1ir088mvrqggyqdkx9qfynmiaffqbyih5qfl5mga2nrlm1qlsgzm"))
+  (patches (list (search-patch "scotch-test-threading.patch")
+ (search-patch "pt-scotch-build-parallelism.patch")
 (build-system gnu-build-system)
 (inputs
  `(("zlib" ,zlib)
@@ -820,7 +821,7 @@ CCS = gcc
 CCP = mpicc
 CCD = gcc
 CPPFLAGS =~{ -D~a~}
-CFLAGS = -O2 -g $(CPPFLAGS)
+CFLAGS = -O2 -g -fPIC $(CPPFLAGS)
 LDFLAGS = -lz -lm -lrt -lpthread
 CP = cp
 LEX = flex -Pscotchyy -olex.yy.c
@@ -833,8 +834,7 @@ YACC = bison -pscotchyy -y -b y
'("COMMON_FILE_COMPRESS_GZ"
  "COMMON_PTHREAD"
  "COMMON_RANDOM_FIXED_SEED"
- ;; TODO: Define once our MPI supports
- ;; MPI_THREAD_MULTIPLE
+ ;; XXX: Causes invalid frees in superlu-dist tests
  ;; "SCOTCH_PTHREAD"
  ;; "SCOTCH_PTHREAD_NUMBER=2"
  "restrict=__restrict")
diff --git a/gnu/packages/patches/pt-scotch-build-parallelism.patch 
b/gnu/packages/patches/pt-scotch-build-parallelism.patch
new file mode 100644
index 000..2ac5f27
--- /dev/null
+++ b/gnu/packages/patches/pt-scotch-build-parallelism.patch
@@ -0,0 +1,13 @@
+Building with -j may cause the esmumps_main target to fail with a "no rule for
+dependency libptesmumps.a" error.  Fix the dependency name.
+
+--- scotch_6.0.4/src/esmumps/Makefile  2012-12-01 08:29:29.0 -0600
 scotch_6.0.4/src/esmumps/Makefile  2015-06-15 17:29:23.279605734 -0500
+@@ -160,6 +160,6 @@
+   order.h 
\
+   symbol.h
\
+   esmumps.h   
\
+-  lib$(ESMUMPSLIB)$(LIB)  
\
++  libesmumps$(LIB)
\
+   $(libdir)/lib$(SCOTCHLIB)$(LIB) 
\
+   $(libdir)/lib$(SCOTCHLIB)errexit$(LIB)
diff --git a/gnu/packages/patches/scotch-test-threading.patch 
b/gnu/packages/patches/scotch-test-threading.patch
index 2527a6e..de8cc49 100644
--- a/gnu/packages/patches/scotch-test-threading.patch
+++ b/gnu/packages/patches/scotch-test-threading.patch
@@ -1,139 +1,22 @@
-* These tests assume threading support, even when the library is 

[PATCH 01/14] gnu: hwloc: Upgrade to 1.10.1.

2015-06-27 Thread ericbavier
From: Eric Bavier 

* gnu/packages/patches/hwloc-gather-topology-lstopo.patch: New patch.
* gnu/packages/mpi.scm (hwloc): Upgrade to 1.10.1.
  [source]: Use patch.
  [propagated-inputs]: Remove libpci.
  [inputs]: Add libpciaccess.
* gnu-system.am (dist_patch_DATA): Add patch.
---
 gnu-system.am  |  1 +
 gnu/packages/mpi.scm   | 23 ++
 .../patches/hwloc-gather-topology-lstopo.patch | 13 
 3 files changed, 24 insertions(+), 13 deletions(-)
 create mode 100644 gnu/packages/patches/hwloc-gather-topology-lstopo.patch

diff --git a/gnu-system.am b/gnu-system.am
index a420d71..2d45e40 100644
--- a/gnu-system.am
+++ b/gnu-system.am
@@ -461,6 +461,7 @@ dist_patch_DATA =   
\
   gnu/packages/patches/gtkglext-disable-disable-deprecated.patch \
   gnu/packages/patches/hop-bigloo-4.0b.patch   \
   gnu/packages/patches/hop-linker-flags.patch  \
+  gnu/packages/patches/hwloc-gather-topology-lstopo.patch  \
   gnu/packages/patches/hydra-automake-1.15.patch   \
   gnu/packages/patches/hydra-disable-darcs-test.patch  \
   gnu/packages/patches/irrlicht-mesa-10.patch  \
diff --git a/gnu/packages/mpi.scm b/gnu/packages/mpi.scm
index 8e62da9..0e1016e 100644
--- a/gnu/packages/mpi.scm
+++ b/gnu/packages/mpi.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2014 Eric Bavier 
+;;; Copyright © 2014, 2015 Eric Bavier 
 ;;; Copyright © 2014 Ludovic Courtès 
 ;;; Copyright © 2014 Ian Denhardt 
 ;;;
@@ -39,30 +39,29 @@
 (define-public hwloc
   (package
 (name "hwloc")
-(version "1.9")
+(version "1.10.1")
 (source (origin
   (method url-fetch)
   (uri (string-append "http://www.open-mpi.org/software/hwloc/v";
-  version "/downloads/hwloc-"
-  version ".tar.bz2"))
+  (version-major+minor version)
+  "/downloads/hwloc-" version ".tar.bz2"))
   (sha256
(base32
-"0zjgiili2a8v63s8ly3a8qp8ibxv1jw3zbgm7diic3w1qgqiza14"
+"0jji5rphy05s0lp6bknn8lxwixrq0hy5rjzsqvhjszbkl2li7kim"))
+  (patches (list
+(search-patch "hwloc-gather-topology-lstopo.patch")
 (build-system gnu-build-system)
-(arguments
- ;; Enable libpci support, which effectively makes hwloc GPLv2+.
- '(#:configure-flags '("--enable-libpci")))
 (inputs
  `(("libx11" ,libx11)
("cairo" ,cairo)
("ncurses" ,ncurses)
+   ("libpciaccess" ,libpciaccess)
("expat" ,expat)))
 (native-inputs
  `(("pkg-config" ,pkg-config)))
 (propagated-inputs
- ;; 'hwloc.pc' refers to libpci and libnuma, hence the propagation.
- `(("numactl" ,numactl)
-   ("pciutils" ,pciutils)))
+ ;; 'hwloc.pc' refers to libnuma, hence the propagation.
+ `(("numactl" ,numactl)))
 (home-page "http://www.open-mpi.org/projects/hwloc/";)
 (synopsis "Abstraction of hardware architectures")
 (description
@@ -77,8 +76,6 @@ exploit it accordingly and efficiently.
 hwloc may display the topology in multiple convenient formats.  It also offers
 a powerful programming interface to gather information about the hardware,
 bind processes, and much more.")
-
-;; But see above about linking against libpci.
 (license bsd-3)))
 
 (define-public openmpi
diff --git a/gnu/packages/patches/hwloc-gather-topology-lstopo.patch 
b/gnu/packages/patches/hwloc-gather-topology-lstopo.patch
new file mode 100644
index 000..06f47ae
--- /dev/null
+++ b/gnu/packages/patches/hwloc-gather-topology-lstopo.patch
@@ -0,0 +1,13 @@
+Derived from upstream commit 0a32f719c.
+
+--- hwloc-1.10.1/tests/linux/Makefile.in   2015-01-26 03:37:52.0 
-0600
 hwloc-1.10.1/tests/linux/Makefile.in   2015-06-15 11:21:49.824842511 
-0500
+@@ -1633,7 +1633,7 @@
+ 
+ 
+ install-exec-hook:
+-  $(SED) -e 's/HWLOC_top_builddir\/utils/bindir/' -e 
'/HWLOC_top_builddir/d' $(DESTDIR)$(bindir)/hwloc-gather-topology > 
$(DESTDIR)$(bindir)/hwloc-gather-topology.tmp && mv -f 
$(DESTDIR)$(bindir)/hwloc-gather-topology.tmp 
$(DESTDIR)$(bindir)/hwloc-gather-topology
++  $(SED) -e 's/HWLOC_top_builddir\/utils\/lstopo/bindir/' -e 
'/HWLOC_top_builddir/d' $(DESTDIR)$(bindir)/hwloc-gather-topology > 
$(DESTDIR)$(bindir)/hwloc-gather-topology.tmp && mv -f 
$(DESTDIR)$(bindir)/hwloc-gather-topology.tmp 
$(DESTDIR)$(bindir)/hwloc-gather-topology
+   chmod +x $(DESTDIR)$(bindir)/hwloc-gather-topology
+ 
+ # Tell versions [3.59,3.63) of GNU make to not export all variables.
-- 
2.2.1




[PATCH 03/14] gnu: openmpi: Upgrade to 1.8.5.

2015-06-27 Thread ericbavier
From: Eric Bavier 

* gnu/packages/mpi.scm (openmpi): Upgrade to 1.8.5.
  [native-inputs]: Add perl.
  [arguments]: Add configure flags for thread support.
---
 gnu/packages/mpi.scm | 19 +++
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/gnu/packages/mpi.scm b/gnu/packages/mpi.scm
index 9677c12..9417e35 100644
--- a/gnu/packages/mpi.scm
+++ b/gnu/packages/mpi.scm
@@ -32,6 +32,7 @@
   #:use-module (gnu packages xorg)
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages xml)
+  #:use-module (gnu packages perl)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages valgrind))
@@ -91,7 +92,7 @@ bind processes, and much more.")
 (define-public openmpi
   (package
 (name "openmpi")
-(version "1.8.1")
+(version "1.8.5")
 (source
  (origin
   (method url-fetch)
@@ -100,22 +101,24 @@ bind processes, and much more.")
   "/downloads/openmpi-" version ".tar.bz2"))
   (sha256
(base32
-"13z1q69f3qwmmhpglarfjminfy2yw4rfqr9jydjk5507q3mjf50p"
+"1i7vjf599kl5lm8n4vnwq9q1d9scn4sdjh42kfq1i9yzxnlhdsjc"
 (build-system gnu-build-system)
 (inputs
  `(("hwloc" ,hwloc)
("gfortran" ,gfortran)
("valgrind" ,valgrind)))
 (native-inputs
- `(("pkg-config" ,pkg-config)))
+ `(("pkg-config" ,pkg-config)
+   ("perl" ,perl)))
 (arguments
  `(#:configure-flags `("--enable-static"
"--enable-oshmem"
-   ;; Thread support causes some applications to hang
-   ;; "--enable-event-thread-support"
-   ;; "--enable-opal-multi-threads"
-   ;; "--enable-orte-progress-threads"
-   ;; "--enable-mpi-thread-multiple"
+
+   "--enable-event-thread-support"
+   "--enable-opal-multi-threads"
+   "--enable-orte-progress-threads"
+   "--enable-mpi-thread-multiple"
+
"--enable-mpi-ext=all"
"--with-devel-headers"
"--enable-debug"
-- 
2.2.1




[PATCH 00/14] Add deal.II and some dependencies.

2015-06-27 Thread ericbavier
From: Eric Bavier 

The following patches add the deal.II finite element library and some of its
dependencies.  Also included are some non-trivial package upgrades.

I've tested builds on both x86_64 and i686, but cannot comment on mips or arm.

Stylistic or other comments are most welcome.

Eric Bavier (14):
  gnu: hwloc: Upgrade to 1.10.1.
  gnu: hwloc: Move numactl to inputs.
  gnu: openmpi: Upgrade to 1.8.5.
  gnu: Update scotch to 6.0.4.
  gnu: scotch, pt-scotch: Use modify-phases.
  gnu: scotch, pt-scotch: Build esmumps libraries.
  gnu: Add ScaLAPACK.
  gnu: Add p4est.
  gnu: Add METIS.
  gnu: Add MUMPS.
  gnu: petsc: Upgrade to 3.6.0.
  gnu: Add arpack-ng-openmpi.
  gnu: Add SLEPc.
  gnu: Add deal.II.

 gnu-system.am  |   5 +-
 gnu/packages/maths.scm | 589 ++---
 gnu/packages/mpi.scm   |  54 +-
 gnu/packages/patches/deal.II-p4est-interface.patch |  62 +++
 .../patches/hwloc-gather-topology-lstopo.patch |  13 +
 gnu/packages/patches/mumps-build-parallelism.patch |  13 +
 gnu/packages/patches/petsc-fix-threadcomm.patch|  15 -
 .../patches/pt-scotch-build-parallelism.patch  |  13 +
 gnu/packages/patches/scotch-test-threading.patch   | 131 +
 9 files changed, 670 insertions(+), 225 deletions(-)
 create mode 100644 gnu/packages/patches/deal.II-p4est-interface.patch
 create mode 100644 gnu/packages/patches/hwloc-gather-topology-lstopo.patch
 create mode 100644 gnu/packages/patches/mumps-build-parallelism.patch
 delete mode 100644 gnu/packages/patches/petsc-fix-threadcomm.patch
 create mode 100644 gnu/packages/patches/pt-scotch-build-parallelism.patch

-- 
2.2.1




[PATCH 02/14] gnu: hwloc: Move numactl to inputs.

2015-06-27 Thread ericbavier
From: Eric Bavier 

* gnu/packages/mpi.scm (hwloc)[propagated-inputs]: Move numactl from here...
  [inputs]: ...to here.
  [arguments]: New 'refine-libnuma' phase.
---
 gnu/packages/mpi.scm | 16 +---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/mpi.scm b/gnu/packages/mpi.scm
index 0e1016e..9677c12 100644
--- a/gnu/packages/mpi.scm
+++ b/gnu/packages/mpi.scm
@@ -55,13 +55,23 @@
  `(("libx11" ,libx11)
("cairo" ,cairo)
("ncurses" ,ncurses)
+   ("numactl" ,numactl)
("libpciaccess" ,libpciaccess)
("expat" ,expat)))
 (native-inputs
  `(("pkg-config" ,pkg-config)))
-(propagated-inputs
- ;; 'hwloc.pc' refers to libnuma, hence the propagation.
- `(("numactl" ,numactl)))
+(arguments
+ `(#:phases
+   (modify-phases %standard-phases
+ (add-after
+  'install 'refine-libnuma
+  ;; Give -L arguments for libraries to avoid propagation
+  (lambda* (#:key inputs outputs #:allow-other-keys)
+(let ((out  (assoc-ref outputs "out"))
+  (numa (assoc-ref inputs "numactl")))
+  (substitute* (map (lambda (f) (string-append out "/" f))
+'("lib/pkgconfig/hwloc.pc" "lib/libhwloc.la"))
+(("-lnuma" lib) (string-append "-L" numa "/lib " lib)
 (home-page "http://www.open-mpi.org/projects/hwloc/";)
 (synopsis "Abstraction of hardware architectures")
 (description
-- 
2.2.1




Re: [PATCH] Clean up 'THANKS' and 'AUTHORS'.

2015-06-27 Thread Paul van der Walt

On 2015-06-28 at 01:48, quoth Mark H Weaver:
> Alex explained in the commit log:

Oops, that'll teach me not to read everything exhaustively
:shame:. Thanks!

p.



Re: [PATCH] Clean up 'THANKS' and 'AUTHORS'.

2015-06-27 Thread Mark H Weaver
Paul van der Walt  writes:
> Out of pure curiosity, why are we not thanking so many people any
> more?

Alex explained in the commit log:

* THANKS: Remove Federico Beffa, Marek Benc, John Darrington, Alex Kost,
  Cyrill Schenkel and Andy Wingo because they are placed in AUTHORS.

I guess that no one is being removed from the list; Alex is only
eliminating the duplication.

 Mark



Re: [PATCH] Clean up 'THANKS' and 'AUTHORS'.

2015-06-27 Thread Mark H Weaver
Andreas Enge  writes:

> On Sat, Jun 27, 2015 at 08:53:29PM +0300, Alex Kost wrote:
>> I feel a bit uncomfortable that I added my name to AUTHORS :-)
>
> Well, it definitely belongs there. Probably everybody assumed it was there
> already and did not bother to check.

Agreed :)

Mark



Diet branch

2015-06-27 Thread Ludovic Courtès
Hello!

The ‘wip-diet’ branch removes extra weight from a few packages:

  • Remove dependency from MySQL, Mutt, and cups-filters on GCC 4.9.

  • Remove 32 MiB of useless binaries from MySQL.

  • Remove reference to qt-4:doc (280 MiB) from qt-4.

  • Move Ghostscript documentation (16 MiB) to separate output.

Unless there are objections, I’ll get Hydra to build it and merge it as
soon as it’s done.

Ludo’.



Re: [PATCH] Clean up 'THANKS' and 'AUTHORS'.

2015-06-27 Thread Paul van der Walt
Out of pure curiosity, why are we not thanking so many people any more?
I don't have any vested interest, i'm really just idly wondering.


signature.asc
Description: PGP signature


Re: [PATCH] Add Blast+.

2015-06-27 Thread Mark H Weaver
Ricardo Wurmus  writes:

>> It would be great to get the tests working, even if we have to disable
>> some of them.  Otherwise we have no way of knowing that we're not
>> distributing broken garbage :)
>
> It's hard to know in this case even with the tests, because it's only
> three tests and they seem hardly representative of the library.

Okay, fair enough.

>> Is everything in here really in the public domain?  I'd guess that in
>> order to make this true, you'd need to remove bzip2 and zlib in a
>> snippet, and even then I'd doubtful :)
>
> I've moved the code to remove the bundled stuff to a snippet.
>
> The NCBI code was released into the public domain.  However, it appears
> that some third-party headers and some build scripts are under a
> different license:
>
>   * Expat:
> * ncbi-blast-2.2.30+-src/c++/include/util/bitset/
> * ncbi-blast-2.2.30+-src/c++/src/html/ncbi_menu*.js
>   * Boost license:
> * 
> ncbi-blast-2.2.30+-src/c++/include/util/impl/floating_point_comparison.hpp
>   * LGPL 2+:
> * ncbi-blast-2.2.30+-src/c++/include/dbapi/driver/odbc/unix_odbc/
>   * ASL 2.0:
> * ncbi-blast-2.2.30+-src/c++/src/corelib/teamcity_*
>
> I could not find mention of any other licenses.  Is this correct, then:
>
> ;; Most of the sources are in the public domain, with the following 
> exceptions:
> ;; ...(the above list)...
> (license (list license:public-domain
>license:expat
>license:boost1.0
>license:lgpl2.0+
>license:asl2.0))

Looks good, thanks!  See below for more comments on the patch.

> From 8d131f66ba0378738e5b837f78c411edb241d35a Mon Sep 17 00:00:00 2001
> From: Ricardo Wurmus 
> Date: Tue, 16 Jun 2015 16:24:24 +0200
> Subject: [PATCH] gnu: Add Blast+.
>
> * gnu/packages/bioinformatics.scm (blast+): New variable.
> ---
>  gnu/packages/bioinformatics.scm | 155 
> 
>  1 file changed, 155 insertions(+)
>
> diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
> index 3defac8..4603329 100644
> --- a/gnu/packages/bioinformatics.scm
> +++ b/gnu/packages/bioinformatics.scm
> @@ -31,6 +31,7 @@
>#:use-module (gnu packages base)
>#:use-module (gnu packages boost)
>#:use-module (gnu packages compression)
> +  #:use-module (gnu packages cpio)
>#:use-module (gnu packages file)
>#:use-module (gnu packages java)
>#:use-module (gnu packages linux)
> @@ -258,6 +259,160 @@ into separate processes; and more.")
>  (inputs
>   `(("python2-numpy" ,python2-numpy)
>  
> +(define-public blast+
> +  (package
> +(name "blast+")
> +(version "2.2.30")
> +(source (origin
> +  (method url-fetch)
> +  (uri (string-append
> +"ftp://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/";
> +version "/ncbi-blast-" version "+-src.tar.gz"))
> +  (sha256
> +   (base32
> +"0h0fj5cpx6zpfwixgx5f5xbr4rn3cnai0x3j7grrg50vr18jvxr6"))
> +  (modules '((guix build utils)))
> +  (snippet
> +   '(begin
> +  ;; Remove bundled bzip2 and zlib
> +  (delete-file-recursively "c++/src/util/compress/bzip2")
> +  (delete-file-recursively "c++/src/util/compress/zlib")
> +  (substitute* "c++/src/util/compress/Makefile.in"
> +(("bzip2 zlib api") "api"))
> +  ;; Remove useless msbuild directory
> +  (delete-file-recursively
> +   "c++/src/build-system/project_tree_builder/msbuild")

As with phase procedures, the snippet should return a boolean, so please
add #t here.

[...]
> +;; Proceed even though the weird build system says that generated
> +;; files are out of date
> +(setenv "NCBICXX_RECONF_POLICY" "warn")
> +
> +;; Rewrite hardcoded paths to various tools
> +(substitute* (append (find-files "scripts/common/check" "\\.sh$")
> + '("scripts/common/impl/if_diff.sh"
> +   "scripts/common/impl/run_with_lock.sh"
> +   
> "src/build-system/Makefile.configurables.real"
> +   "src/build-system/Makefile.in.top"
> +   "src/build-system/Makefile.meta.gmake=no"
> +   "src/build-system/Makefile.meta.in"
> +   "src/build-system/Makefile.meta_l"
> +   "src/build-system/Makefile.meta_p"
> +   "src/build-system/Makefile.meta_r"
> +   "src/build-system/Makefile.mk.in"
> +   "src/build-system/Makefile.requirements"
> +   
> "src/build-system/Makefile.rul

Re: [PATCH] Clean up 'THANKS' and 'AUTHORS'.

2015-06-27 Thread Andreas Enge
On Sat, Jun 27, 2015 at 08:53:29PM +0300, Alex Kost wrote:
> I feel a bit uncomfortable that I added my name to AUTHORS :-)

Well, it definitely belongs there. Probably everybody assumed it was there
already and did not bother to check.

Andreas




[PATCH] Clean up 'THANKS' and 'AUTHORS'.

2015-06-27 Thread Alex Kost
I feel a bit uncomfortable that I added my name to AUTHORS :-)

>From 5f610f3b84e6024b686e310bbaa402ed25e2d4df Mon Sep 17 00:00:00 2001
From: Alex Kost 
Date: Sat, 27 Jun 2015 20:42:32 +0300
Subject: [PATCH] Clean up 'THANKS' and 'AUTHORS'.

* AUTHORS: Add Alex Kost.
  Align Paul van der Walt name properly.
* THANKS: Remove Federico Beffa, Marek Benc, John Darrington, Alex Kost,
  Cyrill Schenkel and Andy Wingo because they are placed in AUTHORS.
  Align Kete name properly.
---
 AUTHORS | 3 ++-
 THANKS  | 8 +---
 2 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/AUTHORS b/AUTHORS
index 6eadb7f..0b17f06 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -23,6 +23,7 @@ alphabetical order):
  Raimon Grau 
   David Hashe 
  Nikita Karetnikov 
+   Alex Kost 
  Julien Lepiller 
 Aljosha Papsch 
Deck Pickard 
@@ -34,7 +35,7 @@ alphabetical order):
 Sree Harsha Totakura 
   David Thompson 
   Claes Wallin (韋嘉誠) 
-   Paul van der Walt 
+   Paul van der Walt 
 Mark H. Weaver 
  Christopher A. Webber 
Andy Wingo 
diff --git a/THANKS b/THANKS
index 8093d8c..0ec4726 100644
--- a/THANKS
+++ b/THANKS
@@ -7,8 +7,6 @@ suggestions, bug reports, patches, internationalization, or general
 infrastructure help:
 
 	Lluís Batlle i Rossell 
- Federico Beffa 
-Marek Benc 
   Sylvain Beucler 
 Amirouche Boubekki 
 	   Carlos Carleos 
@@ -16,14 +14,12 @@ infrastructure help:
 	   Daniel Clark 
 	Alexandru Cojocaru 
 	Aleix Conchillo Flaqué 
-	 John Darrington 
 	   Rafael Ferreira 
 	Christian Grothoff 
   Brandon Invergo 
 	  Jeffrin Jose 
-	 Kete 
+	  Kete 
Daniel Kochmański 
- Alex Kost 
 	  Matthew Lien 
 	Niels Möller 
 	   Yutaka Niibe 
@@ -33,12 +29,10 @@ infrastructure help:
   rekado 
Joshua Randall 
   Bruno Félix Rezende Ribeiro 
-	   Cyrill Schenkel 
 	Benno Schulenberg 
Thomas Schwinge 
 	 Alen Skondro 
 	 Matthias Wachs 
- Andy Wingo 
Philip Woods 
 
 GNU Guix also includes non-software works.  Thanks to the following
-- 
2.4.3



Re: [PATCH] Add Blast+.

2015-06-27 Thread Ricardo Wurmus

Ben Woodcroft  writes:

> 2.2.31+ just got released, maybe upgrade first?

Ah, good to know.  I’ll build the latest version on Monday and push that
if there are no further objections.

~~ Ricardo



Re: [PATCH] Add Blast+.

2015-06-27 Thread Ben Woodcroft



On 27/06/15 20:14, Ludovic Courtès wrote:

Ricardo Wurmus  skribis:


 From 8d131f66ba0378738e5b837f78c411edb241d35a Mon Sep 17 00:00:00 2001
From: Ricardo Wurmus 
Date: Tue, 16 Jun 2015 16:24:24 +0200
Subject: [PATCH] gnu: Add Blast+.

* gnu/packages/bioinformatics.scm (blast+): New variable.

Mark, do you have anything to add on this one?  At first sight it looks
good to me.


2.2.31+ just got released, maybe upgrade first?

ben



Re: [PATCH] Add prodigal.

2015-06-27 Thread Ben Woodcroft


On 27/06/15 20:40, Ricardo Wurmus wrote:

  +(synopsis "Protein-coding gene prediction for Archaea and Bacteria")

Shouldn’t “Archaea” and “Bacteria” both be lower-cased?
I don't believe so. As I understand it you can use "bacterial" and 
"archaeal" with lower case, but here we are referring to the domains as 
nouns.


I did take some small liberties here. The original sentence on the web was

>Fast, reliable protein-coding gene prediction for prokaryotic genomes.

To me this is problematic in two ways:
1. It works on more than just genomes
2. There is some contention in the field about the use of "prokaryote", 
since this refers to a paraphyletic group - us humans are more closely 
related to Archaea than Bacteria.

http://link.springer.com/referenceworkentry/10.1007/978-3-642-30194-0_114

I figure it was just easier to sidestep the issue and put Archaea and 
Bacteria.

another thing just occurred to me.  Instead of replacing the install
phase you might just overwrite the INSTALLDIR variable, something like
this:

 #:make-flags (list (string-append "INSTALLDIR="
   (assoc-ref %outputs "out")))

What do you think?
That made it more concise, and maybe more future proof (though need 
added "/bin").
>From 086a910d53995cb209a7413c74705d2ad3b8e17e Mon Sep 17 00:00:00 2001
From: Ben Woodcroft 
Date: Sat, 27 Jun 2015 22:28:19 +1000
Subject: [PATCH] gnu: Add prodigal.

* gnu/packages/bioinformatics.scm (prodigal): New variable.
---
 gnu/packages/bioinformatics.scm | 31 +++
 1 file changed, 31 insertions(+)

diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index 31df219..f321d82 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -1405,6 +1405,37 @@ files and writing bioinformatics applications.")
 generated using the PacBio Iso-Seq protocol.")
   (license license:bsd-3
 
+(define-public prodigal
+  (package
+(name "prodigal")
+(version "2.6.2")
+(source (origin
+  (method url-fetch)
+  (uri (string-append
+"https://github.com/hyattpd/Prodigal/archive/v";
+version ".tar.gz"))
+  (file-name (string-append name "-" version ".tar.gz"))
+  (sha256
+   (base32
+"0m8sb0fg6lmxrlpzna0am6svbnlmd3dckrhgzxxgb3gxr5fyj284"
+(build-system gnu-build-system)
+(arguments
+ `(#:tests? #f ;no check target
+   #:make-flags (list (string-append "INSTALLDIR="
+ (assoc-ref %outputs "out")
+ "/bin"))
+   #:phases
+   (modify-phases %standard-phases
+ (delete 'configure
+(home-page "http://prodigal.ornl.gov";)
+(synopsis "Protein-coding gene prediction for Archaea and Bacteria")
+(description
+ "Prodigal runs smoothly on finished genomes, draft genomes, and
+metagenomes, providing gene predictions in GFF3, Genbank, or Sequin table
+format.  It runs quickly, in an unsupervised fashion, handles gaps, handles
+partial genes, and identifies translation initiation sites.")
+(license license:gpl3+)))
+
 (define-public rsem
   (package
 (name "rsem")
-- 
2.4.3



Re: [PATCH] Add prodigal.

2015-06-27 Thread Ricardo Wurmus
Hi again,

another thing just occurred to me.  Instead of replacing the install
phase you might just overwrite the INSTALLDIR variable, something like
this:

#:make-flags (list (string-append "INSTALLDIR="
  (assoc-ref %outputs "out")))

What do you think?

~~ Ricardo



Re: [PATCH] Add prodigal.

2015-06-27 Thread Ricardo Wurmus
Hi Ben,

> Oops, now all lines <= 80 chars.

looks good to me, except for the synopsis:

>  +(synopsis "Protein-coding gene prediction for Archaea and Bacteria")

Shouldn’t “Archaea” and “Bacteria” both be lower-cased?

~~ Ricardo



Re: [PATCH] Add plink.

2015-06-27 Thread Ludovic Courtès
Ricardo Wurmus  skribis:

> From 85811f556f0db843f2c699465d317c10d4e85807 Mon Sep 17 00:00:00 2001
> From: Ricardo Wurmus 
> Date: Thu, 25 Jun 2015 12:04:05 +0200
> Subject: [PATCH] gnu: Add plink.
>
> * gnu/packages/bioinformatics.scm (plink): New variable.
> * gnu/packages/patches/plink-1.07-unclobber-i.patch: New file.

LGTM!

Ludo’.



Re: [PATCH] gnu/package/pv.scm (pv): New file, new variable

2015-06-27 Thread Ludovic Courtès
Alex Kost  skribis:

>> From e93d21889bdcbed02a517f30d8401a3bb144cce4 Mon Sep 17 00:00:00 2001
>> From: Claes Wallin 
>> Date: Fri, 19 Jun 2015 20:12:09 +0200
>> Subject: [PATCH] gnu: Add pv.
>>
>>  * gnu/package/pv.scm (pv): New file.
>>  * gnu-system.am (GNU_SYSTEM_MODULES): Add it.
>
> Thank you!  It looks good to me, so I'll push it in a couple of days if
> no one will send additional comments/notes.

If it looks good to you, go ahead.

Thanks for reviewing it.

Ludo’.



Re: [PATCH] Add Blast+.

2015-06-27 Thread Ludovic Courtès
Ricardo Wurmus  skribis:

> From 8d131f66ba0378738e5b837f78c411edb241d35a Mon Sep 17 00:00:00 2001
> From: Ricardo Wurmus 
> Date: Tue, 16 Jun 2015 16:24:24 +0200
> Subject: [PATCH] gnu: Add Blast+.
>
> * gnu/packages/bioinformatics.scm (blast+): New variable.

Mark, do you have anything to add on this one?  At first sight it looks
good to me.

Ludo’.



Re: [PATCH 5/5] gnu: Add emacs-mmm-mode

2015-06-27 Thread Ludovic Courtès
Federico Beffa  skribis:

> From 84bded85e25fd8130f222d30442027219fa8f642 Mon Sep 17 00:00:00 2001
> From: Federico Beffa 
> Date: Wed, 17 Jun 2015 10:42:09 +0200
> Subject: [PATCH 5/5] gnu: Add emacs-mmm-mode.
>
> * gnu/packages/emacs.scm (emacs-mmm-mode): New variable.

[...]

> +(synopsis
> + "Allow Multiple Major Modes in a buffer")

Rather: “Allow multiple major modes in an Emacs buffer”.

OK with this change, thanks!

Ludo’.



Re: [PATCH 4/5] gnu: Add emacs-auctex

2015-06-27 Thread Ludovic Courtès
Federico Beffa  skribis:

> From c17c181a5663a29fdc84942c90d6b90549a9f76e Mon Sep 17 00:00:00 2001
> From: Federico Beffa 
> Date: Mon, 15 Jun 2015 14:51:06 +0200
> Subject: [PATCH 4/5] gnu: Add emacs-auctex.
>
> * gnu/packages/emacs.scm: New variable.

[...]

> +(synopsis "Integrated environment for *TeX*")

You can remove the stars here.

OK to push, thanks!

Ludo’.



Re: [PATCH 1/5] import: Add 'elpa' importer

2015-06-27 Thread Ludovic Courtès
Federico Beffa  skribis:

> From 56c460213d76ff2b88fd771b48997c3e03200234 Mon Sep 17 00:00:00 2001
> From: Federico Beffa 
> Date: Tue, 16 Jun 2015 10:50:06 +0200
> Subject: [PATCH 1/6] import: Add 'elpa' importer.
>
> * guix/import/elpa.scm: New file.
> * guix/scripts/import.scm: Add "elpa" to 'importers'.
> * guix/scripts/import/elpa.scm: New file.
> * Makefile.am (MODULES): Add 'guix/import/elpa.scm' and
>   'guix/scripts/import/elpa.scm'.
>   (SCM_TESTS): Add 'tests/elpa.scm'.
> * doc/guix.texi (Invoking guix import): Document it.
> * tests/elpa.scm: New file.

Please add guix/scripts/import/elpa.scm to po/guix/POTFILES.in (sorry,
I had forgotten about it.)

[...]

> +(define* (call-with-downloaded-file url proc
> + #:optional (err-msg "unavailable"))
> +  "Fetch URL, store the content in a temporary file and call PROC with that
> +file.  Returns the value returned by PROC."
> + (call-with-temporary-output-file
> +  (lambda (temp port)
> +(or (and (url-fetch url temp)
> + (call-with-input-file temp proc))
> +(error err-msg url)

Please fix the indentation.

Remove the ‘err-msg’ parameter, and change the ‘error’ call to:

  (error "download failed" url)

OK to push with these changes.

Thanks!

Ludo’.



Re: [PATCH 3/5] build: Add 'emacs-build-system'

2015-06-27 Thread Ludovic Courtès
Federico Beffa  skribis:

> On Thu, Jun 25, 2015 at 2:33 PM, Ludovic Courtès  wrote:
>> Federico Beffa  skribis:

[...]

>> The problem is that this forcefully introduces bindings in an opaque way
>> (that is, regardless of whether the ‘outputs’ binding appears in the
>> source, there’s an ‘outputs’ binding that magically appears; this is
>> “unhygienic” or “non referentially transparent,” or just “bad”.  ;-))
>>
>> Ideally, the identifiers that appear in the macro expansion should
>> either be in the source, or be unique (compiler-generated.)
>
> I was so sure that you would say so, that I did a copy of the file
> before removing the 'let's and introducing the syntax.

:-)

> If this would be proposed as a general utility, then I would agree
> with you. But it's not. It is a module internal implementation detail

Sure, sure, but the problems here are not theoretical.  The possibility
of having one user introduce a binding that clashes without noticing is
real, and it can be hard to debug.  “But it’s all internal in a single
file,” right, but some future hacker might not notice the
unhygenically-introduced bindings.

Simply put, people may not expect such issues to arise in Scheme, so
it’s best to not violate the rule of least surprise, IMO.

>>> +  (filter (lambda (p)
>>> +(and (pair? p)
>>> + (emacs-package? (package-name->name+version (first p)
>>
>> (match-lambda
>>   ((label . directory)
>>(emacs-package? (package-name+version directory
>>
>> (Which means the ‘first’ above should have been ‘second’?)
>
> I'm not sure I understand your comment:
> 'package-name->name+version' takes a package name, therefore I pass it
> the 1st element of each input.

The first element of an input is a label, which often happens to be a
package name, but doesn’t have to.  Would it be possible to extract the
package name from the directory name?

> (By the way, 'match-lambda' appears not to be documented in Guile.)

Oops.

> From e24d0b11280f4fcd106f371b98b7481f7c044eb0 Mon Sep 17 00:00:00 2001
> From: Federico Beffa 
> Date: Sun, 21 Jun 2015 10:10:05 +0200
> Subject: [PATCH 3/5] build: Add 'emacs-build-system'.
>
> * Makefile.am (MODULES): Add 'guix/build-system/emacs.scm' and
>   'guix/build/emacs-build-system.scm'.
> * guix/build-system/emacs.scm: New file.
> * guix/build/emacs-build-system.scm: New file.
> * doc/guix.texi (Build Systems): Document it.

[...]

> +(define (emacs-inputs-directories inputs)
> +  "Extract the list of Emacs package directories from INPUTS."
> +  (let ((emacs-ins (emacs-inputs inputs)))
> +(match emacs-ins
> +  (((name . dir) ...) dir

Minor issue, but I would s/emacs-ins/inputs/, s/dir/directories/,
s/name/names/.  (See the “Naming” section in
.)

OK to push with changes to this and ‘emacs-inputs’ as discussed above.

Thank you, and sorry for being as predictable and boring as you
expected.  ;-)

Ludo’.



[PATCH] Add libiberty.

2015-06-27 Thread Ricardo Wurmus
GCC 4.8.4 is the last GCC containing libiberty.a.  The attached patch
adds a package generator that creates a libiberty package for a given
GCC package.  It also adds a libiberty package for the default “gcc”.

>From 848a6b91a48abcfdc2eb0d9bbde6a0f22b019090 Mon Sep 17 00:00:00 2001
From: Ricardo Wurmus 
Date: Sat, 27 Jun 2015 11:47:04 +0200
Subject: [PATCH] gnu: Add libiberty.

* gnu/packages/gcc.scm (make-libiberty, libiberty): New variables.
---
 gnu/packages/gcc.scm | 35 +++
 1 file changed, 35 insertions(+)

diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm
index 4fc2e63..aba8565 100644
--- a/gnu/packages/gcc.scm
+++ b/gnu/packages/gcc.scm
@@ -373,6 +373,41 @@ using compilers other than GCC."
 (define-public libstdc++-4.9
   (make-libstdc++ gcc-4.9))
 
+(define (make-libiberty gcc)
+  "Return a libiberty package based on GCC."
+  (package
+(inherit gcc)
+(name "libiberty")
+(arguments
+ `(#:out-of-source? #t
+   #:phases
+   (modify-phases %standard-phases
+ (add-before 'configure 'chdir
+ (lambda _
+   (chdir "libiberty")
+   #t))
+ (replace
+  'install
+  (lambda* (#:key outputs #:allow-other-keys)
+(let* ((out (assoc-ref outputs "out"))
+   (lib (string-append out "/lib/"))
+   (include (string-append out "/include/")))
+  (mkdir-p lib)
+  (mkdir-p include)
+  (copy-file "libiberty.a"
+ (string-append lib "libiberty.a"))
+  (copy-file "../include/libiberty.h"
+ (string-append include "libiberty.h"))
+  #t))
+(inputs '())
+(outputs '("out"))
+(native-inputs '())
+(propagated-inputs '())
+(synopsis "Collection of subroutines used by various GNU programs")))
+
+(define-public libiberty
+  (make-libiberty gcc))
+
 (define* (custom-gcc gcc name languages #:key (separate-lib-output? #t))
   "Return a custom version of GCC that supports LANGUAGES."
   (package (inherit gcc)
-- 
2.4.3



[PATCH] Add libtar.

2015-06-27 Thread Ricardo Wurmus
>From 0039b2d36f77d19c92e07e02c7b3e829c485f355 Mon Sep 17 00:00:00 2001
From: Ricardo Wurmus 
Date: Sat, 27 Jun 2015 11:45:01 +0200
Subject: [PATCH] gnu: Add libtar.

* gnu/packages/compression.scm (libtar): New variable.
---
 gnu/packages/compression.scm | 21 +
 1 file changed, 21 insertions(+)

diff --git a/gnu/packages/compression.scm b/gnu/packages/compression.scm
index 1cf84a3..3935dbe 100644
--- a/gnu/packages/compression.scm
+++ b/gnu/packages/compression.scm
@@ -97,6 +97,27 @@ in compression.")
 utility.  Instead of being written in Java, FastJar is written in C.")
(license license:gpl2+)))
 
+(define-public libtar
+  (package
+   (name "libtar")
+   (version "1.2.11")
+   (source (origin
+(method url-fetch)
+(uri (string-append
+  "ftp://ftp.feep.net/pub/software/libtar/libtar-";
+  version ".tar.gz"))
+(sha256
+ (base32
+  "1f3vx1wa69a6c5y0z0aakd81gygirdcm0vimazg433q8nyvfybja"
+   (build-system gnu-build-system)
+   (arguments `(#:tests? #f)) ;no "check" target
+   (synopsis "C library for manipulating POSIX tar files")
+   (description
+"libtar is a C library for manipulating POSIX tar files.  It handles
+adding and extracting files to/from a tar archive.")
+   (home-page "http://www.feep.net/libtar/";)
+   (license license:bsd-3)))
+
 (define-public gzip
   (package
(name "gzip")
-- 
2.4.3





Re: [PATCH 1/5] import: Add 'elpa' importer

2015-06-27 Thread Federico Beffa
Oops, I've noticed that an unsupported repo was not handled gracefully.

On Thu, Jun 25, 2015 at 8:33 PM, Federico Beffa  wrote:
> Thanks for the review!
>
> I've made the suggested changes, except for the comments below.
>
> On Wed, Jun 24, 2015 at 11:06 PM, Ludovic Courtès  wrote:
>> Federico Beffa  skribis:
>>> +Specific command-line options are:
>>> +
>>> +@table @code
>>> +@item --archive=@var{repo}
>>> +@itemx -a @var{repo}
>>> +@var{repo} identifies the archive repository from which to retrieve the
>>> +information.  Currently the supported repositories and their identifiers
>>> +are:
>>> +@itemize -
>>> +@item
>>> +@uref{"http://elpa.gnu.org/packages";, GNU}, selected by the @code{gnu}
>>> +identifier.  This is the default.
>>> +
>>> +@item
>>> +@uref{"http://stable.melpa.org/packages";, MELPA-Stable}, selected by the
>>> +@code{melpa-stable} identifier.
>>> +
>>> +@item
>>> +@uref{"http://melpa.org/packages";, MELPA}, selected by the @code{melpa}
>>> +identifier.
>>> +@end itemize
>>
>> Perhaps REPO could also be a URL, in addition to one of these identifiers?
>
> Yeah, perhaps later.
>
>>> +;; Fetch URL, store the content in a temporary file and call PROC with that
>>> +;; file.
>>> +(define fetch-and-call-with-input-file
>>> +  (memoize
>>> +   (lambda* (url proc #:optional (err-msg "unavailable"))
>>> + (call-with-temporary-output-file
>>> +  (lambda (temp port)
>>> +(or (and (url-fetch url temp)
>>> + (call-with-input-file temp proc))
>>> +err-msg))
>>
>> Make the comment a docstring below ‘lambda*’.
>>
>> I would call it ‘call-with-downloaded-file’ for instance.  But then
>> memoization should be moved elsewhere, because that’s not one would
>> expect from a procedure with this name.
>
> I've deleted memoization because it's not really helping in any way
> here. It was helpful for experimenting in the REPL...
>
>>> +(define (package-home-page alist)
>>> +  "Extract the package home-page from ALIST."
>>> +  (or (lookup-extra alist ':url) "unspecified"))
>>
>> Maybe use the ‘elpa-package’ prefix instead of ‘package’ for procedures
>> like this one that expect an ELPA-package-as-an-alist?
>
> 'elpa-package-home-page' is already taken by a field accessor of the
> record . So, I've left it alone.
>
> Thanks,
> Fede
From 56c460213d76ff2b88fd771b48997c3e03200234 Mon Sep 17 00:00:00 2001
From: Federico Beffa 
Date: Tue, 16 Jun 2015 10:50:06 +0200
Subject: [PATCH 1/6] import: Add 'elpa' importer.

* guix/import/elpa.scm: New file.
* guix/scripts/import.scm: Add "elpa" to 'importers'.
* guix/scripts/import/elpa.scm: New file.
* Makefile.am (MODULES): Add 'guix/import/elpa.scm' and
  'guix/scripts/import/elpa.scm'.
  (SCM_TESTS): Add 'tests/elpa.scm'.
* doc/guix.texi (Invoking guix import): Document it.
* tests/elpa.scm: New file.
---
 Makefile.am  |   3 +
 doc/guix.texi|  28 ++
 guix/import/elpa.scm | 231 +++
 guix/scripts/import.scm  |   2 +-
 guix/scripts/import/elpa.scm |  98 ++
 tests/elpa.scm   | 109 
 6 files changed, 470 insertions(+), 1 deletion(-)
 create mode 100644 guix/import/elpa.scm
 create mode 100644 guix/scripts/import/elpa.scm
 create mode 100644 tests/elpa.scm

diff --git a/Makefile.am b/Makefile.am
index 2b84467..c027fb3 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -95,6 +95,7 @@ MODULES =	\
   guix/import/snix.scm\
   guix/import/cabal.scm\
   guix/import/hackage.scm			\
+  guix/import/elpa.scm   			\
   guix/scripts/download.scm			\
   guix/scripts/build.scm			\
   guix/scripts/archive.scm			\
@@ -111,6 +112,7 @@ MODULES =	\
   guix/scripts/import/gnu.scm			\
   guix/scripts/import/nix.scm			\
   guix/scripts/import/hackage.scm		\
+  guix/scripts/import/elpa.scm  		\
   guix/scripts/environment.scm			\
   guix/scripts/publish.scm			\
   guix.scm	\
@@ -182,6 +184,7 @@ SCM_TESTS =	\
   tests/packages.scm\
   tests/snix.scm\
   tests/hackage.scm\
+  tests/elpa.scm\
   tests/store.scm\
   tests/monads.scm\
   tests/gexp.scm\
diff --git a/doc/guix.texi b/doc/guix.texi
index 46dccb8..9ef6021 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -3770,6 +3770,34 @@ package name by a hyphen and a version number as in the following example:
 @example
 guix import hackage mtl-2.1.3.1
 @end example
+
+@item elpa
+@cindex elpa
+Import meta-data from an Emacs Lisp Package Archive (ELPA) package
+repository (@pxref{Packages,,, emacs, The GNU Emacs Manual}).
+
+Specific command-line options are:
+
+@table @code
+@item --archive=@var{repo}
+@itemx -a @var{repo}
+@var{repo} identifies the archive repository from which to retrieve the
+information.  Currently the supported repositories and their identifiers
+are:
+@itemize -
+@item
+@uref{"http://elpa.gnu.org/packages";, GNU}, selected by the @code{gnu}
+identifier.  This is the default.
+
+@item
+@uref{"http://stable.m