From mboxrd@z Thu Jan 1 00:00:00 1970 From: ericbavier@openmailbox.org Subject: [PATCH 14/14] gnu: Add deal.II. Date: Sat, 27 Jun 2015 22:45:51 -0500 Message-ID: <1435463151-32099-15-git-send-email-ericbavier@openmailbox.org> References: <1435463151-32099-1-git-send-email-ericbavier@openmailbox.org> Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:45120) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z93Wj-0001G9-Sm for guix-devel@gnu.org; Sat, 27 Jun 2015 23:45:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z93Wh-0003q6-6H for guix-devel@gnu.org; Sat, 27 Jun 2015 23:45:05 -0400 Received: from smtp23.openmailbox.org ([62.4.1.57]:38552) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z93Wg-0003oq-T8 for guix-devel@gnu.org; Sat, 27 Jun 2015 23:45:03 -0400 In-Reply-To: <1435463151-32099-1-git-send-email-ericbavier@openmailbox.org> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: guix-devel@gnu.org Cc: Eric Bavier 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) ;configure supports only metis orderings + ("arpack" ,arpack-ng-openmpi) + ,@(fold alist-delete (package-inputs deal.II) + '("p4est" "arpack")))) + (arguments + (substitute-keyword-arguments (package-arguments deal.II) + ((#:configure-flags cf) + ``("-DMPI_C_COMPILER=mpicc" + "-DMPI_CXX_COMPILER=mpicxx" + "-DMPI_Fortran_COMPILER=mpifort" + ,@,cf)))) + (synopsis "Finite element library (with MPI support)"))) diff --git a/gnu/packages/patches/deal.II-p4est-interface.patch b/gnu/packages/patches/deal.II-p4est-interface.patch new file mode 100644 index 0000000..4c4125d --- /dev/null +++ b/gnu/packages/patches/deal.II-p4est-interface.patch @@ -0,0 +1,62 @@ +From upstream commit f764598c. + +The p4est_connectivity_load function used to take an unsigned long as argument, +but this has been changed to size_t in p4est 1.0. This makes no difference on +64 bit systems, but leads to compiler errors on 32 bit systems. Fix this. + +--- a/source/distributed/tria.cc ++++ b/source/distributed/tria.cc +@@ -204,7 +204,11 @@ namespace internal + static + int (&connectivity_is_valid) (types<2>::connectivity *connectivity); + +-#if DEAL_II_P4EST_VERSION_GTE(0,3,4,3) ++#if DEAL_II_P4EST_VERSION_GTE(1,0,0,0) ++ static ++ types<2>::connectivity *(&connectivity_load) (const char *filename, ++ size_t *length); ++#elif DEAL_II_P4EST_VERSION_GTE(0,3,4,3) + static + types<2>::connectivity *(&connectivity_load) (const char *filename, + long unsigned *length); +@@ -384,7 +388,12 @@ namespace internal + *connectivity) + = p4est_connectivity_is_valid; + +-#if DEAL_II_P4EST_VERSION_GTE(0,3,4,3) ++#if DEAL_II_P4EST_VERSION_GTE(1,0,0,0) ++ types<2>::connectivity * ++ (&functions<2>::connectivity_load) (const char *filename, ++ size_t *length) ++ = p4est_connectivity_load; ++#elif DEAL_II_P4EST_VERSION_GTE(0,3,4,3) + types<2>::connectivity * + (&functions<2>::connectivity_load) (const char *filename, + long unsigned *length) +@@ -564,7 +573,11 @@ namespace internal + static + int (&connectivity_is_valid) (types<3>::connectivity *connectivity); + +-#if DEAL_II_P4EST_VERSION_GTE(0,3,4,3) ++#if DEAL_II_P4EST_VERSION_GTE(1,0,0,0) ++ static ++ types<3>::connectivity *(&connectivity_load) (const char *filename, ++ size_t *length); ++#elif DEAL_II_P4EST_VERSION_GTE(0,3,4,3) + static + types<3>::connectivity *(&connectivity_load) (const char *filename, + long unsigned *length); +@@ -747,7 +760,12 @@ namespace internal + *connectivity) + = p8est_connectivity_is_valid; + +-#if DEAL_II_P4EST_VERSION_GTE(0,3,4,3) ++#if DEAL_II_P4EST_VERSION_GTE(1,0,0,0) ++ types<3>::connectivity * ++ (&functions<3>::connectivity_load) (const char *filename, ++ size_t *length) ++ = p8est_connectivity_load; ++#elif DEAL_II_P4EST_VERSION_GTE(0,3,4,3) + types<3>::connectivity * + (&functions<3>::connectivity_load) (const char *filename, + long unsigned *length) -- 2.2.1