~ruther/guix-local

d4709d78c3b460d7be02f15f6cc6c85f398b1a46 — Ludovic Courtès 4 years ago 64fcf95
gnu: scotch: Update to 7.0.1.

* gnu/packages/maths.scm (scotch): Update to 7.0.1.
[source]: Switch to 'git-fetch'.
[build-system]: Switch to CMAKE-BUILD-SYSTEM.
[arguments]: Add #:configure-flags.  Remove #:make-flags.  Remove
'chdir-to-src', 'configure', and 'build-esmumps' phases.
[properties]: Update 'release-monitoring-url' property.
(scotch32, pt-scotch, pt-scotch32): Update accordingly, replacing now
useless build phases with #:configure-flags.
(scotch-shared, pt-scotch-shared): Mark as deprecated.
(mumps)[arguments]: In 'configure' phase, use '-lesmumps'
unconditionally, since that's now how pt-scotch calls it.
1 files changed, 52 insertions(+), 219 deletions(-)

M gnu/packages/maths.scm
M gnu/packages/maths.scm => gnu/packages/maths.scm +52 -219
@@ 3606,7 3606,7 @@ IORDERINGSC  = $(IPORD) $(IMETIS) $(ISCOTCH)"
                           `((,scotch "" "-Dscotch")))
                          ((ptscotch _)
                           `((,ptscotch
                              "-lptesmumps -lptscotch -lptscotcherr "
                              "-lesmumps -lptscotch -lptscotcherr "
                              "-Dptscotch")))))))))
         (replace 'build
          ;; By default only the d-precision library is built.  Make with "all"


@@ 3869,91 3869,43 @@ implemented in ANSI C, and MPI for communications.")
(define-public scotch
  (package
    (name "scotch")
    (version "6.1.1")
    (version "7.0.1")
    (source
     (origin
      (method url-fetch)
      (uri (string-append "https://gforge.inria.fr/frs/download.php/"
                          "latestfile/298/scotch_" version ".tar.gz"))
      (sha256
       (base32 "04dkz24a2g20wq703fnyi4440ac4mwycy9gwrrllljj7zxcjy19r"))
      (patches (search-patches "scotch-build-parallelism.patch"
                               "scotch-integer-declarations.patch"))))
    (build-system gnu-build-system)
       (method git-fetch)
       (uri (git-reference
             (url "https://gitlab.inria.fr/scotch/scotch")
             (commit (string-append "v" version))))
       (file-name (git-file-name name version))
       (sha256
        (base32 "1fvgxd3ipl5xswswyadvxvlcgv6an8c229ispnlksgnlwphg10ig"))))
    (build-system cmake-build-system)
    (inputs
     (list zlib))
    (native-inputs
     (list flex bison gfortran))
    (outputs '("out" "metis"))
    (arguments
     `(#:make-flags (list (string-append "prefix=" %output))
     `(#:configure-flags '("-DBUILD_SHARED_LIBS=YES"
                           "-DBUILD_PTSCOTCH=OFF")
       #:phases
       (modify-phases %standard-phases
         (add-after
          'unpack 'chdir-to-src
          (lambda _ (chdir "src") #t))
         (replace
          'configure
          (lambda _
            (call-with-output-file "Makefile.inc"
              (lambda (port)
                (format port "
EXE =
LIB = .a
OBJ = .o
MAKE = make
AR = ar
ARFLAGS = -ruv
CAT = cat
CCS = gcc
CCP = mpicc
CCD = gcc
FC = gfortran
CPPFLAGS =~{ -D~a~}
CFLAGS = -O2 -g -fPIC $(CPPFLAGS)
LDFLAGS = -lz -lm -lrt -lpthread
CP = cp
LEX = flex -Pscotchyy -olex.yy.c
LN = ln
MKDIR = mkdir
MV = mv
RANLIB = ranlib
YACC = bison -pscotchyy -y -b y
"
                        '("COMMON_FILE_COMPRESS_GZ"
                          "COMMON_PTHREAD"
                          "COMMON_RANDOM_FIXED_SEED"
                          "INTSIZE64"             ;use 'int64_t'
                          ;; Prevents symbol clashes with libesmumps
                          "SCOTCH_RENAME"
                          ;; XXX: Causes invalid frees in superlu-dist tests
                          ;; "SCOTCH_PTHREAD"
                          ;; "SCOTCH_PTHREAD_NUMBER=2"
                          "restrict=__restrict"))))
            #t))
         (add-after 'build 'build-esmumps
          (lambda _
            (invoke "make"
                    (format #f "-j~a" (parallel-job-count))
                    "esmumps")))
         (add-before 'install 'make-install-dirs
           (lambda* (#:key outputs #:allow-other-keys)
             (mkdir (assoc-ref outputs "out"))))
         (add-after 'install 'install-metis
           (lambda* (#:key outputs #:allow-other-keys)
             (let ((out (assoc-ref outputs "metis")))
               (mkdir out)
               ;; metis files are not installed with 'make install'
               (for-each (lambda (f)
                           (install-file f (string-append out "/include")))
                         (find-files "../include/" ".*metis\\.h"))
               (for-each (lambda (f)
                           (install-file f (string-append out "/lib")))
                         (find-files "../lib/" ".*metis\\..*"))
               #t))))))
             (let* ((out    (assoc-ref outputs "out"))
                    (metis  (assoc-ref outputs "metis"))
                    (prefix (string-length out)))
               (for-each (lambda (file)
                           (let ((target (string-append
                                          metis
                                          (string-drop file prefix))))
                             (mkdir-p (dirname target))
                             (rename-file file target)))
                         (find-files out "metis"))))))))
    (home-page "https://www.labri.fr/perso/pelegrin/scotch/")
    (properties
     `((release-monitoring-url . "https://gforge.inria.fr/frs/?group_id=248")))
     `((release-monitoring-url
        . "https://gitlab.inria.fr/scotch/scotch/-/releases")))
    (synopsis "Programs and libraries for graph algorithms")
    (description "SCOTCH is a set of programs and libraries which implement
the static mapping and sparse matrix reordering algorithms developed within


@@ 3968,176 3920,57 @@ bio-chemistry.")
(define-public scotch32
  ;; This is the 'INTSIZE32' variant, which uses 32-bit integers, as needed by
  ;; some applications.
  (package (inherit scotch)
  (package
    (inherit scotch)
    (name "scotch32")
    (arguments
     (substitute-keyword-arguments (package-arguments scotch)
       ((#:phases scotch-phases)
        `(modify-phases ,scotch-phases
          (replace
           'configure
           (lambda _
             (call-with-output-file "Makefile.inc"
               (lambda (port)
                 (format port "
EXE =
LIB = .a
OBJ = .o
MAKE = make
AR = ar
ARFLAGS = -ruv
CAT = cat
CCS = gcc
CCP = mpicc
CCD = gcc
FC = gfortran
CPPFLAGS =~{ -D~a~}
CFLAGS = -O2 -g -fPIC $(CPPFLAGS)
LDFLAGS = -lz -lm -lrt -lpthread
CP = cp
LEX = flex -Pscotchyy -olex.yy.c
LN = ln
MKDIR = mkdir
MV = mv
RANLIB = ranlib
YACC = bison -pscotchyy -y -b y
"
                        '("COMMON_FILE_COMPRESS_GZ"
                          "COMMON_PTHREAD"
                          "COMMON_RANDOM_FIXED_SEED"
                          "INTSIZE32"   ;use 32-bit integers.  See INSTALL.txt
                          ;; Prevents symbolc clashes with libesmumps
                          "SCOTCH_RENAME"
                          ;; XXX: Causes invalid frees in superlu-dist tests
                          ;; "SCOTCH_PTHREAD"
                          ;; "SCOTCH_PTHREAD_NUMBER=2"
                          "restrict=__restrict"))))))))))
       ((#:configure-flags flags ''())
        ''("-DBUILD_SHARED_LIBS=YES" "-DBUILD_PTSCOTCH=OFF"
           "-DCMAKE_C_FLAGS=-DINTSIZE32=1"))))
    (synopsis
     "Programs and libraries for graph algorithms (32-bit integers)")))

(define-public scotch-shared
  (package (inherit scotch)
    (name "scotch-shared")
    (native-inputs
     (list gcc flex bison))
    (arguments
     (substitute-keyword-arguments (package-arguments scotch)
       ((#:phases scotch-shared-phases)
        `(modify-phases ,scotch-shared-phases
           (replace
            'configure
           (lambda _
             ;; Otherwise, the RUNPATH will lack the final path component.
             (setenv "RPATHFLAGS" (string-append "-Wl,-rpath="
                                              (assoc-ref %outputs "out") "/lib"))
            (call-with-output-file "Makefile.inc"
              (lambda (port)
                (format port "
EXE =
LIB = .so
OBJ = .o
MAKE = make
AR = gcc
ARFLAGS = -shared -o
CAT = cat
CCS = gcc
CCP = mpicc
CCD = gcc
FC = gfortran
CPPFLAGS =~{ -D~a~}
CFLAGS = -O2 -g -fPIC $(CPPFLAGS) $(RPATHFLAGS)
CLIBFLAGS = -shared -fPIC
LDFLAGS = -lz -lm -lrt -lpthread -Xlinker --no-as-needed
CP = cp
LEX = flex -Pscotchyy -olex.yy.c
LN = ln
MKDIR = mkdir
MV = mv
RANLIB = echo
YACC = bison -pscotchyy -y -b y
"
                        '("COMMON_FILE_COMPRESS_GZ"
                          "COMMON_PTHREAD"
                          "COMMON_RANDOM_FIXED_SEED"
                          "INTSIZE64"             ;use 'int64_t'
                          ;; Prevents symbolc clashes with libesmumps
                          "SCOTCH_RENAME"
                          ;; XXX: Causes invalid frees in superlu-dist tests
                          ;; "SCOTCH_PTHREAD"
                          ;; "SCOTCH_PTHREAD_NUMBER=2"
                          "restrict=__restrict"
                          ))))#t))
           (delete 'check)))))
     (synopsis
      "Programs and libraries for graph algorithms (shared libraries version)")))

(define-public pt-scotch
  (package (inherit scotch)
  (package
    (inherit scotch)
    (name "pt-scotch")
    (propagated-inputs
     (list openmpi))           ;Headers include MPI headers
     (list openmpi))                              ;headers include MPI headers
    (arguments
     (substitute-keyword-arguments (package-arguments scotch)
       ((#:phases scotch-phases)
        `(modify-phases ,scotch-phases
           (replace
            'build
            (lambda _
              (invoke "make" (format #f "-j~a" (parallel-job-count))
                      "ptscotch" "ptesmumps")

              ;; Install the serial metis compatibility library
              (invoke "make" "-C" "libscotchmetis" "install")))
       ((#:configure-flags flags ''())
        ''("-DBUILD_SHARED_LIBS=YES" "-DBUILD_PTSCOTCH=ON"))
       ((#:phases phases '%standard-phases)
        `(modify-phases ,phases
           (add-before 'check 'mpi-setup
	     ,%openmpi-setup)
           (replace 'check
             (lambda _
               (invoke "make" "ptcheck")))))))
             ,%openmpi-setup)))))
    (synopsis "Programs and libraries for graph algorithms (with MPI)")))

(define-public pt-scotch32
  (package (inherit scotch32)
  (package
    (inherit pt-scotch)
    (name "pt-scotch32")
    (propagated-inputs
     (list openmpi))                     ;headers include MPI headers
    (arguments
     (substitute-keyword-arguments (package-arguments scotch32)
       ((#:phases scotch32-phases)
        `(modify-phases ,scotch32-phases
           (replace 'build
             (lambda _
               (invoke "make" (format #f "-j~a" (parallel-job-count))
                       "ptscotch" "ptesmumps")
               ;; Install the serial metis compatibility library
               (invoke "make" "-C" "libscotchmetis" "install")))
           (add-before 'check 'mpi-setup
	     ,%openmpi-setup)
           (replace 'check
             (lambda _
               (invoke "make" "ptcheck")))))))
     (substitute-keyword-arguments (package-arguments pt-scotch)
       ((#:configure-flags flags ''())
        ''("-DBUILD_SHARED_LIBS=YES" "-DBUILD_PTSCOTCH=ON"
           "-DCMAKE_C_FLAGS=-DINTSIZE32=1"))))
    (synopsis
     "Programs and libraries for graph algorithms (with MPI and 32-bit integers)")))

(define-public pt-scotch-shared
  (package (inherit scotch-shared)
    (name "pt-scotch-shared")
    (propagated-inputs
     (list openmpi))           ;Headers include MPI headers
    (arguments
     (substitute-keyword-arguments (package-arguments scotch-shared)
       ((#:phases scotch-shared-phases)
        `(modify-phases ,scotch-shared-phases
           (replace
            'build
            (lambda _
              (invoke "make" (format #f "-j~a" (parallel-job-count))
                      "ptscotch" "ptesmumps")
(define-public scotch-shared
  ;; There used to be separate shared library variants while the default would
  ;; provide .a files including PIC objects.  With the switch to CMake, .a
  ;; files contain non-PIC objects, which breaks some users, and switching to
  ;; shared libraries by default seems to make more sense, as discussed here:
  ;; <https://issues.guix.gnu.org/47619#2>.
  (deprecated-package "scotch-shared" scotch))

              ;; Install the serial metis compatibility library
              (invoke "make" "-C" "libscotchmetis" "install")))
           (add-before 'check 'mpi-setup
             ,%openmpi-setup)))))
    (synopsis "Graph algorithms (shared libraries version, with MPI)")))
(define-public pt-scotch-shared
  (deprecated-package "pt-scotch-shared" pt-scotch))


(define-public metis