From 8365dbd959f0c8346017c64298fa1cac06122609 Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Mon, 16 Jan 2017 11:23:07 +0100 Subject: 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 --- var/spack/repos/builtin/packages/dealii/package.py | 12 ++++----- var/spack/repos/builtin/packages/hypre/package.py | 5 ++++ var/spack/repos/builtin/packages/metis/package.py | 8 +++--- var/spack/repos/builtin/packages/mumps/package.py | 4 +-- var/spack/repos/builtin/packages/petsc/package.py | 29 +++++++++++++++------- .../repos/builtin/packages/superlu-dist/package.py | 9 +++++-- 6 files changed, 44 insertions(+), 23 deletions(-) diff --git a/var/spack/repos/builtin/packages/dealii/package.py b/var/spack/repos/builtin/packages/dealii/package.py index 8c31b90f51..66267b2d9a 100644 --- a/var/spack/repos/builtin/packages/dealii/package.py +++ b/var/spack/repos/builtin/packages/dealii/package.py @@ -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 @@ class Dealii(CMakePackage): # 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 diff --git a/var/spack/repos/builtin/packages/hypre/package.py b/var/spack/repos/builtin/packages/hypre/package.py index 82a6b06b1f..ed0f665462 100644 --- a/var/spack/repos/builtin/packages/hypre/package.py +++ b/var/spack/repos/builtin/packages/hypre/package.py @@ -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 @@ class Hypre(Package): '--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") diff --git a/var/spack/repos/builtin/packages/metis/package.py b/var/spack/repos/builtin/packages/metis/package.py index ca48a47817..b66677288c 100644 --- a/var/spack/repos/builtin/packages/metis/package.py +++ b/var/spack/repos/builtin/packages/metis/package.py @@ -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 @@ class Metis(Package): 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 @@ class Metis(Package): @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: diff --git a/var/spack/repos/builtin/packages/mumps/package.py b/var/spack/repos/builtin/packages/mumps/package.py index fcb6549d29..82d0c606b6 100644 --- a/var/spack/repos/builtin/packages/mumps/package.py +++ b/var/spack/repos/builtin/packages/mumps/package.py @@ -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 @@ class Mumps(Package): 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 diff --git a/var/spack/repos/builtin/packages/petsc/package.py b/var/spack/repos/builtin/packages/petsc/package.py index ee062e92f6..a9d4ff6065 100644 --- a/var/spack/repos/builtin/packages/petsc/package.py +++ b/var/spack/repos/builtin/packages/petsc/package.py @@ -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 @@ class Petsc(Package): '--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 diff --git a/var/spack/repos/builtin/packages/superlu-dist/package.py b/var/spack/repos/builtin/packages/superlu-dist/package.py index 7d04673182..f076358e90 100644 --- a/var/spack/repos/builtin/packages/superlu-dist/package.py +++ b/var/spack/repos/builtin/packages/superlu-dist/package.py @@ -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 @@ class SuperluDist(Package): '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', -- cgit v1.2.3-70-g09d2