From patchwork Thu Jul 29 16:33:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Paul A. Patience" X-Patchwork-Id: 31644 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id A409B27BC78; Thu, 29 Jul 2021 17:35:14 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS, T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id E860B27BC6B for ; Thu, 29 Jul 2021 17:35:13 +0100 (BST) Received: from localhost ([::1]:42946 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m9904-000802-RW for patchwork@mira.cbaines.net; Thu, 29 Jul 2021 12:35:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36272) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m98yw-0006yp-QU for guix-patches@gnu.org; Thu, 29 Jul 2021 12:34:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:46594) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m98yw-0002ub-Ik for guix-patches@gnu.org; Thu, 29 Jul 2021 12:34:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m98yv-0002ZS-Rj for guix-patches@gnu.org; Thu, 29 Jul 2021 12:34:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49772] [PATCH] gnu: dealii-openmpi: Add Trilinos dependency. Resent-From: "Paul A. Patience" Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 29 Jul 2021 16:34:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 49772 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 49772@debbugs.gnu.org X-Debbugs-Original-To: "guix-patches@gnu.org" Received: via spool by submit@debbugs.gnu.org id=B.16275764169836 (code B ref -1); Thu, 29 Jul 2021 16:34:01 +0000 Received: (at submit) by debbugs.gnu.org; 29 Jul 2021 16:33:36 +0000 Received: from localhost ([127.0.0.1]:58140 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m98yR-0002YW-H4 for submit@debbugs.gnu.org; Thu, 29 Jul 2021 12:33:36 -0400 Received: from lists.gnu.org ([209.51.188.17]:56306) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m98yP-0002YO-Sv for submit@debbugs.gnu.org; Thu, 29 Jul 2021 12:33:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36136) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m98yM-0006Jz-BP for guix-patches@gnu.org; Thu, 29 Jul 2021 12:33:29 -0400 Received: from mail-4317.protonmail.ch ([185.70.43.17]:59499) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m98yI-0002Sx-EL for guix-patches@gnu.org; Thu, 29 Jul 2021 12:33:25 -0400 Date: Thu, 29 Jul 2021 16:33:14 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=apatience.com; s=protonmail3; t=1627576396; bh=Q5KQk/no+NI8rBQ6Mi8t65OSCa1lNR0gs28nDz09Xt0=; h=Date:To:From:Reply-To:Subject:From; b=dXAqCEjF7itYhafDesm42QQ1Gvisd4mwTT8zlJfG4438ZyxoKtrloYX6FiMoihaZH n+SJJWzG35inGBC1uLPBPGfTV986sJYePW/zEU/vsbLTibyKsmH9XzRUxb3uBw/NAM cYctMWyXV4UyT63Es5X+IC+eTN//u2x/JKitE4t+lWP1/32Xy8j7harh+Yhk0WvCy1 U4jHUElQj6Numx2362Pk/1HCn9Xu2/Ns3Vke4mGa0iGxHm45zPdLNC7QwTyzZtjc1p xlRcbsVeglg7KwyJiOg9H1lviUYOTrnCEV0zoIaLeaOZY8V/siC1VfzQtyk9pAQCP7 JsQ59mBstzxrg== From: "Paul A. Patience" Message-ID: MIME-Version: 1.0 Received-SPF: pass client-ip=185.70.43.17; envelope-from=paul@apatience.com; helo=mail-4317.protonmail.ch X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: "Paul A. Patience" Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches Hi, This patch adds the optional dependency Trilinos to dealii-openmpi. (Starting from deal.II 10.0.0, the Trilinos interface will require MPI, and anyway parts of deal.II's Trilinos interface do not compile properly without MPI even in earlier versions.) This patch is necessary for me to package Lethe [1] next, which requires deal.II to be compiled with Trilinos support. Best regards, Paul [1]: https://github.com/lethe-cfd/lethe From f0d377b93996d9b08cdd4edb9567b0bc2941e593 Mon Sep 17 00:00:00 2001 From: "Paul A. Patience" Date: Thu, 29 Jul 2021 12:16:32 -0400 Subject: [PATCH] gnu: dealii-openmpi: Add Trilinos dependency. * gnu/packages/maths.scm (trilinos-for-dealii-openmpi): New variable. (dealii-openmpi)[propagated-inputs]: Add trilinos-for-dealii-openmpi. --- gnu/packages/maths.scm | 148 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 148 insertions(+) diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm index 13c8338f5c..10996dacc9 100644 --- a/gnu/packages/maths.scm +++ b/gnu/packages/maths.scm @@ -4608,6 +4608,153 @@ specifications.") revised simplex and the branch-and-bound methods.") (license license:lgpl2.1+))) +;; Private Trilinos package for dealii-openmpi (similar to +;; trilinos-serial-xyce and trilinos-parallel-xyce). +;; This version is the latest known to be compatible with deal.II [1]. +;; Since the latest version of Trilinos is not necessarily supported by +;; deal.II, it may be worth keeping this package even if and when Trilinos +;; gets packaged separately for Guix (unless various versions of Trilinos are +;; packaged). +;; +;; An insightful source of information for building Trilinos for deal.II lies +;; in the Trilinos package for candi [2], which is a source-based installer +;; for deal.II and its dependencies. +;; +;; [1]: https://www.dealii.org/current/external-libs/trilinos.html +;; [2]: https://github.com/dealii/candi/blob/master/deal.II-toolchain/packages/trilinos.package +(define trilinos-for-dealii-openmpi + (package + (name "trilinos-for-dealii-openmpi") + (version "12.18.1") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/trilinos/Trilinos/") + (commit + (string-append "trilinos-release-" + (string-replace-substring version "." "-"))))) + (file-name (git-file-name "trilinos" version)) + (sha256 + (base32 "0fnwlhzsh85qj38cq3igbs8nm1b2jdgr2z734sapmyyzsy21mkgp")))) + (build-system cmake-build-system) + (native-inputs + `(("gfortran" ,gfortran) + ;; Trilinos's repository contains several C-shell scripts, but adding + ;; tcsh to the native inputs does not result in the check phase running + ;; any more tests than without it (nor is tcsh required to build + ;; Trilinos). + ;; It seems that Trilinos has replaced its use of C-shell test scripts + ;; with CMake's testing facilities. + ;; For example, + ;; packages/zoltan/doc/Zoltan_html/dev_html/dev_test_script.html [1] + ;; states that Zoltan's C-shell test script + ;; packages/zoltan/test/test_zoltan has been obsoleted by the tests now + ;; performed through CMake. + ;; + ;; Perl is required for some Zoltan tests and Python 2 for one ML test. + ;; + ;; [1]: https://cs.sandia.gov/zoltan/dev_html/dev_test_script.html + ("perl" ,perl) + ("python" ,python-2))) + (inputs + `(("blas" ,openblas) + ("lapack" ,lapack) + ("mumps" ,mumps-openmpi) + ("scalapack" ,scalapack))) + (propagated-inputs + `(("mpi" ,openmpi))) + (arguments + `(#:build-type "Release" + #:configure-flags + `("-DBUILD_SHARED_LIBS=ON" + ;; Obtain the equivalent of RelWithDebInfo but with -O3 (the Release + ;; default) rather than -O2 (the RelWithDebInfo default), to conform + ;; to candi's trilinos.package's compilation flags, which are -g -O3. + "-DCMAKE_C_FLAGS=-g" + "-DCMAKE_CXX_FLAGS=-g" + "-DCMAKE_Fortran_FLAGS=-g" + + ;; Trilinos libraries that deal.II can interface with. + "-DTrilinos_ENABLE_Amesos=ON" + "-DTrilinos_ENABLE_AztecOO=ON" + "-DTrilinos_ENABLE_Epetra=ON" + "-DTrilinos_ENABLE_EpetraExt=ON" + "-DTrilinos_ENABLE_Ifpack=ON" + "-DTrilinos_ENABLE_ML=ON" + "-DTrilinos_ENABLE_MueLu=ON" + "-DTrilinos_ENABLE_ROL=ON" + ;; Optional; required for deal.II's GridIn::read_exodusii, but + ;; depends on netcdf. + ;; Enable if and when someone needs it. + ;;"-DTrilinos_ENABLE_SEACAS=ON" + "-DTrilinos_ENABLE_Sacado=ON" + "-DTrilinos_ENABLE_Teuchos=ON" + "-DTrilinos_ENABLE_Tpetra=ON" + "-DTrilinos_ENABLE_Zoltan=ON" + + ;; Third-party libraries (TPLs) that Trilinos can interface with. + "-DBLAS_LIBRARY_NAMES=openblas" + "-DTPL_ENABLE_MPI=ON" + "-DTPL_ENABLE_MUMPS=ON" + "-DTPL_ENABLE_SCALAPACK=ON" + + ;; Enable the tests but not the examples (the examples are disabled + ;; by default). + ;; Although some examples are run as tests, they are otherwise + ;; unnecessary since this is a private package meant for + ;; dealii-openmpi. + ;; Besides, some MueLu and ROL examples require a lot of memory to + ;; compile. + ;; + ;; (For future reference, note that some ROL and SEACAS examples + ;; require removing gfortran from CPLUS_INCLUDE_PATH as in the + ;; dune-istl, dune-localfunctions and dune-alugrid packages.) + "-DTrilinos_ENABLE_TESTS=ON" + ;; MueLu tests require considerably more time and memory to compile + ;; than the rest of the tests. + "-DMueLu_ENABLE_TESTS=OFF" + + ;; The following options were gleaned from candi's trilinos.package. + ;; (We do not enable the complex instantiations, which are anyway + ;; provided only as an option in trilinos.package, because they are + ;; costly in compilation time and memory usage, and disk space [1].) + ;; + ;; [1]: https://www.docs.trilinos.org/files/TrilinosBuildReference.html#enabling-float-and-complex-scalar-types + "-DTrilinos_ENABLE_Ifpack2=OFF" + "-DTeuchos_ENABLE_FLOAT=ON" + "-DTpetra_INST_INT_LONG=ON" + "-DTPL_ENABLE_Boost=OFF") + #:phases + (modify-phases %standard-phases + (add-after 'configure 'fix-kokkos-config + (lambda _ + ;; GNU Make 4.3 accidentally leaves the backslash preceding the + ;; number sign in strings containing a literal backslash–number + ;; sign (\#) [1, 2]. + ;; This is still an issue in Trilinos 13.0.1, but should be fixed + ;; in the following version. + ;; (The latest versions of Kokkos incorporate the fix [2].) + ;; + ;; [1]: https://github.com/GEOSX/thirdPartyLibs/issues/136 + ;; [2]: https://github.com/kokkos/kokkos/blob/3.4.00/Makefile.kokkos#L441 + (substitute* "KokkosCore_config.h" + (("\\\\#") "#")) + #t)) + (add-before 'check 'mpi-setup + ,%openmpi-setup)))) + (home-page "https://trilinos.github.io/") + (synopsis "Algorithms for engineering and scientific problems") + (description + "The Trilinos Project is an effort to develop algorithms and enabling +technologies within an object-oriented software framework for the solution of +large-scale, complex multi-physics engineering and scientific problems. +A unique design feature of Trilinos is its focus on packages.") + ;; The packages are variously licensed under more than just BSD-3 and + ;; LGPL-2.1+, but all the licenses are either BSD- or LGPL-compatible. + ;; See https://trilinos.github.io/license.html. + (license (list license:bsd-3 license:lgpl2.1+)))) + (define-public dealii (package (name "dealii") @@ -4703,6 +4850,7 @@ in finite element programs.") ("p4est" ,p4est-openmpi) ("petsc" ,petsc-openmpi) ("slepc" ,slepc-openmpi) + ("trilinos" ,trilinos-for-dealii-openmpi) ,@(alist-delete "hdf5" (package-propagated-inputs dealii)))) (arguments (substitute-keyword-arguments (package-arguments dealii) -- 2.32.0