summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--var/spack/repos/builtin/packages/sundials/5.5.0-xsdk-patches.patch75
-rw-r--r--var/spack/repos/builtin/packages/sundials/package.py11
2 files changed, 84 insertions, 2 deletions
diff --git a/var/spack/repos/builtin/packages/sundials/5.5.0-xsdk-patches.patch b/var/spack/repos/builtin/packages/sundials/5.5.0-xsdk-patches.patch
new file mode 100644
index 0000000000..fccdbaec2e
--- /dev/null
+++ b/var/spack/repos/builtin/packages/sundials/5.5.0-xsdk-patches.patch
@@ -0,0 +1,75 @@
+From 0e197ce186ffae8213c297786811401861d249c1 Mon Sep 17 00:00:00 2001
+From: "Cody J. Balos" <balos1@llnl.gov>
+Date: Wed, 4 Nov 2020 10:43:36 -0800
+Subject: [PATCH 1/2] fix expansion of generator expression
+
+---
+ src/sunlinsol/superludist/CMakeLists.txt | 2 +-
+ src/sunmatrix/slunrloc/CMakeLists.txt | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/sunlinsol/superludist/CMakeLists.txt b/src/sunlinsol/superludist/CMakeLists.txt
+index ac1ece36c..5b59d6bfd 100644
+--- a/src/sunlinsol/superludist/CMakeLists.txt
++++ b/src/sunlinsol/superludist/CMakeLists.txt
+@@ -32,7 +32,7 @@ sundials_add_library(sundials_sunlinsolsuperludist
+ sundials_generic_obj
+ LINK_LIBRARIES
+ PUBLIC sundials_sunmatrixslunrloc SUNDIALS::SUPERLUDIST
+- $<IF:$<BOOL:SUPERLUDIST_OpenMP>,OpenMP::OpenMP_C,>
++ $<IF:$<BOOL:${SUPERLUDIST_OpenMP}>,OpenMP::OpenMP_C,>
+ COMPILE_OPTIONS
+ PRIVATE ${_compile_options}
+ OUTPUT_NAME
+diff --git a/src/sunmatrix/slunrloc/CMakeLists.txt b/src/sunmatrix/slunrloc/CMakeLists.txt
+index 25ee00dd3..7713435d9 100644
+--- a/src/sunmatrix/slunrloc/CMakeLists.txt
++++ b/src/sunmatrix/slunrloc/CMakeLists.txt
+@@ -34,7 +34,7 @@ sundials_add_library(sundials_sunmatrixslunrloc
+ sundials_generic_obj
+ LINK_LIBRARIES
+ PUBLIC SUNDIALS::SUPERLUDIST
+- $<IF:$<BOOL:SUPERLUDIST_OpenMP>,OpenMP::OpenMP_C,>
++ $<IF:$<BOOL:${SUPERLUDIST_OpenMP}>,OpenMP::OpenMP_C,>
+ COMPILE_OPTIONS
+ PRIVATE ${_compile_options}
+ OUTPUT_NAME
+--
+2.29.1
+
+
+From 09cd3ab587f8999d068946d8be180da0a3c6ad32 Mon Sep 17 00:00:00 2001
+From: "Cody J. Balos" <balos1@llnl.gov>
+Date: Tue, 3 Nov 2020 11:43:58 -0800
+Subject: [PATCH 2/2] dont use NULL in ltest for Hypre
+
+---
+ cmake/tpl/SundialsHypre.cmake | 7 +++----
+ 1 file changed, 3 insertions(+), 4 deletions(-)
+
+diff --git a/cmake/tpl/SundialsHypre.cmake b/cmake/tpl/SundialsHypre.cmake
+index 9633f1c11..19d4bf201 100644
+--- a/cmake/tpl/SundialsHypre.cmake
++++ b/cmake/tpl/SundialsHypre.cmake
+@@ -78,15 +78,14 @@ if(HYPRE_FOUND AND (NOT HYPRE_WORKS))
+ "ADD_EXECUTABLE(ltest ltest.c)\n"
+ "TARGET_LINK_LIBRARIES(ltest ${HYPRE_LIBRARIES})\n")
+
+- # Create a C source file which calls a hypre function
+ file(WRITE ${HYPRE_TEST_DIR}/ltest.c
+ "\#include \"HYPRE_parcsr_ls.h\"\n"
+ "int main(){\n"
+ "HYPRE_ParVector par_b;\n"
+ "HYPRE_IJVector b;\n"
+- "par_b = NULL;\n"
+- "b = NULL;\n"
+- "if (par_b != NULL || b != NULL) return(1);\n"
++ "par_b = 0;\n"
++ "b = 0;\n"
++ "if (par_b != 0 || b != 0) return(1);\n"
+ "else return(0);\n"
+ "}\n")
+
+--
+2.29.1
+
diff --git a/var/spack/repos/builtin/packages/sundials/package.py b/var/spack/repos/builtin/packages/sundials/package.py
index f58747ded9..d00bda0c03 100644
--- a/var/spack/repos/builtin/packages/sundials/package.py
+++ b/var/spack/repos/builtin/packages/sundials/package.py
@@ -22,6 +22,7 @@ class Sundials(CMakePackage):
# Versions
# ==========================================================================
version('develop', branch='develop')
+ version('5.5.0', sha256='2a755e89aab96d2ff096a4e30bf00bb162e80be20e9e99f424dccfb249098237')
version('5.4.0', sha256='04d8a2ebe02cdaeef5a9e22ff7e3146bb563d8400f65772b6c7af80001413ffa')
version('5.3.0', sha256='88dff7e11a366853d8afd5de05bf197a8129a804d9d4461fb64297f1ef89bca7')
version('5.2.0', sha256='95f058acce5bd66e654de65acdbb1c9f44c90cf1b4e28f8d933cdb4415ebba3e')
@@ -180,7 +181,8 @@ class Sundials(CMakePackage):
depends_on('suite-sparse', when='+klu')
depends_on('petsc +mpi', when='+petsc')
depends_on('hypre +mpi', when='+hypre')
- depends_on('superlu-dist@6.1.1:', when='+superlu-dist')
+ depends_on('superlu-dist@6.1.1:', when='@:5.4.0 +superlu-dist')
+ depends_on('superlu-dist@6.3.0:', when='@5.5.0: +superlu-dist')
depends_on('trilinos+tpetra', when='+trilinos')
# Require that external libraries built with the same precision
@@ -204,6 +206,7 @@ class Sundials(CMakePackage):
# remove OpenMP header file and function from hypre vector test code
patch('test_nvector_parhyp.patch', when='@2.7.0:3.0.0')
patch('FindPackageMultipass.cmake.patch', when='@5.0.0')
+ patch('5.5.0-xsdk-patches.patch', when='@5.5.0')
# ==========================================================================
# SUNDIALS Settings
@@ -238,8 +241,10 @@ class Sundials(CMakePackage):
# index type (v3.0.0 or later)
if spec.satisfies('@3.0.0:'):
if '+int64' in spec:
+ args.extend(['-DSUNDIALS_INDEX_SIZE=64'])
args.extend(['-DSUNDIALS_INDEX_TYPE=int64_t'])
else:
+ args.extend(['-DSUNDIALS_INDEX_SIZE=32'])
args.extend(['-DSUNDIALS_INDEX_TYPE=int32_t'])
# Fortran interface
@@ -364,13 +369,15 @@ class Sundials(CMakePackage):
# Building with SuperLU_DIST
if '+superlu-dist' in spec:
args.extend([
+ '-DOPENMP_ENABLE=%s'
+ % on_off('^superlu-dist+openmp'),
'-DSUPERLUDIST_ENABLE=ON',
'-DSUPERLUDIST_INCLUDE_DIR=%s'
% spec['superlu-dist'].prefix.include,
'-DSUPERLUDIST_LIBRARY_DIR=%s'
% spec['superlu-dist'].prefix.lib,
'-DSUPERLUDIST_LIBRARIES=%s'
- % spec['blas'].libs,
+ % spec['blas'].libs.joined(';'),
'-DSUPERLUDIST_OpenMP=%s'
% on_off('^superlu-dist+openmp')
])