xsdk-examples: add v0.3.0 (#30770)
Co-authored-by: Satish Balay <balay@mcs.anl.gov> Co-authored-by: Veselin Dobrev <dobrev@llnl.gov>
This commit is contained in:
parent
68cd6c72c7
commit
5fc1547886
@ -246,6 +246,8 @@ class Sundials(CMakePackage, CudaPackage, ROCmPackage):
|
|||||||
patch('0001-add-missing-README-to-examples-cvode-hip.patch', when='@5.6.0:5.7.0')
|
patch('0001-add-missing-README-to-examples-cvode-hip.patch', when='@5.6.0:5.7.0')
|
||||||
# remove sundials_nvecopenmp target from ARKODE SuperLU_DIST example
|
# remove sundials_nvecopenmp target from ARKODE SuperLU_DIST example
|
||||||
patch('remove-links-to-OpenMP-vector.patch', when='@5.5.0:5.7.0')
|
patch('remove-links-to-OpenMP-vector.patch', when='@5.5.0:5.7.0')
|
||||||
|
# fix issues with exported PETSc target(s) in SUNDIALSConfig.cmake
|
||||||
|
patch('sundials-v5.8.0.patch', when='@5.8.0')
|
||||||
|
|
||||||
# ==========================================================================
|
# ==========================================================================
|
||||||
# SUNDIALS Settings
|
# SUNDIALS Settings
|
||||||
|
@ -0,0 +1,31 @@
|
|||||||
|
diff --git a/cmake/SUNDIALSConfig.cmake.in b/cmake/SUNDIALSConfig.cmake.in
|
||||||
|
index 6846c5353..e4c6d32ee 100644
|
||||||
|
--- a/cmake/SUNDIALSConfig.cmake.in
|
||||||
|
+++ b/cmake/SUNDIALSConfig.cmake.in
|
||||||
|
@@ -69,7 +69,7 @@ endif()
|
||||||
|
|
||||||
|
if(@ENABLE_PETSC@)
|
||||||
|
set(PETSC_LIBRARY_SINGLE "@PETSC_LIBRARY_SINGLE@")
|
||||||
|
- if(${PETSC_LIBRARY_SINGLE})
|
||||||
|
+ if(PETSC_LIBRARY_SINGLE)
|
||||||
|
foreach(suffix SYS VEC MAT DM KSP SNES TS ALL)
|
||||||
|
if(NOT TARGET SUNDIALS::PETSC_${suffix})
|
||||||
|
add_library(SUNDIALS::PETSC_${suffix} UNKNOWN IMPORTED)
|
||||||
|
@@ -78,7 +78,7 @@ if(@ENABLE_PETSC@)
|
||||||
|
set_target_properties(SUNDIALS::PETSC_${suffix} PROPERTIES
|
||||||
|
INTERFACE_LINK_LIBRARIES "@PETSC_LIBRARIES_@")
|
||||||
|
set_target_properties(SUNDIALS::PETSC_${suffix} PROPERTIES
|
||||||
|
- INTERFACE_COMPILE_OPTIONS "@PETSC_DEFINITIONS@")
|
||||||
|
+ INTERFACE_COMPILE_OPTIONS [=[@PETSC_DEFINITIONS@]=])
|
||||||
|
set_target_properties(SUNDIALS::PETSC_${suffix} PROPERTIES
|
||||||
|
IMPORTED_LOCATION "${PETSC_LIBRARY_SINGLE}")
|
||||||
|
endif()
|
||||||
|
@@ -110,7 +110,7 @@ if(@ENABLE_PETSC@)
|
||||||
|
set_target_properties (SUNDIALS::PETSC_${suffix} PROPERTIES
|
||||||
|
INTERFACE_LINK_LIBRARIES "${PETSC_LIBRARIES_${suffix}}")
|
||||||
|
set_target_properties (SUNDIALS::PETSC_${suffix} PROPERTIES
|
||||||
|
- INTERFACE_COMPILE_OPTIONS "${PETSC_DEFINITIONS}")
|
||||||
|
+ INTERFACE_COMPILE_OPTIONS [=[@PETSC_DEFINITIONS@]=])
|
||||||
|
set_target_properties (SUNDIALS::PETSC_${suffix} PROPERTIES
|
||||||
|
IMPORTED_LOCATION "${PETSC_LIBRARY_${suffix}}")
|
||||||
|
endif()
|
@ -7,7 +7,7 @@
|
|||||||
from spack import *
|
from spack import *
|
||||||
|
|
||||||
|
|
||||||
class XsdkExamples(CMakePackage):
|
class XsdkExamples(CMakePackage, CudaPackage):
|
||||||
"""xSDK Examples show usage of libraries in the xSDK package."""
|
"""xSDK Examples show usage of libraries in the xSDK package."""
|
||||||
|
|
||||||
homepage = 'http://xsdk.info'
|
homepage = 'http://xsdk.info'
|
||||||
@ -17,52 +17,78 @@ class XsdkExamples(CMakePackage):
|
|||||||
maintainers = ['acfisher', 'balay', 'balos1', 'luszczek']
|
maintainers = ['acfisher', 'balay', 'balos1', 'luszczek']
|
||||||
|
|
||||||
version('develop', branch='master')
|
version('develop', branch='master')
|
||||||
|
version('0.3.0', sha256='e7444a403c0a69eeeb34a4068be4d6f4e5b54cbfd275629019b9236a538a739e')
|
||||||
version('0.2.0', sha256='cf26e3a16a83eba6fb297fb106b0934046f17cf978f96243b44d9d17ad186db6')
|
version('0.2.0', sha256='cf26e3a16a83eba6fb297fb106b0934046f17cf978f96243b44d9d17ad186db6')
|
||||||
version('0.1.0', sha256='d24cab1db7c0872b6474d69e598df9c8e25d254d09c425fb0a6a8d6469b8018f')
|
version('0.1.0', sha256='d24cab1db7c0872b6474d69e598df9c8e25d254d09c425fb0a6a8d6469b8018f')
|
||||||
|
|
||||||
variant('cuda', default=False, description='Compile CUDA examples')
|
|
||||||
|
|
||||||
depends_on('xsdk+cuda', when='+cuda')
|
depends_on('xsdk+cuda', when='+cuda')
|
||||||
|
for sm_ in CudaPackage.cuda_arch_values:
|
||||||
|
depends_on('xsdk+cuda cuda_arch={0}'.format(sm_),
|
||||||
|
when='+cuda cuda_arch={0}'.format(sm_))
|
||||||
|
|
||||||
|
depends_on('xsdk@develop', when='@develop')
|
||||||
|
depends_on('xsdk@0.7.0', when='@0.3.0')
|
||||||
|
depends_on('xsdk@0.7.0 ^mfem+strumpack', when='@0.3.0 ^xsdk+strumpack')
|
||||||
|
depends_on('xsdk@0.7.0 ^sundials+magma', when='@0.3.0 +cuda')
|
||||||
depends_on('xsdk@0.6.0', when='@0.2.0')
|
depends_on('xsdk@0.6.0', when='@0.2.0')
|
||||||
depends_on('xsdk@0.5.0', when='@0.1.0')
|
depends_on('xsdk@0.5.0', when='@0.1.0')
|
||||||
|
depends_on('mpi')
|
||||||
|
depends_on('cmake@3.21:', type='build', when='@0.3.0:')
|
||||||
|
|
||||||
def cmake_args(self):
|
def cmake_args(self):
|
||||||
spec = self.spec
|
spec = self.spec
|
||||||
|
|
||||||
args = [
|
args = [
|
||||||
'-DCMAKE_C_COMPILER=%s' % spec['mpi'].mpicc,
|
'-DCMAKE_C_COMPILER=%s' % spec['mpi'].mpicc,
|
||||||
'-DMETIS_INCLUDE_DIRS=%s' % spec['metis'].prefix.include,
|
'-DCMAKE_CXX_COMPILER=%s' % spec['mpi'].mpicxx,
|
||||||
'-DMETIS_LIBRARY=%s' % spec['metis'].libs,
|
'-DENABLE_HYPRE=ON',
|
||||||
'-DMPI_DIR=%s' % spec['mpi'].prefix,
|
'-DHYPRE_DIR=%s' % spec['hypre'].prefix,
|
||||||
'-DSUNDIALS_DIR=%s' % spec['sundials'].prefix,
|
'-DENABLE_MFEM=ON',
|
||||||
'-DHYPRE_DIR=%s' % spec['hypre'].prefix,
|
'-DMETIS_DIR=%s' % spec['metis'].prefix,
|
||||||
'-DHYPRE_INCLUDE_DIR=%s' % spec['hypre'].prefix.include,
|
|
||||||
'-DPETSC_DIR=%s' % spec['petsc'].prefix,
|
|
||||||
'-DPETSC_INCLUDE_DIR=%s' % spec['petsc'].prefix.include,
|
|
||||||
'-DPETSC_LIBRARY_DIR=%s' % spec['petsc'].prefix.lib,
|
|
||||||
'-DSUPERLUDIST_DIR=%s' % spec['superlu-dist'].prefix,
|
|
||||||
'-DSUPERLUDIST_INCLUDE_DIR=%s' %
|
|
||||||
spec['superlu-dist'].prefix.include,
|
|
||||||
'-DSUPERLUDIST_LIBRARY_DIR=%s' % spec['superlu-dist'].prefix.lib,
|
|
||||||
'-DSUPERLUDIST_LIBRARY=%s' % spec['superlu-dist'].libs,
|
|
||||||
'-DMFEM_DIR=%s' % spec['mfem'].prefix,
|
'-DMFEM_DIR=%s' % spec['mfem'].prefix,
|
||||||
'-DMFEM_INCLUDE_DIR=%s' % spec['mfem'].prefix.include,
|
'-DENABLE_PETSC=ON',
|
||||||
'-DMFEM_LIBRARY_DIR=%s' % spec['mfem'].prefix.include.lib,
|
'-DPETSc_DIR=%s' % spec['petsc'].prefix,
|
||||||
'-DGINKGO_DIR=%s' % spec['ginkgo'].prefix,
|
'-DENABLE_PLASMA=ON',
|
||||||
'-DGINKGO_INCLUDE_DIR=%s' % spec['ginkgo'].prefix.include,
|
'-DPLASMA_DIR=%s' % spec['plasma'].prefix,
|
||||||
'-DGINKGO_LIBRARY_DIR=%s' % spec['ginkgo'].prefix.include.lib,
|
'-DENABLE_SUNDIALS=ON',
|
||||||
# allow use of default `find_package(Ginkgo)`
|
'-DSUNDIALS_DIR=%s' % spec['sundials'].prefix,
|
||||||
'-DCMAKE_PREFIX_PATH=%s/cmake' % spec['ginkgo'].prefix.include.lib
|
'-DENABLE_SUPERLU=ON',
|
||||||
|
'-DSUPERLUDIST_DIR=%s' % spec['superlu-dist'].prefix
|
||||||
]
|
]
|
||||||
if '+cuda' in spec:
|
|
||||||
|
if '+cuda' in spec: # if cuda variant was activated for xsdk
|
||||||
args.extend([
|
args.extend([
|
||||||
'-DENABLE_CUDA=ON'
|
'-DENABLE_CUDA=ON',
|
||||||
|
'-DCMAKE_CUDA_ARCHITECTURES=%s' % spec.variants['cuda_arch'].value
|
||||||
|
])
|
||||||
|
if '+ginkgo' in spec: # if ginkgo variant was activated for xsdk
|
||||||
|
args.extend([
|
||||||
|
'-DENABLE_GINKGO=ON',
|
||||||
|
'-DGinkgo_DIR=%s' % spec['ginkgo'].prefix
|
||||||
|
])
|
||||||
|
if '+magma' in spec: # if magma variant was activated for xsdk
|
||||||
|
args.extend([
|
||||||
|
'-DENABLE_MAGMA=ON',
|
||||||
|
'-DMAGMA_DIR=%s' % spec['magma'].prefix
|
||||||
|
])
|
||||||
|
if '+strumpack' in spec: # if magma variant was activated for xsdk
|
||||||
|
args.extend([
|
||||||
|
'-DENABLE_STRUMPACK=ON',
|
||||||
|
'-DSTRUMPACK_DIR=%s' % spec['strumpack'].prefix
|
||||||
|
])
|
||||||
|
if '+slate' in spec: # if slate variant was activated for xsdk
|
||||||
|
args.extend([
|
||||||
|
'-DENABLE_SLATE=ON',
|
||||||
|
'-DSLATE_DIR=%s' % spec['slate'].prefix,
|
||||||
|
'-DBLASPP_DIR=%s' % spec['blaspp'].prefix,
|
||||||
|
'-DLAPACKPP_DIR=%s' % spec['lapackpp'].prefix
|
||||||
])
|
])
|
||||||
if 'trilinos' in spec: # if trilinos variant was activated for xsdk
|
if 'trilinos' in spec: # if trilinos variant was activated for xsdk
|
||||||
args.extend([
|
args.extend([
|
||||||
'-DTRILINOS_DIR_PATH=%s' % spec['trilinos'].prefix,
|
'ENABLE_TRILINOS=ON',
|
||||||
|
'-DTRILINOS_DIR_PATH=%s' % spec['trilinos'].prefix
|
||||||
])
|
])
|
||||||
if 'zlib' in spec: # if zlib variant was activated for MFEM
|
if 'zlib' in spec: # if zlib variant was activated for MFEM
|
||||||
args.extend([
|
args.append('-DZLIB_LIBRARY_DIR=%s' % spec['zlib'].prefix.lib)
|
||||||
'-DZLIB_LIBRARY_DIR=%s' % spec['zlib'].prefix.lib,
|
|
||||||
])
|
|
||||||
return args
|
return args
|
||||||
|
Loading…
Reference in New Issue
Block a user