Skip to content

Commit

Permalink
Merge branch 'master' into firedrake
Browse files Browse the repository at this point in the history
  • Loading branch information
wence- committed Aug 8, 2019
2 parents b1847ae + 0ba6fdb commit e1bf88b
Show file tree
Hide file tree
Showing 2,144 changed files with 145,366 additions and 44,176 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ docs/exampleconcepts
docs/faq.html
docs/installation.html
docs/linearsolvertable.html
docs/manconcepts
docs/manual.pdf
docs/developers.pdf
docs/troubleshooting.html
Expand Down
2 changes: 1 addition & 1 deletion .gitmessage
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@


Commit-type: i.e. bug-fix, portability-fix, testing-fix, style-fix, feature, documentation, example
Commit-type: i.e. optimization, bug-fix, portability-fix, testing-fix, style-fix, feature, documentation, example
Funded-by:
Project:
Time: hours
Expand Down
1 change: 0 additions & 1 deletion .hgignore
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ docs/exampleconcepts
docs/faq.html
docs/installation.html
docs/linearsolvertable.html
docs/manconcepts
docs/manual.pdf
docs/developers.pdf
docs/troubleshooting.html
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ before_install:
- if [[ -n "$MPI" ]]; then export CC=mpicc CXX=mpicxx FC=mpifort; fi
- export NBUILD=`getconf _NPROCESSORS_ONLN`
install:
- ./configure --with-cc=$CC --with-cxx=$CXX --with-fc=$FC --with-clanguage=${LANGUAGE:-C} --with-64-bit-indices=${INT64:-0} --with-scalar-type=${SCALAR:-real} --with-precision=${PRECISION:-double} --with-mpi=${MPI:-0} $BLASLAPACK COPTFLAGS="$OPTFLAGS" CXXOPTFLAGS="$OPTFLAGS" FOPTFLAGS="$OPTFLAGS"
- ./configure --with-cc=$CC --with-cxx=$CXX --with-fc=$FC --with-clanguage=${LANGUAGE:-C} --with-64-bit-indices=${INT64:-0} --with-scalar-type=${SCALAR:-real} --with-precision=${PRECISION:-double} --with-mpi=${MPI:-0} $BLASLAPACK COPTFLAGS="$OPTFLAGS" CXXOPTFLAGS="$OPTFLAGS" FOPTFLAGS="$OPTFLAGS" --with-cxx-dialect=0
- make -j$NBUILD CPPFLAGS=-DPETSC_USE_CXX_COMPLEX_FLOAT_WORKAROUND

script:
Expand Down
4 changes: 4 additions & 0 deletions config/BuildSystem/config/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,10 @@ def getExecutable(self, names, path = [], getFullPath = 0, useDefaultPath = 0, r
- If found, the path is stored in the variable "name", or "resultName" if given
- By default, a make macro "resultName" will hold the path'''
found = 0
if isinstance(names,str) and names.startswith('/'):
path = os.path.dirname(names)
names = os.path.basename(names)

if isinstance(names, str):
names = [names]
if isinstance(path, str):
Expand Down
10 changes: 8 additions & 2 deletions config/BuildSystem/config/compilerFlags.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@ def configureCompilerFlags(self):
bopts.append('g')
else:
bopts.append('O')

# According to gcc doc, gcov does not require -g, so we do it alone
if self.argDB['with-gcov']:
bopts.append('gcov')

options = self.getOptionsObject()
if not options:
return
Expand All @@ -96,17 +101,18 @@ def configureCompilerFlags(self):
try:
self.rejected[language] = []
for bopt in bopts:
if not bopt == '' and self.getOptionalFlagsName(language) in self.argDB:
if bopt in ['g','O'] and self.getOptionalFlagsName(language) in self.argDB: # check --COPTFLAGS etc
# treat user supplied options as single option - as it could include options separated by spaces '-tp k8-64'
flags = [self.argDB[self.getOptionalFlagsName(language)]]
elif not bopt == '' and self.hasOptFlags(getattr(self.setCompilers,flagsName)):
elif bopt in ['g','O'] and self.hasOptFlags(getattr(self.setCompilers,flagsName)): # check --CFLAGS etc
self.logPrint('Optimization options found in '+flagsName+ '. Skipping setting defaults')
flags = []
elif bopt == '' and flagsName in self.argDB:
self.logPrint('Ignoring default options which were overridden using --'+flagsName+ ' ' + self.argDB[flagsName])
flags = []
else:
flags = options.getCompilerFlags(language, self.setCompilers.getCompiler(), bopt)

for testFlag in flags:
if isinstance(testFlag,tuple):
testFlag = ' '.join(testFlag)
Expand Down
17 changes: 10 additions & 7 deletions config/BuildSystem/config/compilerOptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ def getCFlags(self, compiler, bopt):
if not nargs.ArgBool('with-errorchecking', arg if arg is not None else '1', isTemporary=True).getValue():
flags.extend(['-Wno-unused-but-set-variable'])
elif bopt == 'g':
if self.argDB['with-gcov']:
flags.extend(['-fprofile-arcs', '-ftest-coverage'])
flags.append('-g3')
elif bopt == 'gcov':
flags.extend(['--coverage','-Og']) # --coverage is equal to -fprofile-arcs -ftest-coverage. Use -Og to have accurate coverage result and fine performance
elif bopt == 'O':
flags.append('-g')
if config.setCompilers.Configure.isClang(compiler, self.log):
Expand Down Expand Up @@ -119,10 +119,10 @@ def getCxxFlags(self, compiler, bopt):
if not nargs.ArgBool('with-errorchecking', arg if arg is not None else '1', isTemporary=True).getValue():
flags.extend(['-Wno-unused-but-set-variable'])
elif bopt in ['g']:
if self.argDB['with-gcov']:
flags.extend(['-fprofile-arcs', '-ftest-coverage'])
# -g3 causes an as SEGV on OSX
flags.append('-g')
elif bopt == 'gcov':
flags.extend(['--coverage','-Og'])
elif bopt in ['O']:
flags.append('-g')
if 'USER' in os.environ:
Expand Down Expand Up @@ -204,12 +204,12 @@ def getFortranFlags(self, compiler, bopt):
if not config.setCompilers.Configure.isGfortran47plus(compiler, self.log):
flags.extend(['-Wno-unused-variable']) # older gfortran warns about unused common block constants
if config.setCompilers.Configure.isGfortran45x(compiler, self.log):
flags.extend(['-Wno-line-truncation']) # Work around bug in this series, fixed in 4.6: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42852
flags.extend(['-Wno-line-truncation']) # Work around bug in this series, fixed in 4.6: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=42852
elif bopt == 'g':
if self.argDB['with-gcov']:
flags.extend(['-fprofile-arcs', '-ftest-coverage'])
# g77 3.2.3 preprocesses the file into nothing if we give -g3
flags.append('-g')
elif bopt == 'gcov':
flags.extend(['--coverage','-Og'])
elif bopt == 'O':
flags.append('-g')
flags.extend(['-O'])
Expand Down Expand Up @@ -257,6 +257,8 @@ def getFortranFlags(self, compiler, bopt):
return flags

def getCompilerFlags(self, language, compiler, bopt):
if bopt == 'gcov' and not config.setCompilers.Configure.isGNU(compiler, self.log) and not config.setCompilers.Configure.isClang(compiler, self.log):
raise RuntimeError('Having --with-gcov but the compiler is neither GCC nor Clang, we do not know how to do gcov')
flags = ''
if language == 'C' or language == 'CUDA':
flags = self.getCFlags(compiler, bopt)
Expand Down Expand Up @@ -300,4 +302,5 @@ def getCompilerVersion(self, language, compiler):
except RuntimeError as e:
self.logWrite('Could not determine compiler version: '+str(e))
self.logWrite('getCompilerVersion: '+str(compiler)+' '+str(version)+'\n')
self.framework.addMakeMacro(language+'_VERSION',version)
return version
Loading

0 comments on commit e1bf88b

Please sign in to comment.