add mpi variant to p4est package to allow turning off MPI (#12739)
This commit is contained in:
		
				
					committed by
					
						
						Adam J. Stewart
					
				
			
			
				
	
			
			
			
						parent
						
							331e4e32be
						
					
				
				
					commit
					c3a2528022
				
			@@ -18,6 +18,7 @@ class P4est(AutotoolsPackage):
 | 
			
		||||
    version('2.0', 'c522c5b69896aab39aa5a81399372a19a6b03fc6200d2d5d677d9a22fe31029a')
 | 
			
		||||
    version('1.1', '37ba7f4410958cfb38a2140339dbf64f')
 | 
			
		||||
 | 
			
		||||
    variant('mpi', default=True, description='Enable MPI')
 | 
			
		||||
    variant('openmp', default=False, description='Enable OpenMP')
 | 
			
		||||
 | 
			
		||||
    # build dependencies
 | 
			
		||||
@@ -26,7 +27,7 @@ class P4est(AutotoolsPackage):
 | 
			
		||||
    depends_on('libtool@2.4.2:', type='build')
 | 
			
		||||
 | 
			
		||||
    # other dependencies
 | 
			
		||||
    depends_on('mpi')
 | 
			
		||||
    depends_on('mpi', when='+mpi')
 | 
			
		||||
    depends_on('zlib')
 | 
			
		||||
 | 
			
		||||
    # from sc upstream, correct the default libraries
 | 
			
		||||
@@ -45,7 +46,6 @@ def autoreconf(self, spec, prefix):
 | 
			
		||||
 | 
			
		||||
    def configure_args(self):
 | 
			
		||||
        args = [
 | 
			
		||||
            '--enable-mpi',
 | 
			
		||||
            '--enable-shared',
 | 
			
		||||
            '--disable-vtk-binary',
 | 
			
		||||
            '--without-blas',
 | 
			
		||||
@@ -57,6 +57,11 @@ def configure_args(self):
 | 
			
		||||
            'F77=%s' % self.spec['mpi'].mpif77
 | 
			
		||||
        ]
 | 
			
		||||
 | 
			
		||||
        if '~mpi' in self.spec:
 | 
			
		||||
            args.append('--disable-mpi')
 | 
			
		||||
        else:
 | 
			
		||||
            args.append('--enable-mpi')
 | 
			
		||||
 | 
			
		||||
        if '+openmp' in self.spec:
 | 
			
		||||
            try:
 | 
			
		||||
                args.append(
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user