From 61278697659c4368f3f4806337f77f8695644204 Mon Sep 17 00:00:00 2001 From: "Paul A. Patience" Date: Wed, 11 Aug 2021 22:34:22 -0400 Subject: [PATCH 5/6] gnu: sundials: Update to 5.7.0. This commit notably changes SUNDIALS's index size to 32 bits rather than 64 bits, because it is otherwise incompatible with PETSc's 32-bit indices. The default index size in SUNDIALS 3.1.1 was also 64 bits (though it was configured through the SUNDIALS_INDEX_TYPE CMake variable, which could take the values INT64_T or INT32_T), but the configure script didn't warn of any incompatibility with PETSc's 32-bit indices. It is unclear whether this was an accidental omission from the configure script or if SUNDIALS's index size didn't have to correspond to PETSc's at the time. Keeping 64-bit indices in SUNDIALS would require adding a package for PETSc with 64-bit indices (using the --with-64-bit-indices configure flag), possibly named petsc64-openmpi (to follow the style of the SCOTCH packages, i.e., scotch, scotch32, etc., though there the unadorned package name represents the 64-bit version, unlike the unadorned petsc), which would in turn require a package for METIS with 64-bit indices (using IDXTYPEWIDTH=64). However, SUNDIALS is an optional dependency of deal.II, both of which have PETSc as an optional dependency, and deal.II's index size (which defaults to 32 bits) must match PETSc's. In other words, the current deal.II package can build with SUNDIALS only if SUNDIALS has 32-bit indices. Furthermore, users needing 64-bit indices in SUNDIALS probably also need them in PETSc and other libraries. If and when 64-bit indices are deemed necessary, we can add all the package variations at once (for SUNDIALS, PETSc, METIS, deal.II and any others). * gnu/packages/maths.scm (sundials)[version]: Update to 5.7.0. [source]{uri}: Update to that linked from SUNDIALS's home page. [native-inputs]: Replace python-2 with python-wrapper. [arguments]<#:configure-flags>: Add -DSUNDIALS_INDEX_SIZE=32 to match PETSc's 32-bit indices. Replace -DFCMIX_ENABLE with -DBUILD_FORTRAN77_INTERFACE. Rename KLU_ENABLE to ENABLE_KLU. (sundials-openmpi)[arguments]<#:configure-flags>: Rename MPI_ENABLE, HYPRE_ENABLE and PETSC_ENABLE to ENABLE_MPI, ENABLE_HYPRE and ENABLE_PETSC, respectively. Replace -DPETSC_INCLUDE_DIR and -DPETSC_LIBRARY_DIR with -DPETSC_DIR. --- gnu/packages/maths.scm | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm index 8ca9505985..980460fa85 100644 --- a/gnu/packages/maths.scm +++ b/gnu/packages/maths.scm @@ -5679,33 +5679,39 @@ and comparisons are supported.") (define-public sundials (package (name "sundials") - (version "3.1.1") + (version "5.7.0") (source (origin (method url-fetch) - (uri (string-append "https://computation.llnl.gov/projects/sundials/download/" - "sundials-" version ".tar.gz")) + (uri (string-append "https://github.com/LLNL/sundials/releases/download/v" + version "/sundials-" version ".tar.gz")) (sha256 - (base32 "090s8ymhd0g1s1d44fa73r5yi32hb4biwahhbfi327zd64yn8kd2")))) + (base32 "0hqa20x3180s04s7dxmc4bmbykxv3lnxh0hvxlmb5pajh6m7pnj8")))) (build-system cmake-build-system) (native-inputs - `(("python" ,python-2))) ; For tests; syntax incompatible with Python 3. + `(("python" ,python-wrapper))) ; For tests. (inputs `(("blas" ,openblas) - ("gfortran" ,gfortran) ; For FCMIX. + ("gfortran" ,gfortran) ("suitesparse" ,suitesparse))) (arguments `(#:configure-flags (let ((suitesparse (assoc-ref %build-inputs "suitesparse"))) - `("-DEXAMPLES_ENABLE_C:BOOL=ON" + `("-DSUNDIALS_INDEX_SIZE=32" + + "-DEXAMPLES_ENABLE_C:BOOL=ON" "-DEXAMPLES_ENABLE_CXX:BOOL=ON" "-DEXAMPLES_ENABLE_F77:BOOL=ON" "-DEXAMPLES_ENABLE_F90:BOOL=ON" + ;; Requires -DBUILD_FORTRAN_MODULE_INTERFACE:BOOL=ON. + ;;"-DEXAMPLES_ENABLE_F2003:BOOL=ON" "-DEXAMPLES_INSTALL:BOOL=OFF" - "-DFCMIX_ENABLE:BOOL=ON" + "-DBUILD_FORTRAN77_INTERFACE:BOOL=ON" + ;; Incompatible with 32-bit indices. + ;;"-DBUILD_FORTRAN_MODULE_INTERFACE:BOOL=ON" - "-DKLU_ENABLE:BOOL=ON" + "-DENABLE_KLU:BOOL=ON" ,(string-append "-DKLU_INCLUDE_DIR=" suitesparse "/include") ,(string-append "-DKLU_LIBRARY_DIR=" suitesparse "/lib"))))) (home-page "https://computation.llnl.gov/projects/sundials") @@ -5727,17 +5733,14 @@ easily be incorporated into existing simulation codes.") (arguments (substitute-keyword-arguments (package-arguments sundials) ((#:configure-flags flags '()) - `(cons* "-DMPI_ENABLE:BOOL=ON" - "-DHYPRE_ENABLE:BOOL=ON" + `(cons* "-DENABLE_MPI:BOOL=ON" + "-DENABLE_HYPRE:BOOL=ON" (string-append "-DHYPRE_INCLUDE_DIR=" (assoc-ref %build-inputs "hypre") "/include") (string-append "-DHYPRE_LIBRARY_DIR=" (assoc-ref %build-inputs "hypre") "/lib") - "-DPETSC_ENABLE:BOOL=ON" - (string-append "-DPETSC_INCLUDE_DIR=" - (assoc-ref %build-inputs "petsc") "/include") - (string-append "-DPETSC_LIBRARY_DIR=" - (assoc-ref %build-inputs "petsc") "/lib") + "-DENABLE_PETSC:BOOL=ON" + (string-append "-DPETSC_DIR=" (assoc-ref %build-inputs "petsc")) ,flags)) ((#:phases phases '%standard-phases) `(modify-phases ,phases -- 2.32.0