Skip to content

Commit

Permalink
Merge branch 'firedrake' into barral/allinone
Browse files Browse the repository at this point in the history
  • Loading branch information
jwallwork23 committed May 16, 2019
2 parents 640ef40 + b1847ae commit a614912
Show file tree
Hide file tree
Showing 656 changed files with 72,201 additions and 5,890 deletions.
4 changes: 1 addition & 3 deletions config/BuildSystem/config/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,12 +302,10 @@ def getExecutables(self, names, path = '', getFullPath = 0, useDefaultPath = 0,
# Preprocessor, Compiler, and Linker Operations
def pushLanguage(self, language):
if language == 'C++': language = 'Cxx'
self.logPrint('Pushing language '+language)
self.language.append(language)
return self.language[-1]

def popLanguage(self):
self.logPrint('Popping language '+self.language[-1])
self.language.pop()
return self.language[-1]

Expand Down Expand Up @@ -457,7 +455,7 @@ def report(command, status, output, error):
f = open(self.compilerSource, 'w')
f.write(self.getCode(codeStr))
f.close()
(out, err, ret) = Configure.executeShellCommand(command, checkCommand = report, timeout = timeout, log = self.log, lineLimit = 100000)
(out, err, ret) = Configure.executeShellCommand(command, checkCommand = report, timeout = timeout, log = self.log, logOutputflg = False, lineLimit = 100000)
if self.cleanup:
for filename in [self.compilerDefines, self.compilerFixes, self.compilerSource]:
if os.path.isfile(filename): os.remove(filename)
Expand Down
9 changes: 9 additions & 0 deletions config/BuildSystem/config/compilers.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@
import os
import shutil

def remove_xcode_verbose(buf):
retbuf =[]
for line in buf.splitlines():
if not line.startswith('ld: warning: text-based stub file'): retbuf.append(line)
return ('\n').join(retbuf)

class MissingProcessor(AttributeError):
pass

Expand Down Expand Up @@ -242,6 +248,7 @@ def checkCLibraries(self):
self.setCompilers.LDFLAGS = oldFlags
self.popLanguage()

output = remove_xcode_verbose(output)
# PGI: kill anything enclosed in single quotes
if output.find('\'') >= 0:
# Cray has crazy non-matching single quotes so skip the removal
Expand Down Expand Up @@ -552,6 +559,7 @@ def checkCxxLibraries(self):
self.setCompilers.LDFLAGS = oldFlags
self.popLanguage()

output = remove_xcode_verbose(output)
# PGI: kill anything enclosed in single quotes
if output.find('\'') >= 0:
if output.count('\'')%2: raise RuntimeError('Mismatched single quotes in C library string')
Expand Down Expand Up @@ -939,6 +947,7 @@ def checkFortranLibraries(self):
self.setCompilers.LDFLAGS = oldFlags
self.popLanguage()

output = remove_xcode_verbose(output)
# replace \CR that ifc puts in each line of output
output = output.replace('\\\n', '')

Expand Down
1 change: 1 addition & 0 deletions config/BuildSystem/config/framework.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,7 @@ def filterCompileOutput(self, output):
if output.find('warning #264: floating-point value does not fit in required floating-point type') >= 0: return output
if output.find('warning: ISO C90 does not support') >= 0: return output
if output.find('warning: ISO C does not support') >= 0: return output
if output.find('warning #2650: attributes ignored here') >= 0: return output
if output.find('Warning: attribute visibility is unsupported and will be skipped') >= 0: return output
if output.find('(E) Invalid statement found within an interface block. Executable statement, statement function or syntax error encountered.') >= 0: return output
elif self.argDB['ignoreCompileOutput']:
Expand Down
16 changes: 13 additions & 3 deletions config/BuildSystem/config/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,13 @@ def getPointerSizeFlag(self,cflags):
if cflags.find(flag) >=0: return flag
return ''

def getDebugFlags(self,cflags):
outflags = []
for flag in cflags.split():
if flag in ['-g','-g3','-Z7']:
outflags.append(flag)
return ' '.join(outflags)

def getWindowsNonOptFlags(self,cflags):
outflags = []
for flag in cflags.split():
Expand Down Expand Up @@ -356,7 +363,7 @@ def getIncludeDirs(self, prefix, includeDir):
def generateGuesses(self):
d = self.checkDownload()
if d:
if not self.liblist or self.builtafterpetsc :
if not self.liblist or not self.liblist[0] or self.builtafterpetsc :
yield('Download '+self.PACKAGE, d, [], self.getIncludeDirs(d, self.includedir))
for libdir in [self.libdir, self.altlibdir]:
libdirpath = os.path.join(d, libdir)
Expand Down Expand Up @@ -394,6 +401,9 @@ def generateGuesses(self):
fakeExternalPackagesDir+' is reserved for --download-package scratch space. \n'+
'Do not install software in this location nor use software in this directory.')

if not self.liblist or not self.liblist[0]:
yield('User specified root directory '+self.PACKAGE, d, [], self.getIncludeDirs(d, self.includedir))

for libdir in [self.libdir, self.altlibdir]:
libdirpath = os.path.join(d, libdir)
if not os.path.isdir(libdirpath):
Expand All @@ -409,7 +419,7 @@ def generateGuesses(self):
raise RuntimeError('--with-'+self.package+'-dir='+self.argDB['with-'+self.package+'-dir']+' did not work')

if 'with-'+self.package+'-include' in self.argDB and not 'with-'+self.package+'-lib' in self.argDB:
if self.liblist[0]:
if self.liblist and self.liblist[0]:
raise RuntimeError('If you provide --with-'+self.package+'-include you must also supply with-'+self.package+'-lib\n')
if 'with-'+self.package+'-lib' in self.argDB and not 'with-'+self.package+'-include' in self.argDB:
if self.includes:
Expand All @@ -418,7 +428,7 @@ def generateGuesses(self):
raise RuntimeError('Use --with-'+self.package+'-include; not --with-'+self.package+'-include-dir')

if 'with-'+self.package+'-include' in self.argDB or 'with-'+self.package+'-lib' in self.argDB:
if self.liblist[0]:
if self.liblist and self.liblist[0]:
libs = self.argDB['with-'+self.package+'-lib']
slibs = str(self.argDB['with-'+self.package+'-lib'])
else:
Expand Down
22 changes: 16 additions & 6 deletions config/BuildSystem/config/packages/BlasLapack.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,20 @@ def setupDependencies(self, framework):
return

def __str__(self):
return 'BLAS/LAPACK: '+self.libraries.toString(self.lib)+'\n'
output = config.package.Package.__str__(self)
if self.has64bitindices:
output += ' uses 64 bit integers\n'
else:
output += ' uses 32 bit integers\n'
return output

def setupHelp(self, help):
config.package.Package.setupHelp(self,help)
import nargs
help.addArgument('BLAS/LAPACK', '-with-blas-lib=<libraries: e.g. [/Users/..../libblas.a,...]>', nargs.ArgLibrary(None, None, 'Indicate the library(s) containing BLAS'))
help.addArgument('BLAS/LAPACK', '-with-lapack-lib=<libraries: e.g. [/Users/..../liblapack.a,...]>',nargs.ArgLibrary(None, None, 'Indicate the library(s) containing LAPACK'))
help.addArgument('BLAS/LAPACK', '-with-blaslapack-suffix=<string>',nargs.ArgLibrary(None, None, 'Indicate a suffix for BLAS/LAPACK subroutine names.'))
help.addArgument('BLAS/LAPACK', '-with-64-bit-blas-indices', nargs.ArgBool(None, 0, 'Try to use 64 bit integers for BLAS/LAPACK; will error if not available'))
# help.addArgument('BLAS/LAPACK', '-known-64-bit-blas-indices=<bool>', nargs.ArgBool(None, 0, 'Indicate if using 64 bit integer BLAS'))
return

Expand Down Expand Up @@ -208,8 +214,7 @@ def generateGuesses(self):
self.log.write('Looking for BLAS/LAPACK in user specified directory: '+dir+'\n')
self.log.write('Files and directories in that directory:\n'+str(os.listdir(dir))+'\n')

# If using 64 bit indices then look for 64 bit integer MKL
if self.defaultIndexSize == 64: ILP64 = '_ilp64'
if self.argDB['with-64-bit-blas-indices']: ILP64 = '_ilp64'
else: ILP64 = '_lp64'

# Look for Multi-Threaded MKL for MKL_C/Pardiso
Expand Down Expand Up @@ -250,6 +255,7 @@ def generateGuesses(self):
self.setCompilers.LDFLAGS += '-Wl,-rpath,'+os.path.join(dir,'bin','maci64')
yield ('User specified MATLAB [ILP64] MKL MacOS lib dir', None, [os.path.join(dir,'bin','maci64','mkl.dylib'), os.path.join(dir,'sys','os','maci64','libiomp5.dylib'), 'pthread'])
self.setCompilers.LDFLAGS = oldFlags
yield ('User specified MKL11/12 and later', None, [os.path.join(dir,'libmkl_intel'+ILP64+'.a'),'mkl_sequential','mkl_core','pthread'])
# Some new MKL 11/12 variations
for libdir in [os.path.join('lib','32'),os.path.join('lib','ia32'),'32','ia32','']:
if not os.path.exists(os.path.join(dir,libdir)):
Expand All @@ -260,7 +266,8 @@ def generateGuesses(self):
if not os.path.exists(os.path.join(dir,libdir)):
self.logPrint('MKL Path not found.. skipping: '+os.path.join(dir,libdir))
else:
yield ('User specified MKL11/12 Linux64', None, [os.path.join(dir,libdir,'libmkl_intel'+ILP64+'.a'),'mkl_sequential','mkl_core','pthread'])
yield ('User specified MKL11+ Linux64', None, [os.path.join(dir,libdir,'libmkl_intel'+ILP64+'.a'),'mkl_sequential','mkl_core','mkl_def','pthread'])
yield ('User specified MKL11+ Mac-64', None, [os.path.join(dir,libdir,'libmkl_intel'+ILP64+'.a'),'mkl_sequential','mkl_core','pthread'])
# Older Linux MKL checks
yield ('User specified MKL Linux lib dir', None, [os.path.join(dir, 'libmkl_lapack.a'), 'mkl', 'guide', 'pthread'])
for libdir in ['32','64','em64t']:
Expand Down Expand Up @@ -430,6 +437,8 @@ def configureLibrary(self):
self.executeTest(self.checkRuntimeIssues)
if self.mkl and self.has64bitindices:
self.addDefine('HAVE_LIBMKL_INTEL_ILP64',1)
if self.argDB['with-64-bit-blas-indices'] and not self.has64bitindices:
raise RuntimeError('You requested 64 bit integer BLAS/LAPACK using --with-64-bit-blas-indices but they are not available given your other BLAS/LAPACK options')

def checkESSL(self):
'''Check for the IBM ESSL library'''
Expand Down Expand Up @@ -466,8 +475,9 @@ def checkMKL(self):
break

if not found:
raise RuntimeError('Unable to find MKL include directory. Please source the mklvars-script to set up the MKL environment.\n')
self.logPrint('MKL include path set to ' + str(self.include))
self.logPrint('Unable to find MKL include directory!')
else:
self.logPrint('MKL include path set to ' + str(self.include))
self.logWrite(self.libraries.restoreLog())
return

Expand Down
12 changes: 12 additions & 0 deletions config/BuildSystem/config/packages/MFEM.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ def __init__(self, framework):
self.noMPIUni = 1
return

def setupHelp(self, help):
import nargs
config.package.Package.setupHelp(self, help)
help.addArgument('MFEM', '-download-mfem-ghv-cxx=<prog>', nargs.Arg(None, None, 'CXX Front-end compiler to compile get_hypre_version'))
return

def setupDependencies(self, framework):
config.package.Package.setupDependencies(self, framework)
self.hypre = framework.require('config.packages.hypre',self)
Expand Down Expand Up @@ -44,10 +50,15 @@ def Install(self):
cxxflags = self.setCompilers.getCompilerFlags()
cxxflags = cxxflags.replace('-fvisibility=hidden','') # MFEM is currently broken with -fvisibility=hidden
self.setCompilers.popLanguage()
if 'download-mfem-ghv-cxx' in self.argDB and self.argDB['download-mfem-ghv-cxx']:
ghv = self.argDB['download-mfem-ghv-cxx']
else:
ghv = cxx

with open(os.path.join(configDir,'user.mk'),'w') as g:
g.write('PREFIX = '+prefix+'\n')
g.write('MPICXX = '+cxx+'\n')
g.write('export GHV_CXX = '+ghv+'\n')
g.write('CXXFLAGS = '+cxxflags+'\n')
if self.argDB['with-shared-libraries']:
g.write('SHARED = YES\n')
Expand All @@ -57,6 +68,7 @@ def Install(self):
g.write('STATIC = YES\n')
g.write('AR = '+self.setCompilers.AR+'\n')
g.write('ARFLAGS = '+self.setCompilers.AR_FLAGS+'\n')
g.write('LDFLAGS = '+self.setCompilers.LDFLAGS+'\n')
g.write('MFEM_USE_MPI = YES\n')
g.write('MFEM_MPIEXEC = '+self.mpi.mpiexec+'\n')
g.write('MFEM_USE_METIS_5 = YES\n')
Expand Down
17 changes: 0 additions & 17 deletions config/BuildSystem/config/packages/Numpy.py

This file was deleted.

6 changes: 5 additions & 1 deletion config/BuildSystem/config/packages/ctetgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@ def postProcess(self):
try:
self.logPrintBox('Compiling Ctetgen; this may take several minutes')
# uses the regular PETSc library builder and then moves result
output,err,ret = config.package.GNUPackage.executeShellCommand(self.make.make+' PETSC_DIR='+self.petscdir.dir+' clean lib',timeout=1000, log = self.log, cwd=self.packageDir)
# turn off any compiler optimizations as they may break CTETGEN
self.setCompilers.pushLanguage('C')
cflags = self.checkNoOptFlag()+' '+self.getSharedFlag(self.setCompilers.getCompilerFlags())+' '+self.getPointerSizeFlag(self.setCompilers.getCompilerFlags())+' '+self.getWindowsNonOptFlags(self.setCompilers.getCompilerFlags())+' '+self.getDebugFlags(self.setCompilers.getCompilerFlags())
self.setCompilers.popLanguage()
output,err,ret = config.package.GNUPackage.executeShellCommand(self.make.make+' PETSC_DIR='+self.petscdir.dir+' clean lib PCC_FLAGS="'+cflags+'"',timeout=1000, log = self.log, cwd=self.packageDir)
self.log.write(output+err)
self.logPrintBox('Installing Ctetgen; this may take several minutes')
self.installDirProvider.printSudoPasswordMessage(1)
Expand Down
8 changes: 0 additions & 8 deletions config/BuildSystem/config/packages/cuda.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,12 @@ def __init__(self, framework):
self.precisions = ['single','double']
self.cxx = 0
self.complex = 1
self.cudaArch = ''
self.CUDAVersion = 0
self.CUDAMinVersion = (7, 5)
self.hastests = 0
self.hastestsdatafiles= 0
return

def __str__(self):
output = config.package.Package.__str__(self)
output += ' Arch: '+self.cudaArch+'\n'
return output

def setupHelp(self, help):
import nargs
config.package.Package.setupHelp(self, help)
Expand Down Expand Up @@ -80,8 +74,6 @@ def checkSizeofVoidP(self):

def configureTypes(self):
import config.setCompilers
if not config.setCompilers.Configure.isGNU(self.setCompilers.CC, self.log):
raise RuntimeError('Must use GNU compilers with CUDA')
if not self.getDefaultPrecision() in ['double', 'single']:
raise RuntimeError('Must use either single or double precision with CUDA')
self.checkSizeofVoidP()
Expand Down
4 changes: 2 additions & 2 deletions config/BuildSystem/config/packages/fftw.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ class Configure(config.package.GNUPackage):
def __init__(self, framework):
config.package.GNUPackage.__init__(self, framework)
# host locally as fftw.org url can expire after new release.
self.download = ['http://www.fftw.org/fftw-3.3.7.tar.gz',
'http://ftp.mcs.anl.gov/pub/petsc/externalpackages/fftw-3.3.7.tar.gz']
self.download = ['http://www.fftw.org/fftw-3.3.8.tar.gz',
'http://ftp.mcs.anl.gov/pub/petsc/externalpackages/fftw-3.3.8.tar.gz']
self.functions = ['fftw_malloc','fftw_mpi_cleanup']
self.includes = ['fftw3-mpi.h']
self.liblist = [['libfftw3_mpi.a','libfftw3.a']]
Expand Down
14 changes: 8 additions & 6 deletions config/BuildSystem/config/packages/mpi4py.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
class Configure(config.package.Package):
def __init__(self, framework):
config.package.Package.__init__(self, framework)
self.download = ['https://mpi4py.googlecode.com/files/mpi4py-1.3.1.tar.gz',
'http://ftp.mcs.anl.gov/pub/petsc/externalpackages/mpi4py-1.3.1.tar.gz']
self.download = ['https://bitbucket.org/mpi4py/mpi4py/downloads/mpi4py-3.0.1.tar.gz',
'http://ftp.mcs.anl.gov/pub/petsc/externalpackages/mpi4py-3.0.1.tar.gz']
self.functions = []
self.includes = []
self.useddirectly = 0
return

def setupDependencies(self, framework):
config.package.Package.setupDependencies(self, framework)
self.numpy = framework.require('config.packages.Numpy',self)
self.python = framework.require('config.packages.python',self)
self.setCompilers = framework.require('config.setCompilers',self)
self.sharedLibraries = framework.require('PETSc.options.sharedLibraries', self)
self.installdir = framework.require('PETSc.options.installDir',self)
Expand All @@ -37,16 +37,16 @@ def Install(self):
self.addMakeRule('mpi4pybuild','', \
['@echo "*** Building mpi4py ***"',\
'@(MPICC=${PCC} && export MPICC && cd '+self.packageDir+' && \\\n\
python setup.py clean --all && \\\n\
'+archflags+'python setup.py build ) > ${PETSC_ARCH}/lib/petsc/conf/mpi4py.log 2>&1 || \\\n\
'+self.python.pyexe+' setup.py clean --all && \\\n\
'+archflags+self.python.pyexe+' setup.py build ) > ${PETSC_ARCH}/lib/petsc/conf/mpi4py.log 2>&1 || \\\n\
(echo "**************************ERROR*************************************" && \\\n\
echo "Error building mpi4py. Check ${PETSC_ARCH}/lib/petsc/conf/mpi4py.log" && \\\n\
echo "********************************************************************" && \\\n\
exit 1)'])
self.addMakeRule('mpi4pyinstall','', \
['@echo "*** Installing mpi4py ***"',\
'@(MPICC=${PCC} && export MPICC && cd '+self.packageDir+' && \\\n\
'+archflags+'python setup.py install --install-lib='+os.path.join(self.installDir,'lib')+') >> ${PETSC_ARCH}/lib/petsc/conf/mpi4py.log 2>&1 || \\\n\
'+archflags+self.python.pyexe+' setup.py install --install-lib='+os.path.join(self.installDir,'lib')+') >> ${PETSC_ARCH}/lib/petsc/conf/mpi4py.log 2>&1 || \\\n\
(echo "**************************ERROR*************************************" && \\\n\
echo "Error building mpi4py. Check ${PETSC_ARCH}/lib/petsc/conf/mpi4py.log" && \\\n\
echo "********************************************************************" && \\\n\
Expand All @@ -67,6 +67,8 @@ def configureLibrary(self):
self.checkDownload()
if not self.sharedLibraries.useShared:
raise RuntimeError('mpi4py requires PETSc be built with shared libraries; rerun with --with-shared-libraries')
if not self.python.numpy:
raise RuntimeError('mpi4py requires Python with numpy module installed')

def alternateConfigureLibrary(self):
self.addMakeRule('mpi4py-build','')
Expand Down
2 changes: 1 addition & 1 deletion config/BuildSystem/config/packages/openblas.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def Install(self):
raise RuntimeError('Cannot request OpenBLAS without Fortran compiler, use --download-f2cblaslapack intead')

cmdline = 'CC='+self.compilers.CC+' FC='+self.compilers.FC
if self.argDB['download-openblas-64-bit-blas-indices']:
if self.argDB['download-openblas-64-bit-blas-indices'] or self.argDB['with-64-bit-blas-indices']:
cmdline += " INTERFACE64=1 "
if 'download-openblas-make-options' in self.argDB and self.argDB['download-openblas-make-options']:
cmdline+=" "+self.argDB['download-openblas-make-options']
Expand Down
Loading

0 comments on commit a614912

Please sign in to comment.