AMReX: update package.py (#8697)

This commit is contained in:
mic84 2018-07-26 11:29:03 -07:00 committed by Adam J. Stewart
parent 8b718e7cd6
commit 61aa1831e3

View file

@ -26,61 +26,63 @@
class Amrex(CMakePackage): class Amrex(CMakePackage):
"""AMReX is the successor to BoxLib. """AMReX is a publicly available software framework designed
It is a Block-Structured AMR Framework. for building massively parallel block- structured adaptive
""" mesh refinement (AMR) applications."""
homepage = "https://ccse.lbl.gov/AMReX/index.html" homepage = "https://amrex-codes.github.io/amrex/"
git = "https://github.com/AMReX-Codes/amrex.git" git = "https://github.com/AMReX-Codes/amrex.git"
version('develop', tag='development') version('develop', branch='development')
version('master', tag='master')
version('17.06', commit='836d3c7')
variant('dims', # Config options
default='3', variant('dimensions', default='3',
values=('1', '2', '3'), description='Dimensionality', values=('2', '3'))
multi=False, variant('shared', default=False,
description='Number of spatial dimensions') description='Build shared library')
variant('mpi', default=True,
variant('prec', description='Build with MPI support')
default='DOUBLE', variant('openmp', default=False,
values=('FLOAT', 'DOUBLE'), description='Build with OpenMP support')
multi=False, variant('precision', default='double',
description='Floating point precision') description='Real precision (double/single)',
values=('single', 'double'))
variant('mpi', default=True, description='Enable MPI parallel support') variant('eb', default=False,
variant('openmp', default=False, description='Enable OpenMP parallel support') description='Build Embedded Boundary classes')
variant('fortran', default=True, description='Enable Fortran support') variant('fortran', default=False,
variant('debug', default=False, description='Enable debugging features') description='Build Fortran API')
variant('particles', default=False, description='Include particle classes in build') variant('linear_solvers', default=True,
description='Build linear solvers')
variant('amrdata', default=False,
description='Build data services')
variant('particles', default=False,
description='Build particle classes')
variant('build_type', default='Release',
description='The build type to build',
values=('Debug', 'Release'))
# Build dependencies
depends_on('mpi', when='+mpi') depends_on('mpi', when='+mpi')
depends_on('python@2.7:', type='build')
depends_on('cmake@3.5:', type='build')
def cmake_is_on(self, option):
return 'ON' if option in self.spec else 'OFF'
def cmake_args(self): def cmake_args(self):
spec = self.spec args = [
'-DUSE_XSDK_DEFAULTS=ON',
cmake_args = [ '-DDIM:STRING=%s' % self.spec.variants['dimensions'].value,
'-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON', '-DBUILD_SHARED_LIBS:BOOL=%s' % self.cmake_is_on('+shared'),
'-DBL_SPACEDIM:INT=%d' % int(spec.variants['dims'].value), '-DENABLE_MPI:BOOL=%s' % self.cmake_is_on('+mpi'),
'-DBL_PRECISION:STRING=%s' % spec.variants['prec'].value, '-DENABLE_OMP:BOOL=%s' % self.cmake_is_on('+openmp'),
'-DENABLE_FMG=%s' % ('+fortran' in spec), '-DXSDK_PRECISION:STRING=%s' %
'-DENABLE_FBASELIB=%s' % ('+fortran' in spec), self.spec.variants['precision'].value.upper(),
'-DBL_DEBUG:INT=%d' % int('+debug' in spec), '-DENABLE_EB:BOOL=%s' % self.cmake_is_on('+eb'),
'-DBL_USE_PARTICLES:INT=%d' % int('+particles' in spec), '-DXSDK_ENABLE_Fortran:BOOL=%s' % self.cmake_is_on('+fortran'),
'-DENABLE_MPI:INT=%d' % int('+mpi' in spec), '-DENABLE_LINEAR_SOLVERS:BOOL=%s' %
'-DENABLE_OpenMP:INT=%d' % int('+openmp' in spec), self.cmake_is_on('+linear_solvers'),
'-DENABLE_AMRDATA:BOOL=%s' % self.cmake_is_on('+amrdata'),
'-DENABLE_PARTICLES:BOOL=%s' % self.cmake_is_on('+particles')
] ]
return args
if '+mpi' in spec:
cmake_args += [
'-DCMAKE_C_COMPILER=%s' % spec['mpi'].mpicc,
'-DCMAKE_CXX_COMPILER=%s' % spec['mpi'].mpicxx
]
if '+fortran' in spec:
cmake_args += [
'-DCMAKE_Fortran_COMPILER=%s' % spec['mpi'].mpifc
]
cmake_args += ['-DENABLE_FORTRAN_MPI=%s' % ('+fortran' in spec)]
return cmake_args