sundials: add version 5.0.0 and new variant (#13375)
* sundials: add version 5.0.0 and new variant plus some cleanup * sundiaks: fix formatting * sundials: fix dependencies
This commit is contained in:
		 Cody Balos
					Cody Balos
				
			
				
					committed by
					
						 Adam J. Stewart
						Adam J. Stewart
					
				
			
			
				
	
			
			
			 Adam J. Stewart
						Adam J. Stewart
					
				
			
						parent
						
							d0d0456fa7
						
					
				
				
					commit
					177f661bb3
				
			| @@ -14,11 +14,14 @@ class Sundials(CMakePackage): | ||||
|  | ||||
|     homepage = "https://computing.llnl.gov/projects/sundials" | ||||
|     url = "https://computing.llnl.gov/projects/sundials/download/sundials-2.7.0.tar.gz" | ||||
|     git = "https://github.com/llnl/sundials.git" | ||||
|     maintainers = ['cswoodward', 'gardner48', 'balos1'] | ||||
|  | ||||
|     # ========================================================================== | ||||
|     # Versions | ||||
|     # ========================================================================== | ||||
|     version('develop', branch='develop') | ||||
|     version('5.0.0', sha256='345141ec01c641d0bdfb3476c478b7e74fd6a7192a478a27cafe75d9da2d7dd3') | ||||
|     version('4.1.0', sha256='280de1c27b2360170a6f46cb3799b2aee9dff3bddbafc8b08c291a47ab258aa5') | ||||
|     version('4.0.1', sha256='29e409c8620e803990edbda1ebf49e03a38c08b9187b90658d86bddae913aed4') | ||||
|     version('3.2.1', sha256='47d94d977ab2382cdcdd02f72a25ebd4ba8ca2634bbb2f191fe1636e71c86808') | ||||
| @@ -67,16 +70,18 @@ class Sundials(CMakePackage): | ||||
|             description='Enable RAJA parallel vector') | ||||
|  | ||||
|     # External libraries | ||||
|     variant('lapack',     default=False, | ||||
|             description='Enable LAPACK direct solvers') | ||||
|     variant('klu',        default=False, | ||||
|             description='Enable KLU sparse, direct solver') | ||||
|     variant('superlu-mt', default=False, | ||||
|             description='Enable SuperLU_MT sparse, direct solver') | ||||
|     variant('hypre',      default=False, | ||||
|     variant('hypre',        default=False, | ||||
|             description='Enable Hypre MPI parallel vector') | ||||
|     variant('petsc',      default=False, | ||||
|     variant('lapack',       default=False, | ||||
|             description='Enable LAPACK direct solvers') | ||||
|     variant('klu',          default=False, | ||||
|             description='Enable KLU sparse, direct solver') | ||||
|     variant('petsc',        default=False, | ||||
|             description='Enable PETSc MPI parallel vector') | ||||
|     variant('superlu-mt',   default=False, | ||||
|             description='Enable SuperLU_MT sparse, direct solver') | ||||
|     variant('superlu-dist', default=False, | ||||
|             description='Enable SuperLU_DIST sparse, direct solver') | ||||
|  | ||||
|     # Library type | ||||
|     variant('shared', default=True, | ||||
| @@ -84,9 +89,11 @@ class Sundials(CMakePackage): | ||||
|     variant('static', default=True, | ||||
|             description='Build static libraries') | ||||
|  | ||||
|     # Fortran interface | ||||
|     # Fortran interfaces | ||||
|     variant('fcmix', default=False, | ||||
|             description='Enable Fortran interface') | ||||
|             description='Enable Fortran 77 interface') | ||||
|     variant('f2003', default=False, | ||||
|             description='Enable Fortran 2003 interface') | ||||
|  | ||||
|     # Examples | ||||
|     variant('examples-c',       default=True, | ||||
| @@ -97,10 +104,10 @@ class Sundials(CMakePackage): | ||||
|             description='Enable Fortran 77 examples') | ||||
|     variant('examples-f90',     default=False, | ||||
|             description='Enable Fortran 90 examples') | ||||
|     variant('examples-f2003',   default=False, | ||||
|             description='Enable Fortran 2003 examples') | ||||
|     variant('examples-cuda',    default=False, | ||||
|             description='Enable CUDA examples') | ||||
|     variant('examples-raja',    default=False, | ||||
|             description='Enable RAJA examples') | ||||
|     variant('examples-install', default=True, | ||||
|             description='Install examples') | ||||
|  | ||||
| @@ -121,25 +128,24 @@ class Sundials(CMakePackage): | ||||
|     conflicts('+raja',          when='@:2.7.0') | ||||
|     conflicts('~int64',         when='@:2.7.0') | ||||
|     conflicts('+examples-cuda', when='@:2.7.0') | ||||
|     conflicts('+examples-raja', when='@:2.7.0') | ||||
|     conflicts('+superlu-dist',  when='@:4.1.0') | ||||
|     conflicts('+f2003',         when='@:4.1.0') | ||||
|  | ||||
|     # External libraries incompatible with 64-bit indices | ||||
|     conflicts('+lapack', when='@3.0.0: +int64') | ||||
|     conflicts('+hypre',  when='+hypre@:2.6.1a +int64') | ||||
|  | ||||
|     # External libraries incompatible with single precision | ||||
|     conflicts('+klu',   when='precision=single') | ||||
|     conflicts('+hypre', when='+hypre@:2.12.0 precision=single') | ||||
|     conflicts('+klu',          when='precision=single') | ||||
|     conflicts('+hypre',        when='+hypre@:2.12.0 precision=single') | ||||
|     conflicts('+superlu-dist', when='precision=single') | ||||
|  | ||||
|     # External libraries incompatible with extended (quad) precision | ||||
|     conflicts('+lapack',     when='precision=extended') | ||||
|     conflicts('+superlu-mt', when='precision=extended') | ||||
|     conflicts('+klu',        when='precision=extended') | ||||
|     conflicts('+hypre',      when='+hypre@:2.12.0 precision=extended') | ||||
|  | ||||
|     # External libraries that need to be built with MPI | ||||
|     conflicts('+hypre', when='~mpi') | ||||
|     conflicts('+petsc', when='~mpi') | ||||
|     conflicts('+lapack',       when='precision=extended') | ||||
|     conflicts('+superlu-mt',   when='precision=extended') | ||||
|     conflicts('+superlu-dist', when='precision=extended') | ||||
|     conflicts('+klu',          when='precision=extended') | ||||
|     conflicts('+hypre',        when='+hypre@:2.12.0 precision=extended') | ||||
|  | ||||
|     # SuperLU_MT interface requires lapack for external blas (before v3.0.0) | ||||
|     conflicts('+superlu-mt', when='@:2.7.0 ~lapack') | ||||
| @@ -149,39 +155,35 @@ class Sundials(CMakePackage): | ||||
|     # ========================================================================== | ||||
|  | ||||
|     # Build dependencies | ||||
|     depends_on('cmake@2.8.1:', type='build') | ||||
|     depends_on('cmake@2.8.12:', type='build', when='@3.1.2') | ||||
|     depends_on('cmake@3.0.2:', type='build', when='@4.0.0-dev.1') | ||||
|     depends_on('cmake@3.1.3:', type='build', when='@3.2.0,4.0.0-dev.2') | ||||
|     depends_on('cmake@3.5:', type='build') | ||||
|  | ||||
|     # MPI related dependencies | ||||
|     depends_on('mpi', when='+mpi') | ||||
|     depends_on('mpi', when='+hypre') | ||||
|     depends_on('mpi', when='+petsc') | ||||
|     depends_on('mpi', when='+superlu-dist') | ||||
|  | ||||
|     # Other parallelism dependencies | ||||
|     depends_on('cuda', when='+cuda') | ||||
|     depends_on('raja', when='+raja') | ||||
|     depends_on('raja +cuda ~openmp', when='+raja') | ||||
|  | ||||
|     # External libraries | ||||
|     depends_on('blas',         when='+lapack') | ||||
|     depends_on('lapack',       when='+lapack') | ||||
|     depends_on('suite-sparse', when='+klu') | ||||
|     depends_on('lapack',              when='+lapack') | ||||
|     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') | ||||
|  | ||||
|     # Require that external libraries built with the same precision | ||||
|     depends_on('petsc~double~complex', when='+petsc precision=single') | ||||
|     depends_on('petsc+double~complex', when='+petsc precision=double') | ||||
|  | ||||
|     # Require that external libraries built with the same index type | ||||
|     depends_on('hypre', when='+hypre') | ||||
|     depends_on('hypre~int64', when='+hypre ~int64') | ||||
|     depends_on('hypre+int64', when='+hypre +int64') | ||||
|     depends_on('petsc', when='+petsc') | ||||
|     depends_on('petsc~int64', when='+petsc ~int64') | ||||
|     depends_on('petsc+int64', when='+petsc +int64') | ||||
|  | ||||
|     # Require that PETSc is built with MPI | ||||
|     depends_on('petsc+mpi', when='+petsc') | ||||
|     depends_on('superlu-dist+int64', when='+superlu-dist +int64') | ||||
|  | ||||
|     # Require that SuperLU_MT built with external blas | ||||
|     depends_on('superlu-mt+blas', when='+superlu-mt') | ||||
| @@ -231,7 +233,8 @@ def on_off(varstr): | ||||
|                 args.extend(['-DSUNDIALS_INDEX_TYPE=int32_t']) | ||||
|  | ||||
|         # Fortran interface | ||||
|         args.extend(['-DFCMIX_ENABLE=%s' % on_off('+fcmix')]) | ||||
|         args.extend(['-DF77_INTERFACE_ENABLE=%s' % on_off('+fcmix')]) | ||||
|         args.extend(['-DF2003_INTERFACE_ENABLE=%s' % on_off('+f2003')]) | ||||
|  | ||||
|         # library type | ||||
|         args.extend([ | ||||
| @@ -263,12 +266,12 @@ def on_off(varstr): | ||||
|             if ('+fcmix' in spec) and ('+examples-f90' in spec): | ||||
|                 args.extend(['-DMPI_MPIF90=%s' % spec['mpi'].mpifc]) | ||||
|  | ||||
|         # Building with LAPACK and BLAS | ||||
|         if '+lapack' in spec: | ||||
|         # Building with Hypre | ||||
|         if '+hypre' in spec: | ||||
|             args.extend([ | ||||
|                 '-DLAPACK_ENABLE=ON', | ||||
|                 '-DLAPACK_LIBRARIES=%s' | ||||
|                 % (spec['lapack'].libs + spec['blas'].libs).joined(';') | ||||
|                 '-DHYPRE_ENABLE=ON', | ||||
|                 '-DHYPRE_INCLUDE_DIR=%s' % spec['hypre'].prefix.include, | ||||
|                 '-DHYPRE_LIBRARY_DIR=%s' % spec['hypre'].prefix.lib | ||||
|             ]) | ||||
|  | ||||
|         # Building with KLU | ||||
| @@ -279,6 +282,32 @@ def on_off(varstr): | ||||
|                 '-DKLU_LIBRARY_DIR=%s' % spec['suite-sparse'].prefix.lib | ||||
|             ]) | ||||
|  | ||||
|         # Building with LAPACK | ||||
|         if '+lapack' in spec: | ||||
|             args.extend([ | ||||
|                 '-DLAPACK_ENABLE=ON', | ||||
|                 '-DLAPACK_LIBRARIES=%s' | ||||
|                 % (spec['lapack'].libs + spec['blas'].libs).joined(';') | ||||
|             ]) | ||||
|  | ||||
|         # Building with PETSc | ||||
|         if '+petsc' in spec: | ||||
|             args.extend([ | ||||
|                 '-DPETSC_ENABLE=ON', | ||||
|                 # PETSC_DIR was added in 5.0.0 | ||||
|                 '-DPETSC_DIR=%s'         % spec['petsc'].prefix, | ||||
|                 # The following options were removed 5.0.0, but we keep | ||||
|                 # them here for versions < 5.0.0. | ||||
|                 '-DPETSC_INCLUDE_DIR=%s' % spec['petsc'].prefix.include, | ||||
|                 '-DPETSC_LIBRARY_DIR=%s' % spec['petsc'].prefix.lib | ||||
|             ]) | ||||
|  | ||||
|         # Building with RAJA | ||||
|         if '+raja' in spec: | ||||
|             args.extend([ | ||||
|                 '-DRAJA_DIR=%s' % spec['raja'].prefix.share.raja.cmake | ||||
|             ]) | ||||
|  | ||||
|         # Building with SuperLU_MT | ||||
|         if '+superlu-mt' in spec: | ||||
|             if spec.satisfies('@3.0.0:'): | ||||
| @@ -298,37 +327,31 @@ def on_off(varstr): | ||||
|             else: | ||||
|                 args.append('-DSUPERLUMT_THREAD_TYPE=Pthread') | ||||
|  | ||||
|         # Building with Hypre | ||||
|         if '+hypre' in spec: | ||||
|         # Building with SuperLU_DIST | ||||
|         if '+superlu-dist' in spec: | ||||
|             args.extend([ | ||||
|                 '-DHYPRE_ENABLE=ON', | ||||
|                 '-DHYPRE_INCLUDE_DIR=%s' % spec['hypre'].prefix.include, | ||||
|                 '-DHYPRE_LIBRARY_DIR=%s' % spec['hypre'].prefix.lib | ||||
|             ]) | ||||
|  | ||||
|         # Building with PETSc | ||||
|         if '+petsc' in spec: | ||||
|             args.extend([ | ||||
|                 '-DPETSC_ENABLE=ON', | ||||
|                 '-DPETSC_INCLUDE_DIR=%s' % spec['petsc'].prefix.include, | ||||
|                 '-DPETSC_LIBRARY_DIR=%s' % spec['petsc'].prefix.lib | ||||
|             ]) | ||||
|  | ||||
|         # Building with RAJA | ||||
|         if '+raja' in spec: | ||||
|             args.extend([ | ||||
|                 '-DRAJA_DIR=%s' % spec['raja'].prefix.share.raja.cmake | ||||
|                 '-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, | ||||
|                 '-DSUPERLUDIST_OpenMP=%s' | ||||
|                 % on_off('^superlu-dist+openmp') | ||||
|             ]) | ||||
|  | ||||
|         # Examples | ||||
|         if spec.satisfies('@3.0.0:'): | ||||
|             args.extend([ | ||||
|                 '-DEXAMPLES_ENABLE_C=%s'    % on_off('+examples-c'), | ||||
|                 '-DEXAMPLES_ENABLE_CXX=%s'  % on_off('+examples-cxx'), | ||||
|                 '-DEXAMPLES_ENABLE_F77=%s'  % on_off('+examples-f77'), | ||||
|                 '-DEXAMPLES_ENABLE_F90=%s'  % on_off('+examples-f90'), | ||||
|                 '-DEXAMPLES_ENABLE_CUDA=%s' % on_off('+examples-cuda'), | ||||
|                 '-DEXAMPLES_ENABLE_RAJA=%s' % on_off('+examples-raja') | ||||
|                 '-DEXAMPLES_ENABLE_C=%s'      % on_off('+examples-c'), | ||||
|                 '-DEXAMPLES_ENABLE_CXX=%s'    % on_off('+examples-cxx'), | ||||
|                 '-DEXAMPLES_ENABLE_F77=%s'    % on_off('+examples-f77'), | ||||
|                 '-DEXAMPLES_ENABLE_F90=%s'    % on_off('+examples-f90'), | ||||
|                 '-DEXAMPLES_ENABLE_F2003=%s'  % on_off('+examples-f2003'), | ||||
|                 '-DEXAMPLES_ENABLE_CUDA=%s'   % on_off('+examples-cuda'), | ||||
|                 # option removed in 5.0.0 | ||||
|                 '-DEXAMPLES_ENABLE_RAJA=%s'   % on_off('+raja') | ||||
|             ]) | ||||
|         else: | ||||
|             args.extend([ | ||||
| @@ -378,10 +401,12 @@ def filter_compilers(self): | ||||
|             'arkode/C_openmp/Makefile', | ||||
|             'arkode/C_parallel/Makefile', | ||||
|             'arkode/C_parhyp/Makefile', | ||||
|             'arkode/C_petsc/Makefile', | ||||
|             'arkode/C_serial/Makefile', | ||||
|             'cvode/C_openmp/Makefile', | ||||
|             'cvode/parallel/Makefile', | ||||
|             'cvode/parhyp/Makefile', | ||||
|             'cvode/petsc/Makefile', | ||||
|             'cvode/serial/Makefile', | ||||
|             'cvodes/C_openmp/Makefile', | ||||
|             'cvodes/parallel/Makefile', | ||||
| @@ -418,6 +443,7 @@ def filter_compilers(self): | ||||
|             'sunlinsol/sptfqmr/parallel/Makefile', | ||||
|             'sunlinsol/sptfqmr/serial/Makefile', | ||||
|             'sunlinsol/superlumt/Makefile', | ||||
|             'sunlinsol/superludist/Makefile', | ||||
|             'sunmatrix/band/Makefile', | ||||
|             'sunmatrix/dense/Makefile', | ||||
|             'sunmatrix/sparse/Makefile' | ||||
| @@ -450,6 +476,15 @@ def filter_compilers(self): | ||||
|             'arkode/F90_serial/Makefile' | ||||
|         ] | ||||
|  | ||||
|         f2003_files = [ | ||||
|             'arkode/F2003_serial/Makefile', | ||||
|             'cvode/F2003_serial/Makefile', | ||||
|             'cvodes/F2003_serial/Makefike', | ||||
|             'ida/F2003_serial/Makefile', | ||||
|             'idas/F2003_serial/Makefile', | ||||
|             'kinsol/F2003_serial/Makefile' | ||||
|         ] | ||||
|  | ||||
|         for filename in cc_files: | ||||
|             filter_file(os.environ['CC'], self.compiler.cc, | ||||
|                         os.path.join(dirname, filename), **kwargs) | ||||
| @@ -476,6 +511,11 @@ def filter_compilers(self): | ||||
|                 filter_file(os.environ['FC'], self.compiler.fc, | ||||
|                             os.path.join(dirname, filename), **kwargs) | ||||
|  | ||||
|         if ('+f2003' in spec) and ('+examples-f2003' in spec): | ||||
|             for filename in f2003_files: | ||||
|                 filter_file(os.environ['FC'], self.compiler.fc, | ||||
|                             os.path.join(dirname, filename), **kwargs) | ||||
|  | ||||
|     @property | ||||
|     def headers(self): | ||||
|         """Export the headers and defines of SUNDIALS. | ||||
|   | ||||
		Reference in New Issue
	
	Block a user