petsc: add 64bit variant (#2655)

* petsc: add 64bit variant

* hypre: add int64 variant

* superlu-dist: add int64 variant

* petsc: add int64 variant

* metis: rename idx64 to int64 to make it consistent with other packages

* mumps: rename idx64 to int64 to make it consistent with other packages

* dealii: rename 64bit to int64 to make it consistent with other packages
This commit is contained in:
Denis Davydov 2017-01-16 11:23:07 +01:00 committed by Todd Gamblin
parent e2697e4a37
commit 8365dbd959
6 changed files with 44 additions and 23 deletions

View File

@ -66,7 +66,7 @@ class Dealii(CMakePackage):
description='Compile with Trilinos (only with MPI)')
variant('python', default=True,
description='Compile with Python bindings')
variant('64bit', default=False,
variant('int64', default=False,
description='Compile with 64 bit indices support')
# required dependencies, light version
@ -108,11 +108,11 @@ class Dealii(CMakePackage):
depends_on("netcdf-cxx", when='+netcdf+mpi')
depends_on("oce", when='+oce')
depends_on("p4est", when='+p4est+mpi')
depends_on("petsc+mpi", when='@8.4.2:+petsc+mpi~64bit')
depends_on("petsc+mpi", when='@8.4.2:+petsc+mpi~int64')
depends_on('python', when='@8.5.0:+python')
depends_on("slepc", when='@8.4.2:+slepc+petsc+mpi~64bit')
depends_on("petsc@:3.6.4+mpi", when='@:8.4.1+petsc+mpi~64bit')
depends_on("slepc@:3.6.3", when='@:8.4.1+slepc+petsc+mpi~64bit')
depends_on("slepc", when='@8.4.2:+slepc+petsc+mpi~int64')
depends_on("petsc@:3.6.4+mpi", when='@:8.4.1+petsc+mpi~int64')
depends_on("slepc@:3.6.3", when='@:8.4.1+slepc+petsc+mpi~int64')
depends_on("trilinos", when='+trilinos+mpi')
def build_type(self):
@ -244,7 +244,7 @@ def cmake_args(self):
# 64 bit indices
options.extend([
'-DDEAL_II_WITH_64BIT_INDICES=%s' % ('+64bit' in spec)
'-DDEAL_II_WITH_64BIT_INDICES=%s' % ('+int64' in spec)
])
return options

View File

@ -46,6 +46,8 @@ class Hypre(Package):
# SuperluDist have conflicting headers with those in Hypre
variant('internal-superlu', default=True,
description="Use internal Superlu routines")
variant('int64', default=False,
description="Use 64bit integers")
depends_on("mpi")
depends_on("blas")
@ -68,6 +70,9 @@ def install(self, spec, prefix):
'--with-blas-lib-dirs=%s' % ' '.join(blas.directories)
]
if '+int64' in self.spec:
configure_args.append('--enable-bigint')
if '+shared' in self.spec:
configure_args.append("--enable-shared")

View File

@ -47,7 +47,7 @@ class Metis(Package):
variant('debug', default=False, description='Builds the library in debug mode.')
variant('gdb', default=False, description='Enables gdb support.')
variant('idx64', default=False, description='Sets the bit width of METIS\'s index type to 64.')
variant('int64', default=False, description='Sets the bit width of METIS\'s index type to 64.')
variant('real64', default=False, description='Sets the bit width of METIS\'s real type to 64.')
depends_on('cmake@2.8:', when='@5:', type='build')
@ -69,7 +69,7 @@ def patch(self):
metis_header.filter(
r'(\b)(IDXTYPEWIDTH )(\d+)(\b)',
r'\1\2{0}\4'.format('64' if '+idx64' in self.spec else '32'),
r'\1\2{0}\4'.format('64' if '+int64' in self.spec else '32'),
)
metis_header.filter(
r'(\b)(REALTYPEWIDTH )(\d+)(\b)',
@ -87,9 +87,9 @@ def patch(self):
@when('@:4')
def install(self, spec, prefix):
# Process library spec and options
if any('+{0}'.format(v) in spec for v in ['gdb', 'idx64', 'real64']):
if any('+{0}'.format(v) in spec for v in ['gdb', 'int64', 'real64']):
raise InstallError('METIS@:4 does not support the following '
'variants: gdb, idx64, real64.')
'variants: gdb, int64, real64.')
options = ['COPTIONS=-fPIC']
if '+debug' in spec:

View File

@ -55,7 +55,7 @@ class Mumps(Package):
description='Activate the compilation of smumps')
variant('complex', default=True,
description='Activate the compilation of cmumps and/or zmumps')
variant('idx64', default=False,
variant('int64', default=False,
description='Use int64_t/integer*8 as default index type')
variant('shared', default=True, description='Build shared libraries')
@ -125,7 +125,7 @@ def write_makefile_inc(self):
fpic = '-fPIC' if '+shared' in self.spec else ''
# TODO: test this part, it needs a full blas, scalapack and
# partitionning environment with 64bit integers
if '+idx64' in self.spec:
if '+int64' in self.spec:
makefile_conf.extend(
# the fortran compilation flags most probably are
# working only for intel and gnu compilers this is

View File

@ -67,14 +67,19 @@ class Petsc(Package):
variant('hypre', default=True,
description='Activates support for Hypre (only parallel)')
variant('mumps', default=True,
description='Activates support for MUMPS (only parallel)')
description='Activates support for MUMPS (only parallel'
' and 32bit indices)')
variant('superlu-dist', default=True,
description='Activates support for SuperluDist (only parallel)')
variant('int64', default=False,
description='Compile with 64bit indices')
# Virtual dependencies
# Git repository needs sowing to build Fortran interface
depends_on('sowing', when='@develop')
# PETSc, hypre, superlu_dist when built with int64 use 32 bit integers
# with BLAS/LAPACK
depends_on('blas')
depends_on('lapack')
depends_on('mpi', when='+mpi')
@ -84,7 +89,8 @@ class Petsc(Package):
# Other dependencies
depends_on('boost', when='@:3.5+boost')
depends_on('metis@5:', when='+metis')
depends_on('metis@5:~int64', when='+metis~int64')
depends_on('metis@5:+int64', when='+metis+int64')
depends_on('hdf5+mpi', when='+hdf5+mpi')
depends_on('parmetis', when='+metis+mpi')
@ -92,12 +98,16 @@ class Petsc(Package):
# Also PETSc prefer to build it without internal superlu, likely due to
# conflict in headers see
# https://bitbucket.org/petsc/petsc/src/90564b43f6b05485163c147b464b5d6d28cde3ef/config/BuildSystem/config/packages/hypre.py
depends_on('hypre~internal-superlu', when='+hypre+mpi~complex')
depends_on('superlu-dist@:4.3', when='@3.4.4:3.6.4+superlu-dist+mpi')
depends_on('superlu-dist@5.0.0:', when='@3.7:+superlu-dist+mpi')
depends_on('superlu-dist@5.0.0:', when='@for-pflotran-0.1.0+superlu-dist+mpi')
depends_on('mumps+mpi', when='+mumps+mpi')
depends_on('scalapack', when='+mumps+mpi')
depends_on('hypre~internal-superlu~int64', when='+hypre+mpi~complex~int64')
depends_on('hypre~internal-superlu+int64', when='+hypre+mpi~complex+int64')
depends_on('superlu-dist@:4.3~int64', when='@3.4.4:3.6.4+superlu-dist+mpi~int64')
depends_on('superlu-dist@:4.3+int64', when='@3.4.4:3.6.4+superlu-dist+mpi+int64')
depends_on('superlu-dist@5.0.0:~int64', when='@3.7:+superlu-dist+mpi~int64')
depends_on('superlu-dist@5.0.0:+int64', when='@3.7:+superlu-dist+mpi+int64')
depends_on('superlu-dist@5.0.0:~int64', when='@for-pflotran-0.1.0+superlu-dist+mpi~int64')
depends_on('superlu-dist@5.0.0:+int64', when='@for-pflotran-0.1.0+superlu-dist+mpi+int64')
depends_on('mumps+mpi', when='+mumps+mpi~int64')
depends_on('scalapack', when='+mumps+mpi~int64')
def mpi_dependent_options(self):
if '~mpi' in self.spec:
@ -146,7 +156,8 @@ def install(self, spec, prefix):
'--with-scalar-type=%s' % (
'complex' if '+complex' in spec else 'real'),
'--with-shared-libraries=%s' % ('1' if '+shared' in spec else '0'),
'--with-debugging=%s' % ('1' if '+debug' in spec else '0')
'--with-debugging=%s' % ('1' if '+debug' in spec else '0'),
'--with-64-bit-indices=%s' % ('1' if '+int64' in spec else '0')
])
# Make sure we use exactly the same Blas/Lapack libraries
# across the DAG. To that end list them explicitly

View File

@ -43,6 +43,9 @@ class SuperluDist(Package):
version('4.0', 'c0b98b611df227ae050bc1635c6940e0')
version('3.3', 'f4805659157d93a962500902c219046b')
variant('int64', default=False,
description="Use 64bit integers")
depends_on('mpi')
depends_on('blas')
depends_on('lapack')
@ -66,8 +69,10 @@ def install(self, spec, prefix):
'ARCHFLAGS = cr',
'RANLIB = true',
'CC = {0}'.format(self.spec['mpi'].mpicc),
'CFLAGS = -fPIC -std=c99 -O2 -I%s -I%s' % (
spec['parmetis'].prefix.include, spec['metis'].prefix.include),
'CFLAGS = -fPIC -std=c99 -O2 -I%s -I%s %s' % (
spec['parmetis'].prefix.include,
spec['metis'].prefix.include,
'-D_LONGINT' if '+int64' in spec else ''),
'NOOPTS = -fPIC -std=c99',
'FORTRAN = {0}'.format(self.spec['mpi'].mpif77),
'F90FLAGS = -O2',