diff options
3 files changed, 89 insertions, 30 deletions
diff --git a/var/spack/repos/builtin/packages/sundials/package.py b/var/spack/repos/builtin/packages/sundials/package.py index a79209021b..3cb4f3323d 100644 --- a/var/spack/repos/builtin/packages/sundials/package.py +++ b/var/spack/repos/builtin/packages/sundials/package.py @@ -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') # remove sundials_nvecopenmp target from ARKODE SuperLU_DIST example 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 diff --git a/var/spack/repos/builtin/packages/sundials/sundials-v5.8.0.patch b/var/spack/repos/builtin/packages/sundials/sundials-v5.8.0.patch new file mode 100644 index 0000000000..92788dff44 --- /dev/null +++ b/var/spack/repos/builtin/packages/sundials/sundials-v5.8.0.patch @@ -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() diff --git a/var/spack/repos/builtin/packages/xsdk-examples/package.py b/var/spack/repos/builtin/packages/xsdk-examples/package.py index 6cfe3998d6..11a6b682a4 100644 --- a/var/spack/repos/builtin/packages/xsdk-examples/package.py +++ b/var/spack/repos/builtin/packages/xsdk-examples/package.py @@ -7,7 +7,7 @@ from spack import * -class XsdkExamples(CMakePackage): +class XsdkExamples(CMakePackage, CudaPackage): """xSDK Examples show usage of libraries in the xSDK package.""" homepage = 'http://xsdk.info' @@ -17,52 +17,78 @@ class XsdkExamples(CMakePackage): maintainers = ['acfisher', 'balay', 'balos1', 'luszczek'] version('develop', branch='master') + version('0.3.0', sha256='e7444a403c0a69eeeb34a4068be4d6f4e5b54cbfd275629019b9236a538a739e') version('0.2.0', sha256='cf26e3a16a83eba6fb297fb106b0934046f17cf978f96243b44d9d17ad186db6') version('0.1.0', sha256='d24cab1db7c0872b6474d69e598df9c8e25d254d09c425fb0a6a8d6469b8018f') - variant('cuda', default=False, description='Compile CUDA examples') - 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.5.0', when='@0.1.0') + depends_on('mpi') + depends_on('cmake@3.21:', type='build', when='@0.3.0:') def cmake_args(self): spec = self.spec + args = [ '-DCMAKE_C_COMPILER=%s' % spec['mpi'].mpicc, - '-DMETIS_INCLUDE_DIRS=%s' % spec['metis'].prefix.include, - '-DMETIS_LIBRARY=%s' % spec['metis'].libs, - '-DMPI_DIR=%s' % spec['mpi'].prefix, - '-DSUNDIALS_DIR=%s' % spec['sundials'].prefix, - '-DHYPRE_DIR=%s' % spec['hypre'].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, + '-DCMAKE_CXX_COMPILER=%s' % spec['mpi'].mpicxx, + '-DENABLE_HYPRE=ON', + '-DHYPRE_DIR=%s' % spec['hypre'].prefix, + '-DENABLE_MFEM=ON', + '-DMETIS_DIR=%s' % spec['metis'].prefix, '-DMFEM_DIR=%s' % spec['mfem'].prefix, - '-DMFEM_INCLUDE_DIR=%s' % spec['mfem'].prefix.include, - '-DMFEM_LIBRARY_DIR=%s' % spec['mfem'].prefix.include.lib, - '-DGINKGO_DIR=%s' % spec['ginkgo'].prefix, - '-DGINKGO_INCLUDE_DIR=%s' % spec['ginkgo'].prefix.include, - '-DGINKGO_LIBRARY_DIR=%s' % spec['ginkgo'].prefix.include.lib, - # allow use of default `find_package(Ginkgo)` - '-DCMAKE_PREFIX_PATH=%s/cmake' % spec['ginkgo'].prefix.include.lib + '-DENABLE_PETSC=ON', + '-DPETSc_DIR=%s' % spec['petsc'].prefix, + '-DENABLE_PLASMA=ON', + '-DPLASMA_DIR=%s' % spec['plasma'].prefix, + '-DENABLE_SUNDIALS=ON', + '-DSUNDIALS_DIR=%s' % spec['sundials'].prefix, + '-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([ - '-DENABLE_CUDA=ON' + '-DENABLE_CUDA=ON', + '-DCMAKE_CUDA_ARCHITECTURES=%s' % spec.variants['cuda_arch'].value ]) - if 'trilinos' in spec: # if trilinos variant was activated for xsdk + if '+ginkgo' in spec: # if ginkgo variant was activated for xsdk args.extend([ - '-DTRILINOS_DIR_PATH=%s' % spec['trilinos'].prefix, + '-DENABLE_GINKGO=ON', + '-DGinkgo_DIR=%s' % spec['ginkgo'].prefix ]) - if 'zlib' in spec: # if zlib variant was activated for MFEM + 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([ - '-DZLIB_LIBRARY_DIR=%s' % spec['zlib'].prefix.lib, + '-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 + args.extend([ + 'ENABLE_TRILINOS=ON', + '-DTRILINOS_DIR_PATH=%s' % spec['trilinos'].prefix + ]) + if 'zlib' in spec: # if zlib variant was activated for MFEM + args.append('-DZLIB_LIBRARY_DIR=%s' % spec['zlib'].prefix.lib) + return args |