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:
parent
e2697e4a37
commit
8365dbd959
@ -66,7 +66,7 @@ class Dealii(CMakePackage):
|
|||||||
description='Compile with Trilinos (only with MPI)')
|
description='Compile with Trilinos (only with MPI)')
|
||||||
variant('python', default=True,
|
variant('python', default=True,
|
||||||
description='Compile with Python bindings')
|
description='Compile with Python bindings')
|
||||||
variant('64bit', default=False,
|
variant('int64', default=False,
|
||||||
description='Compile with 64 bit indices support')
|
description='Compile with 64 bit indices support')
|
||||||
|
|
||||||
# required dependencies, light version
|
# required dependencies, light version
|
||||||
@ -108,11 +108,11 @@ class Dealii(CMakePackage):
|
|||||||
depends_on("netcdf-cxx", when='+netcdf+mpi')
|
depends_on("netcdf-cxx", when='+netcdf+mpi')
|
||||||
depends_on("oce", when='+oce')
|
depends_on("oce", when='+oce')
|
||||||
depends_on("p4est", when='+p4est+mpi')
|
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('python', when='@8.5.0:+python')
|
||||||
depends_on("slepc", when='@8.4.2:+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~64bit')
|
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~64bit')
|
depends_on("slepc@:3.6.3", when='@:8.4.1+slepc+petsc+mpi~int64')
|
||||||
depends_on("trilinos", when='+trilinos+mpi')
|
depends_on("trilinos", when='+trilinos+mpi')
|
||||||
|
|
||||||
def build_type(self):
|
def build_type(self):
|
||||||
@ -244,7 +244,7 @@ def cmake_args(self):
|
|||||||
|
|
||||||
# 64 bit indices
|
# 64 bit indices
|
||||||
options.extend([
|
options.extend([
|
||||||
'-DDEAL_II_WITH_64BIT_INDICES=%s' % ('+64bit' in spec)
|
'-DDEAL_II_WITH_64BIT_INDICES=%s' % ('+int64' in spec)
|
||||||
])
|
])
|
||||||
|
|
||||||
return options
|
return options
|
||||||
|
@ -46,6 +46,8 @@ class Hypre(Package):
|
|||||||
# SuperluDist have conflicting headers with those in Hypre
|
# SuperluDist have conflicting headers with those in Hypre
|
||||||
variant('internal-superlu', default=True,
|
variant('internal-superlu', default=True,
|
||||||
description="Use internal Superlu routines")
|
description="Use internal Superlu routines")
|
||||||
|
variant('int64', default=False,
|
||||||
|
description="Use 64bit integers")
|
||||||
|
|
||||||
depends_on("mpi")
|
depends_on("mpi")
|
||||||
depends_on("blas")
|
depends_on("blas")
|
||||||
@ -68,6 +70,9 @@ def install(self, spec, prefix):
|
|||||||
'--with-blas-lib-dirs=%s' % ' '.join(blas.directories)
|
'--with-blas-lib-dirs=%s' % ' '.join(blas.directories)
|
||||||
]
|
]
|
||||||
|
|
||||||
|
if '+int64' in self.spec:
|
||||||
|
configure_args.append('--enable-bigint')
|
||||||
|
|
||||||
if '+shared' in self.spec:
|
if '+shared' in self.spec:
|
||||||
configure_args.append("--enable-shared")
|
configure_args.append("--enable-shared")
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ class Metis(Package):
|
|||||||
variant('debug', default=False, description='Builds the library in debug mode.')
|
variant('debug', default=False, description='Builds the library in debug mode.')
|
||||||
variant('gdb', default=False, description='Enables gdb support.')
|
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.')
|
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')
|
depends_on('cmake@2.8:', when='@5:', type='build')
|
||||||
@ -69,7 +69,7 @@ def patch(self):
|
|||||||
|
|
||||||
metis_header.filter(
|
metis_header.filter(
|
||||||
r'(\b)(IDXTYPEWIDTH )(\d+)(\b)',
|
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(
|
metis_header.filter(
|
||||||
r'(\b)(REALTYPEWIDTH )(\d+)(\b)',
|
r'(\b)(REALTYPEWIDTH )(\d+)(\b)',
|
||||||
@ -87,9 +87,9 @@ def patch(self):
|
|||||||
@when('@:4')
|
@when('@:4')
|
||||||
def install(self, spec, prefix):
|
def install(self, spec, prefix):
|
||||||
# Process library spec and options
|
# 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 '
|
raise InstallError('METIS@:4 does not support the following '
|
||||||
'variants: gdb, idx64, real64.')
|
'variants: gdb, int64, real64.')
|
||||||
|
|
||||||
options = ['COPTIONS=-fPIC']
|
options = ['COPTIONS=-fPIC']
|
||||||
if '+debug' in spec:
|
if '+debug' in spec:
|
||||||
|
@ -55,7 +55,7 @@ class Mumps(Package):
|
|||||||
description='Activate the compilation of smumps')
|
description='Activate the compilation of smumps')
|
||||||
variant('complex', default=True,
|
variant('complex', default=True,
|
||||||
description='Activate the compilation of cmumps and/or zmumps')
|
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')
|
description='Use int64_t/integer*8 as default index type')
|
||||||
variant('shared', default=True, description='Build shared libraries')
|
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 ''
|
fpic = '-fPIC' if '+shared' in self.spec else ''
|
||||||
# TODO: test this part, it needs a full blas, scalapack and
|
# TODO: test this part, it needs a full blas, scalapack and
|
||||||
# partitionning environment with 64bit integers
|
# partitionning environment with 64bit integers
|
||||||
if '+idx64' in self.spec:
|
if '+int64' in self.spec:
|
||||||
makefile_conf.extend(
|
makefile_conf.extend(
|
||||||
# the fortran compilation flags most probably are
|
# the fortran compilation flags most probably are
|
||||||
# working only for intel and gnu compilers this is
|
# working only for intel and gnu compilers this is
|
||||||
|
@ -67,14 +67,19 @@ class Petsc(Package):
|
|||||||
variant('hypre', default=True,
|
variant('hypre', default=True,
|
||||||
description='Activates support for Hypre (only parallel)')
|
description='Activates support for Hypre (only parallel)')
|
||||||
variant('mumps', default=True,
|
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,
|
variant('superlu-dist', default=True,
|
||||||
description='Activates support for SuperluDist (only parallel)')
|
description='Activates support for SuperluDist (only parallel)')
|
||||||
|
variant('int64', default=False,
|
||||||
|
description='Compile with 64bit indices')
|
||||||
|
|
||||||
# Virtual dependencies
|
# Virtual dependencies
|
||||||
# Git repository needs sowing to build Fortran interface
|
# Git repository needs sowing to build Fortran interface
|
||||||
depends_on('sowing', when='@develop')
|
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('blas')
|
||||||
depends_on('lapack')
|
depends_on('lapack')
|
||||||
depends_on('mpi', when='+mpi')
|
depends_on('mpi', when='+mpi')
|
||||||
@ -84,7 +89,8 @@ class Petsc(Package):
|
|||||||
|
|
||||||
# Other dependencies
|
# Other dependencies
|
||||||
depends_on('boost', when='@:3.5+boost')
|
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('hdf5+mpi', when='+hdf5+mpi')
|
||||||
depends_on('parmetis', when='+metis+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
|
# Also PETSc prefer to build it without internal superlu, likely due to
|
||||||
# conflict in headers see
|
# conflict in headers see
|
||||||
# https://bitbucket.org/petsc/petsc/src/90564b43f6b05485163c147b464b5d6d28cde3ef/config/BuildSystem/config/packages/hypre.py
|
# https://bitbucket.org/petsc/petsc/src/90564b43f6b05485163c147b464b5d6d28cde3ef/config/BuildSystem/config/packages/hypre.py
|
||||||
depends_on('hypre~internal-superlu', when='+hypre+mpi~complex')
|
depends_on('hypre~internal-superlu~int64', when='+hypre+mpi~complex~int64')
|
||||||
depends_on('superlu-dist@:4.3', when='@3.4.4:3.6.4+superlu-dist+mpi')
|
depends_on('hypre~internal-superlu+int64', when='+hypre+mpi~complex+int64')
|
||||||
depends_on('superlu-dist@5.0.0:', when='@3.7:+superlu-dist+mpi')
|
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:', when='@for-pflotran-0.1.0+superlu-dist+mpi')
|
depends_on('superlu-dist@:4.3+int64', when='@3.4.4:3.6.4+superlu-dist+mpi+int64')
|
||||||
depends_on('mumps+mpi', when='+mumps+mpi')
|
depends_on('superlu-dist@5.0.0:~int64', when='@3.7:+superlu-dist+mpi~int64')
|
||||||
depends_on('scalapack', when='+mumps+mpi')
|
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):
|
def mpi_dependent_options(self):
|
||||||
if '~mpi' in self.spec:
|
if '~mpi' in self.spec:
|
||||||
@ -146,7 +156,8 @@ def install(self, spec, prefix):
|
|||||||
'--with-scalar-type=%s' % (
|
'--with-scalar-type=%s' % (
|
||||||
'complex' if '+complex' in spec else 'real'),
|
'complex' if '+complex' in spec else 'real'),
|
||||||
'--with-shared-libraries=%s' % ('1' if '+shared' in spec else '0'),
|
'--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
|
# Make sure we use exactly the same Blas/Lapack libraries
|
||||||
# across the DAG. To that end list them explicitly
|
# across the DAG. To that end list them explicitly
|
||||||
|
@ -43,6 +43,9 @@ class SuperluDist(Package):
|
|||||||
version('4.0', 'c0b98b611df227ae050bc1635c6940e0')
|
version('4.0', 'c0b98b611df227ae050bc1635c6940e0')
|
||||||
version('3.3', 'f4805659157d93a962500902c219046b')
|
version('3.3', 'f4805659157d93a962500902c219046b')
|
||||||
|
|
||||||
|
variant('int64', default=False,
|
||||||
|
description="Use 64bit integers")
|
||||||
|
|
||||||
depends_on('mpi')
|
depends_on('mpi')
|
||||||
depends_on('blas')
|
depends_on('blas')
|
||||||
depends_on('lapack')
|
depends_on('lapack')
|
||||||
@ -66,8 +69,10 @@ def install(self, spec, prefix):
|
|||||||
'ARCHFLAGS = cr',
|
'ARCHFLAGS = cr',
|
||||||
'RANLIB = true',
|
'RANLIB = true',
|
||||||
'CC = {0}'.format(self.spec['mpi'].mpicc),
|
'CC = {0}'.format(self.spec['mpi'].mpicc),
|
||||||
'CFLAGS = -fPIC -std=c99 -O2 -I%s -I%s' % (
|
'CFLAGS = -fPIC -std=c99 -O2 -I%s -I%s %s' % (
|
||||||
spec['parmetis'].prefix.include, spec['metis'].prefix.include),
|
spec['parmetis'].prefix.include,
|
||||||
|
spec['metis'].prefix.include,
|
||||||
|
'-D_LONGINT' if '+int64' in spec else ''),
|
||||||
'NOOPTS = -fPIC -std=c99',
|
'NOOPTS = -fPIC -std=c99',
|
||||||
'FORTRAN = {0}'.format(self.spec['mpi'].mpif77),
|
'FORTRAN = {0}'.format(self.spec['mpi'].mpif77),
|
||||||
'F90FLAGS = -O2',
|
'F90FLAGS = -O2',
|
||||||
|
Loading…
Reference in New Issue
Block a user