Paste number 330792: trilinos package

Paste number 330792: trilinos package
Pasted by: bavier
When:5 years, 10 months ago
Share:Tweet this! |
Paste contents:
Raw Source | XML | Display As
(define-public trilinos
    (name "trilinos")
    (version "12.8.1")
       (method url-fetch)
       (uri (list (string-append ""
                                 "trilinos-" version "-Source.tar.bz2")
                  (string-append ""
                                 "trilinos-" version "-Source.tar.bz2")))
       (file-name (string-append name "-" version ".tar.bz2"))
       (patches (map search-patch '("trilinos-superlu5.patch"
    (build-system cmake-build-system)
     `(("gfortran" ,gfortran)))
     `(("blas" ,openblas)
       ("lapack" ,lapack)
       ;; "TPL" libraries.
       ("suitesparse" ,suitesparse)     ;UMFPACK, AMD, Cholmod
       ("libiberty" ,libiberty)
       ("superlu" ,superlu)
       ("libx11" ,libx11)
       ("netcdf" ,netcdf)
       ("scotch" ,scotch)
       ("metis" ,metis)
       ("matio" ,matio)
       ("hwloc" ,hwloc)
       ("boost" ,boost)
       ("hdf5" ,hdf5)
       ("zlib" ,zlib)))
     `(#:parallel-tests? #t
         "-DTrilinos_ENABLE_TESTS:BOOL=NO" ;also builds examples
         ;; Build shared rather than static libraries

         ;; Enable optional package features
         "-DZoltan_ENABLE_METIS:BOOL=NO" ;no support for metis >= 5
         "-DZoltan2_ENABLE_AMD:BOOL=NO" ;

         ;; Disable packages
         "-DTrilinos_ENABLE_PyTrilinos:BOOL=NO"  ;requires python
         "-DTrilinos_ENABLE_STK:BOOL=NO"         ;requires MPI
         "-DTrilinos_ENABLE_Pike:BOOL=NO"        ;requires MPI
         "-DTrilinos_ENABLE_CTrilinos:BOOL=NO"   ;unmaintained
         "-DTrilinos_ENABLE_ForTrilinos:BOOL=NO" ;unmaintained

         ;; Enable third-party libraries that are not enabled by default
         ;; TPL-specific configurations
       #:modules ((ice-9 rdelim)
                  (ice-9 regex)
                  (srfi srfi-1)
                  (srfi srfi-26)
                  (guix build cmake-build-system)
                  (guix build utils))
       (modify-phases %standard-phases
         (delete 'check)
         (add-after 'install 'clean
           (lambda _
             (zero? (system* "make" "clean"))))
         (add-after 'clean 'install-check
           ;; Tests take a long time to build, and large amounts of disk space
           ;; (~10GiB build + ~4.5GiB tests) that can not be incrementaly
           ;; cleaned up since the "install" target depends on test binaries.
           ;; Use Trilinos's "installation testing" mechanism.  This allows
           ;; the initial build to be cleaned prior to testing, and allows
           ;; each package's tests to be cleaned after being run.
           (lambda* (#:key outputs configure-flags parallel-tests?
             (define (read-packages)
                   (string-append (assoc-ref outputs "out")
                 (let ((package-list-regexp
                        (make-regexp "^SET\\(Trilinos_PACKAGE_LIST \"(.*)\"\\)$")))
                   (lambda (port)
                     (let loop ()
                       (let* ((line (read-line port)))
                          ((eof-object? line) ;This should not happen!
                           (error "Failed to read enabled Trilinos packages"))
                          ((regexp-exec package-list-regexp line)
                           => (lambda (m)
                                (let ((packages (string-split (match:substring m 1)
                                  ;; Do not include "subpackages", since they
                                  ;; are tested together with their parent
                                  ;; package.
                                  (delete-duplicates packages string-prefix?))))

             (define (test-package package disable)
               (let ((dir (string-append "_test-" package))
                     (-j (format #f "-j~a" (parallel-job-count)))
                      (remove (cut string-match
                                "(ENABLE_ALL_PACKAGES|ENABLE_TESTS)" <>)
                 (mkdir-p dir)
                 (and (with-directory-excursion dir
                        (and (zero?
                              (apply system* "cmake"
                                      "-D" package "_ENABLE_TESTS:BOOL=YES")
                                      (assoc-ref outputs "out"))
                                      "-DTrilinos_ENABLE_" package "=YES")
                                     (string-append "../../trilinos-"
                                                    ,version "-Source")
                                     (append base-config-flags
                                             (map (cut string-append
                                                    "-D" <> "_DISABLE=YES")
                             ;; Some dependencies are improperly specified, so
                             ;; make may fail and tests still pass; use '-k'.
                             (zero? (system* "make" -j "-k"))
                             (zero? (system* "make" "test"
                                             (string-append "ARGS="
                                                            (if parallel-tests?
                                                                -j ""))))))
                      (begin (delete-file-recursively dir) #t))))

             (let ((skip '("Gtest"      ;no tests
                           "Moertel"    ;failed SEACAS tests
                           "STK"        ;ditto
                           "SEACAS"     ;missing exodusII_test.h
                           ;; Using *_DISABLE doesn't seem to work, so skip
                           ;; the whole suite.
                           ;; Headers missing issue when MPI
                           "MOOCHO"     ;tests take a *really* long time
                           "Zoltan2"))  ;missing zoltan_id.h, Epetra_MpiComm.h
                   (disable '("NOX_Thyra_Heq_MPI_1"
                              ;; See
                              ;; Error tolerance failure
               (every (cut test-package <> disable)
                      (remove (cut member <> skip)
    (home-page "")
    (synopsis "Solvers for engineering and scientific problems")
     "The Trilinos project is an effort to develop rebust algorithms and
enabling technologies within an object-oriented software framework for the
solution of large-scale, complex multi-physics engineering and scientific
    ;; Some packages are under LGPL, others under BSD 3-clause.  Some other
    ;; source is under other licenses.  See
    (license (list license:lgpl2.1+
                   license:public-domain ;murmurhash in Zoltan
                   license:asl2.0  ;Stokhos, bootstrap-transition.js in Common

(define-public trilinos-openmpi
  (package (inherit trilinos)
    (name "trilinos-openmpi")
     `(("mpi" ,openmpi)
       ("mumps" ,mumps-openmpi)         ;MUMPS is only supported with MPI.
       ("pt-scotch" ,pt-scotch)
       ("scalapack" ,scalapack)
       ("hdf5" ,hdf5-parallel-openmpi)
       ("netcdf" ,netcdf-parallel-openmpi)
       ,@(fold alist-delete
               (package-inputs trilinos)
               '("hdf5" "netcdf" "scotch"))))
     (substitute-keyword-arguments (package-arguments trilinos)
       ((#:configure-flags flags)
        `(append ,flags
                   ,(string-append "-DTPL_MUMPS_LIBRARIES="
                   "-DZoltan_ENABLE_F90INTERFACE:BOOL=YES" ;only works with MPI
       ((#:parallel-tests? _) #f)))
    (synopsis "Parallel solvers for engineering and scientific problems")))

This paste has no annotations.

Colorize as:
Show Line Numbers

Lisppaste pastes can be made by anyone at any time. Imagine a fearsomely comprehensive disclaimer of liability. Now fear, comprehensively.