Skip to content

Commit

Permalink
Merge pull request #19490 from akesandgren/20240104152455_new_pr_SUND…
Browse files Browse the repository at this point in the history
…IALS660

{math}[foss/2022b,foss/2023a] SUNDIALS v6.6.0 enable KLU and CUDA solvers
  • Loading branch information
smoors authored Jan 10, 2024
2 parents 617f1a0 + 5ecc30a commit 01cc786
Show file tree
Hide file tree
Showing 4 changed files with 149 additions and 10 deletions.
29 changes: 24 additions & 5 deletions easybuild/easyconfigs/s/SUNDIALS/SUNDIALS-6.6.0-foss-2022b.eb
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,30 @@ toolchainopts = {'openmp': True, 'usempi': True, 'pic': True}

source_urls = ['https://github.com/LLNL/sundials/releases/download/v%(version)s/']
sources = [SOURCELOWER_TAR_GZ]
checksums = ['f90029b8da846c8faff5530fd1fa4847079188d040554f55c1d5d1e04743d29d']

builddependencies = [('CMake', '3.24.3')]

configopts = "-DMPI_ENABLE=ON -DOPENMP_ENABLE=ON -DLAPACK_ENABLE=ON"
patches = [
'%(name)s-%(version)s_fix_bad_find_library_calls.patch',
]
checksums = [
{'sundials-6.6.0.tar.gz': 'f90029b8da846c8faff5530fd1fa4847079188d040554f55c1d5d1e04743d29d'},
{'SUNDIALS-6.6.0_fix_bad_find_library_calls.patch':
'c5e3248bd036fee17436649280ff7156a2722698c33ec20a5e635e3a60d16823'},
]

builddependencies = [
('CMake', '3.24.3'),
]

dependencies = [
('SuiteSparse', '5.13.0', '-METIS-5.1.0'),
]

_copts = [
'-DENABLE_MPI=ON',
'-DENABLE_OPENMP=ON',
'-DENABLE_LAPACK=ON',
'-DENABLE_KLU=ON',
]
configopts = ' '.join(_copts)

local_solvers = ['arkode', 'cvode', 'cvodes', 'ida', 'idas', 'kinsol']

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
easyblock = 'CMakeMake'

name = 'SUNDIALS'
version = '6.6.0'
versionsuffix = '-CUDA-%(cudaver)s'

homepage = 'https://computing.llnl.gov/projects/sundials'

description = "SUNDIALS: SUite of Nonlinear and DIfferential/ALgebraic Equation Solvers"

toolchain = {'name': 'foss', 'version': '2023a'}
toolchainopts = {'openmp': True, 'usempi': True, 'pic': True}

source_urls = ['https://github.com/LLNL/sundials/releases/download/v%(version)s/']
sources = [SOURCELOWER_TAR_GZ]
patches = [
'%(name)s-%(version)s_fix_bad_find_library_calls.patch',
]
checksums = [
{'sundials-6.6.0.tar.gz': 'f90029b8da846c8faff5530fd1fa4847079188d040554f55c1d5d1e04743d29d'},
{'SUNDIALS-6.6.0_fix_bad_find_library_calls.patch':
'c5e3248bd036fee17436649280ff7156a2722698c33ec20a5e635e3a60d16823'},
]

builddependencies = [
('CMake', '3.26.3'),
]

dependencies = [
('CUDA', '12.1.1', '', SYSTEM),
('SuiteSparse', '7.1.0'),
]

_copts = [
'-DENABLE_MPI=ON',
'-DENABLE_OPENMP=ON',
'-DENABLE_LAPACK=ON',
'-DENABLE_KLU=ON',
'-DENABLE_CUDA=ON',
'-DCMAKE_CUDA_ARCHITECTURES="%(cuda_cc_cmake)s"',
]
configopts = ' '.join(_copts)

local_solvers = ['arkode', 'cvode', 'cvodes', 'ida', 'idas', 'kinsol']

sanity_check_paths = {
'files': ['lib/libsundials_%s.a' % s for s in local_solvers +
['nvecopenmp', 'nvecparallel', 'nvecserial']] +
['lib/libsundials_%s.%s' % (s, SHLIB_EXT) for s in local_solvers +
['nvecopenmp', 'nvecparallel', 'nvecserial']],
'dirs': ['examples/%s' % s for s in local_solvers] +
['include/%s' % s for s in local_solvers] +
['examples/nvector', 'include/nvector', 'include/sundials'],
}

moduleclass = 'math'
29 changes: 24 additions & 5 deletions easybuild/easyconfigs/s/SUNDIALS/SUNDIALS-6.6.0-foss-2023a.eb
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,30 @@ toolchainopts = {'openmp': True, 'usempi': True, 'pic': True}

source_urls = ['https://github.com/LLNL/sundials/releases/download/v%(version)s/']
sources = [SOURCELOWER_TAR_GZ]
checksums = ['f90029b8da846c8faff5530fd1fa4847079188d040554f55c1d5d1e04743d29d']

builddependencies = [('CMake', '3.26.3')]

configopts = "-DMPI_ENABLE=ON -DOPENMP_ENABLE=ON -DLAPACK_ENABLE=ON"
patches = [
'%(name)s-%(version)s_fix_bad_find_library_calls.patch',
]
checksums = [
{'sundials-6.6.0.tar.gz': 'f90029b8da846c8faff5530fd1fa4847079188d040554f55c1d5d1e04743d29d'},
{'SUNDIALS-6.6.0_fix_bad_find_library_calls.patch':
'c5e3248bd036fee17436649280ff7156a2722698c33ec20a5e635e3a60d16823'},
]

builddependencies = [
('CMake', '3.26.3'),
]

dependencies = [
('SuiteSparse', '7.1.0'),
]

_copts = [
'-DENABLE_MPI=ON',
'-DENABLE_OPENMP=ON',
'-DENABLE_LAPACK=ON',
'-DENABLE_KLU=ON',
]
configopts = ' '.join(_copts)

local_solvers = ['arkode', 'cvode', 'cvodes', 'ida', 'idas', 'kinsol']

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
Make FindKLU use default search paths so it finds our SuiteSparse installation.

Åke Sandgren, 2023-12-20
diff -ru sundials-6.6.0.orig/cmake/tpl/FindKLU.cmake sundials-6.6.0/cmake/tpl/FindKLU.cmake
--- sundials-6.6.0.orig/cmake/tpl/FindKLU.cmake 2023-07-20 20:47:41.062113287 +0200
+++ sundials-6.6.0/cmake/tpl/FindKLU.cmake 2023-12-20 13:27:56.974985727 +0100
@@ -55,25 +55,25 @@
else ()
# find library with user provided directory path
set(KLU_LIBRARY_NAME klu)
- find_library(KLU_LIBRARY ${KLU_LIBRARY_NAME} ${KLU_LIBRARY_DIR} NO_DEFAULT_PATH)
+ find_library(KLU_LIBRARY ${KLU_LIBRARY_NAME} ${KLU_LIBRARY_DIR})
endif ()
mark_as_advanced(KLU_LIBRARY)

if (NOT AMD_LIBRARY)
set(AMD_LIBRARY_NAME amd)
- find_library(AMD_LIBRARY ${AMD_LIBRARY_NAME} ${KLU_LIBRARY_DIR} NO_DEFAULT_PATH)
+ find_library(AMD_LIBRARY ${AMD_LIBRARY_NAME} ${KLU_LIBRARY_DIR})
mark_as_advanced(AMD_LIBRARY)
endif ()

if (NOT COLAMD_LIBRARY)
set(COLAMD_LIBRARY_NAME colamd)
- find_library(COLAMD_LIBRARY ${COLAMD_LIBRARY_NAME} ${KLU_LIBRARY_DIR} NO_DEFAULT_PATH)
+ find_library(COLAMD_LIBRARY ${COLAMD_LIBRARY_NAME} ${KLU_LIBRARY_DIR})
mark_as_advanced(COLAMD_LIBRARY)
endif ()

if (NOT BTF_LIBRARY)
set(BTF_LIBRARY_NAME btf)
- find_library( BTF_LIBRARY ${BTF_LIBRARY_NAME} ${KLU_LIBRARY_DIR} NO_DEFAULT_PATH)
+ find_library( BTF_LIBRARY ${BTF_LIBRARY_NAME} ${KLU_LIBRARY_DIR})
mark_as_advanced(BTF_LIBRARY)
endif ()

@@ -83,7 +83,7 @@
if(WIN32 AND NOT MSYS)
set(CMAKE_FIND_LIBRARY_PREFIXES "")
endif()
- find_library( SUITESPARSECONFIG_LIBRARY ${SUITESPARSECONFIG_LIBRARY_NAME} ${KLU_LIBRARY_DIR} NO_DEFAULT_PATH)
+ find_library( SUITESPARSECONFIG_LIBRARY ${SUITESPARSECONFIG_LIBRARY_NAME} ${KLU_LIBRARY_DIR})
mark_as_advanced(SUITESPARSECONFIG_LIBRARY)
endif ()

0 comments on commit 01cc786

Please sign in to comment.