grackle : added package (#1725)
Modifications : * grackle : added package * grackle : added version 2.2
This commit is contained in:
		 Massimiliano Culpo
					Massimiliano Culpo
				
			
				
					committed by
					
						 Todd Gamblin
						Todd Gamblin
					
				
			
			
				
	
			
			
			 Todd Gamblin
						Todd Gamblin
					
				
			
						parent
						
							3c7ea3000a
						
					
				
				
					commit
					1cc48bf7d7
				
			
							
								
								
									
										71
									
								
								var/spack/repos/builtin/packages/grackle/Make.mach.template
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										71
									
								
								var/spack/repos/builtin/packages/grackle/Make.mach.template
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,71 @@ | ||||
| MACH_TEXT  = Generic Linux | ||||
| MACH_VALID = 1 | ||||
| MACH_FILE  = Make.mach.@ARCHITECTURE | ||||
|  | ||||
| #----------------------------------------------------------------------- | ||||
| # Install paths (local variables) | ||||
| #----------------------------------------------------------------------- | ||||
|  | ||||
| LOCAL_HDF5_INSTALL = @HDF5_ROOT | ||||
|  | ||||
| #----------------------------------------------------------------------- | ||||
| # Compiler settings | ||||
| #----------------------------------------------------------------------- | ||||
|  | ||||
| MACH_CC_NOMPI  = @CC # C compiler | ||||
| MACH_CXX_NOMPI = @CXX # C++ compiler | ||||
| MACH_FC_NOMPI  = @F77 # Fortran 77 | ||||
| MACH_F90_NOMPI = @FC # Fortran 90 | ||||
| MACH_LD_NOMPI  = @FC # Linker | ||||
| @LINK_VARIABLES_DEFINITION | ||||
|  | ||||
| #----------------------------------------------------------------------- | ||||
| # Machine-dependent defines | ||||
| #----------------------------------------------------------------------- | ||||
|  | ||||
| MACH_DEFINES   = -DLINUX -DH5_USE_16_API -fPIC | ||||
|  | ||||
| #----------------------------------------------------------------------- | ||||
| # Compiler flag settings | ||||
| #----------------------------------------------------------------------- | ||||
|  | ||||
| MACH_CPPFLAGS = -P -traditional | ||||
| MACH_CFLAGS   =  | ||||
| MACH_CXXFLAGS =  | ||||
| MACH_FFLAGS   = -fno-second-underscore -ffixed-line-length-132 | ||||
| MACH_F90FLAGS = -fno-second-underscore | ||||
| MACH_LDFLAGS  = @STDCXX_LIB | ||||
|  | ||||
| #----------------------------------------------------------------------- | ||||
| # Optimization flags | ||||
| #----------------------------------------------------------------------- | ||||
|  | ||||
| MACH_OPT_WARN        = -Wall -g | ||||
| MACH_OPT_DEBUG       = -g | ||||
| MACH_OPT_HIGH        = -O2 | ||||
| MACH_OPT_AGGRESSIVE  = -O3 -g | ||||
|  | ||||
| #----------------------------------------------------------------------- | ||||
| # Includes | ||||
| #----------------------------------------------------------------------- | ||||
|  | ||||
| LOCAL_INCLUDES_HDF5   = -I@HDF5_ROOT/include # HDF5 includes | ||||
|  | ||||
| MACH_INCLUDES         = $(LOCAL_INCLUDES_HDF5) | ||||
|  | ||||
| #----------------------------------------------------------------------- | ||||
| # Libraries | ||||
| #----------------------------------------------------------------------- | ||||
|  | ||||
| LOCAL_LIBS_HDF5   = -L@HDF5_ROOT/lib -lhdf5 # HDF5 libraries | ||||
| LOCAL_LIBS_MACH   =  # Machine-dependent libraries | ||||
|  | ||||
| MACH_LIBS         = $(LOCAL_LIBS_HDF5) $(LOCAL_LIBS_MACH) | ||||
|  | ||||
| #----------------------------------------------------------------------- | ||||
| # Installation | ||||
| #----------------------------------------------------------------------- | ||||
|  | ||||
| MACH_INSTALL_PREFIX = @PREFIX | ||||
| MACH_INSTALL_LIB_DIR = | ||||
| MACH_INSTALL_INCLUDE_DIR = | ||||
							
								
								
									
										89
									
								
								var/spack/repos/builtin/packages/grackle/package.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										89
									
								
								var/spack/repos/builtin/packages/grackle/package.py
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,89 @@ | ||||
| ############################################################################## | ||||
| # Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC. | ||||
| # Produced at the Lawrence Livermore National Laboratory. | ||||
| # | ||||
| # This file is part of Spack. | ||||
| # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. | ||||
| # LLNL-CODE-647188 | ||||
| # | ||||
| # For details, see https://github.com/llnl/spack | ||||
| # Please also see the LICENSE file for our notice and the LGPL. | ||||
| # | ||||
| # This program is free software; you can redistribute it and/or modify | ||||
| # it under the terms of the GNU Lesser General Public License (as | ||||
| # published by the Free Software Foundation) version 2.1, February 1999. | ||||
| # | ||||
| # This program is distributed in the hope that it will be useful, but | ||||
| # WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF | ||||
| # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and | ||||
| # conditions of the GNU Lesser General Public License for more details. | ||||
| # | ||||
| # You should have received a copy of the GNU Lesser General Public | ||||
| # License along with this program; if not, write to the Free Software | ||||
| # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||||
| ############################################################################## | ||||
| import os.path | ||||
| import shutil | ||||
| import inspect | ||||
|  | ||||
| from spack import * | ||||
|  | ||||
|  | ||||
| class Grackle(Package): | ||||
|     """Grackle is a chemistry and radiative cooling library for astrophysical | ||||
|     simulations with interfaces for C, C++, and Fortran codes. It is a | ||||
|     generalized and trimmed down version of the chemistry network of the Enzo | ||||
|     simulation code | ||||
|     """ | ||||
|     homepage = 'http://grackle.readthedocs.io/en/grackle-2.2/' | ||||
|     url = 'https://bitbucket.org/grackle/grackle/get/grackle-2.0.1.tar.bz2' | ||||
|  | ||||
|     version('2.2', 'ec49ed1db5a42db21f478285150c2ba3') | ||||
|     version('2.0.1', 'a9624ad13a60c592c1a0a4ea8e1ae86d') | ||||
|  | ||||
|     depends_on('libtool', when='@2.2') | ||||
|  | ||||
|     depends_on('mpi') | ||||
|     depends_on('hdf5+mpi') | ||||
|  | ||||
|     parallel = False | ||||
|  | ||||
|     def install(self, spec, prefix): | ||||
|         template_name = '{0.architecture}-{0.compiler.name}' | ||||
|         grackle_architecture = template_name.format(spec) | ||||
|         link_variables = 'MACH_AR = ar' if spec.version < Version(2.2) else 'MACH_LIBTOOL = libtool'  # NOQA: ignore=E501 | ||||
|         substitutions = { | ||||
|             '@ARCHITECTURE': grackle_architecture, | ||||
|             '@CC': spec['mpi'].mpicc, | ||||
|             '@CXX': spec['mpi'].mpicxx, | ||||
|             '@FC': spec['mpi'].mpifc, | ||||
|             '@F77': spec['mpi'].mpif77, | ||||
|             '@STDCXX_LIB': ' '.join(self.compiler.stdcxx_libs), | ||||
|             '@HDF5_ROOT': spec['hdf5'].prefix, | ||||
|             '@PREFIX': prefix, | ||||
|             '@LINK_VARIABLES_DEFINITION': link_variables | ||||
|         } | ||||
|  | ||||
|         template = join_path( | ||||
|             os.path.dirname(inspect.getmodule(self).__file__), | ||||
|             'Make.mach.template' | ||||
|         ) | ||||
|         makefile = join_path( | ||||
|             self.stage.source_path, | ||||
|             'src', | ||||
|             'clib', | ||||
|             'Make.mach.{0}'.format(grackle_architecture) | ||||
|         ) | ||||
|         shutil.copy(template, makefile) | ||||
|         for key, value in substitutions.items(): | ||||
|             filter_file(key, value, makefile) | ||||
|  | ||||
|         configure() | ||||
|         with working_dir('src/clib'): | ||||
|             make('clean') | ||||
|             make('machine-{0}'.format(grackle_architecture)) | ||||
|             make('opt-high') | ||||
|             make('show-config') | ||||
|             make() | ||||
|             mkdirp(prefix.lib) | ||||
|             make('install') | ||||
		Reference in New Issue
	
	Block a user