Skip to content

Commit 1c1d65e

Browse files
authored
Merge pull request #22 from firedrakeproject/JDBetteridge/merge_upstream
JDBetteridge/merge upstream
2 parents 3a8a225 + 9281ddf commit 1c1d65e

File tree

2,520 files changed

+99939
-77708
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,520 files changed

+99939
-77708
lines changed

.clang-format

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,16 @@ StatementMacros:
172172
- PETSC_PRAGMA_DIAGNOSTIC_IGNORED_END
173173
- PETSC_PRAGMA_DIAGNOSTIC_IGNORED_END_
174174
- _Pragma
175+
TypeNames:
176+
- PetscScalar
177+
- PetscComplex
178+
- PetscReal
179+
- PetscInt
180+
- PetscMPIInt
181+
- PetscBLASInt
182+
- PetscErrorCode
183+
- PetscBool
184+
- PetscBool3
175185
TabWidth: 2
176186
UseCRLF: false
177187
UseTab: Never

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
bfort-petsc.txt
12
*.bkp
23
*.info
34
*.gcov

.gitlab-ci.yml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ check-ci-settings:
7878
- ${PYTHON} -m pip list --user
7979
- printf "CONFIG_OPTS:${CONFIG_OPTS}\n"
8080
- printf "PETSC_OPTIONS:$PETSC_OPTIONS\n"
81+
- printf "MODULEPATH:$MODULEPATH\n"
8182
- if [ ! -z ${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME+x} ]; then printf "CI_MERGE_REQUEST_SOURCE_BRANCH_NAME:$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME\n" ;fi
8283
- ${PYTHON} ./configure --with-debugging=0 COPTFLAGS='-O3 -march=native' CXXOPTFLAGS='-O3 -march=native' FOPTFLAGS='-O3 -march=native' ${CONFIG_OPTS}
8384
- make CFLAGS="${MAKE_CFLAGS}" CXXFLAGS="${MAKE_CXXFLAGS}" FFLAGS="${MAKE_FFLAGS}" CUDAFLAGS="${MAKE_CUDAFLAGS}"
@@ -156,14 +157,16 @@ clang-uni:
156157
extends: .stage-1
157158
variables:
158159
CONFIG_OPTS: --with-cc=clang --with-cxx=clang++ --with-mpi=0 --with-strict-petscerrorcode
160+
MAKE_CFLAGS: -Werror -Wmissing-field-initializers -Wundef -Wextra-semi-stmt
161+
MAKE_CXXFLAGS: -Werror -Wzero-as-null-pointer-constant -Wundef -Wextra-semi-stmt -Wextra-semi
159162
TEST_SEARCH: snes_tutorials-ex48%
160163

161164
gcc-lto:
162165
extends: .stage-1
163166
variables:
164167
CONFIG_OPTS: CFLAGS= CXXFLAGS= FFLAGS=
165168
MAKE_CFLAGS: -Werror -flto=4 -Werror=odr -Werror=lto-type-mismatch
166-
MAKE_CXXFLAGS: -Werror -flto=4 -Werror=odr -Werror=lto-type-mismatch
169+
MAKE_CXXFLAGS: -Werror -Wextra-semi -flto=4 -Werror=odr -Werror=lto-type-mismatch
167170
MAKE_FFLAGS: -Werror -flto=4 -Werror=odr -Werror=lto-type-mismatch
168171
TEST_SEARCH: snes_tutorials-ex19% snes_tutorials-ex5f%
169172
LOAD_MODULES: gcc/12.1.0 mpich/4.1-gcc-12.1.0
@@ -237,8 +240,7 @@ checksource:
237240
- python3 ./configure --with-mpi=0 --with-fc=0 --with-cxx=0 --with-x=0 --with-bison=0 --with-cmake=0 --with-pthread=0 --with-regex=0
238241
- vermin --version
239242
- make vermin
240-
- PATH=/nfs/gce/projects/petsc/soft/u22.04/spack-2024-03-06/opt/spack/linux-ubuntu22.04-x86_64/gcc-11.4.0/llvm-18.1.0-7hsf4hzma6aebqsd4ifb5brchcooktkp/bin:$PATH make checkclangformat SHELL=bash
241-
- PATH=/nfs/gce/projects/petsc/soft/u22.04/spack-2024-03-06/opt/spack/linux-ubuntu22.04-x86_64/gcc-11.4.0/llvm-18.1.5-ug2n4c7cb3xrf3dxn7fkffuvcgfdzzpk/bin:$PATH make checkclangformat SHELL=bash
243+
- PATH=/nfs/gce/projects/petsc/soft/u22.04/spack-2024-09-18/opt/spack/linux-ubuntu22.04-x86_64/gcc-11.4.0/llvm-19.1.0-dqibzqq5utu2fba2me2bodbnaj5y7c36/bin:$PATH make checkclangformat SHELL=bash
242244
- make checkbadSource SHELL=bash
243245
- make checkbadFileChange SHELL=bash
244246
- make -f gmakefile check_output SHELL=bash
@@ -300,7 +302,7 @@ pause-for-approval:
300302
printf "RUN_GCOV_OPTIONS:$RUN_GCOV_OPTIONS\n";
301303
gcovr --version;
302304
fi
303-
- if [ -d ${HOME}/petsc-hash-pkgs/ ]; then find ${HOME}/petsc-hash-pkgs/ -maxdepth 1 -mindepth 1 -type d -mtime +25 -exec rm -rf {} \; ; fi
305+
- if [ -d ${HOME}/petsc-hash-pkgs/ ]; then find ${HOME}/petsc-hash-pkgs/ -maxdepth 1 -mindepth 1 -type d -mtime +25 -exec touch {} \; -exec rm -rf {} \; ; fi
304306
- printf "PATH:$PATH\n"
305307
- printf "PYTHONPATH:$PYTHONPATH\n"
306308
- printf "PETSC_OPTIONS:$PETSC_OPTIONS\n"
@@ -734,6 +736,8 @@ linux-cxx-cmplx-pkgs-64idx:
734736
variables:
735737
TEST_ARCH: arch-ci-linux-cxx-cmplx-pkgs-64idx
736738
PETSC_OPTIONS: -fp_trap
739+
MODULEPATH: /nfs/gce/projects/petsc/soft/u22.04/spack-2024-08-30/modules/linux-ubuntu22.04-x86_64/Core
740+
LOAD_MODULES: python/3.13.0rc1-rayc5m7 py-setuptools/69.2.0-6yku3zk python-venv/1.0-bnbfk2n py-pip/23.1.2-o7dlzno
737741

738742
# Set env vars for 'Kokkos + OpenMP' tests, so that they won't give warnings
739743
linux-pkgs-dbg-ftn-interfaces:
@@ -810,7 +814,8 @@ linux-pgi:
810814
- gce-u22-stage3, linux-mcpu
811815
variables:
812816
TEST_ARCH: arch-ci-linux-pgi
813-
LOAD_MODULES: nvhpc/22.3
817+
MODULEPATH: /nfs/gce/projects/petsc/soft/u22.04/spack-2024-09-18/modules/linux-ubuntu22.04-x86_64/Core
818+
LOAD_MODULES: nvhpc/24.7-nypdnhf
814819

815820
# If the Nag license server fails then ${PETSC_DIR}/naglicenseproblem is created and the job is marked as failed but allow_failure
816821
linux-nagfor:
@@ -854,7 +859,7 @@ check-each-commit:
854859
tags:
855860
- gce-u22-stage2
856861
script:
857-
- export PATH=/nfs/gce/projects/petsc/soft/u22.04/spack-2024-03-06/opt/spack/linux-ubuntu22.04-x86_64/gcc-11.4.0/llvm-18.1.0-7hsf4hzma6aebqsd4ifb5brchcooktkp/bin:$PATH
862+
- export PATH=/nfs/gce/projects/petsc/soft/u22.04/spack-2024-09-18/opt/spack/linux-ubuntu22.04-x86_64/gcc-11.4.0/llvm-19.1.0-dqibzqq5utu2fba2me2bodbnaj5y7c36/bin:$PATH
858863
- lib/petsc/bin/maint/check-each-commit.sh
859864
except:
860865
variables:
@@ -964,6 +969,8 @@ linux-opt-cxx-quad:
964969
- gce-u22-stage3
965970
variables:
966971
TEST_ARCH: arch-ci-linux-opt-cxx-quad
972+
MODULEPATH: /nfs/gce/projects/petsc/soft/u22.04/spack-2024-08-30/modules/linux-ubuntu22.04-x86_64/Core
973+
LOAD_MODULES: python/3.13.0rc1-rayc5m7
967974

968975
linux-ILP64:
969976
extends:

config/BuildSystem/RDict.py

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ class RDict(dict):
8383
def __init__(self, parentAddr = None, parentDirectory = None, load = 1, autoShutdown = 1, readonly = False):
8484
import atexit
8585
import time
86-
import xdrlib
8786

8887
self.logFile = None
8988
self.setupLogFile()
@@ -98,8 +97,6 @@ def __init__(self, parentAddr = None, parentDirectory = None, load = 1, autoShut
9897
self.isServer = 0
9998
self.readonly = readonly
10099
self.parentDirectory = parentDirectory
101-
self.packer = xdrlib.Packer()
102-
self.unpacker = xdrlib.Unpacker('')
103100
self.stopCmd = pickle.dumps(('stop',))
104101
self.writeLogLine('Greetings')
105102
self.connectParent(self.parentAddr, self.parentDirectory)
@@ -110,25 +107,20 @@ def __init__(self, parentAddr = None, parentDirectory = None, load = 1, autoShut
110107
return
111108

112109
def __getstate__(self):
113-
'''Remove any parent socket object, the XDR translators, and the log file from the dictionary before pickling'''
110+
'''Remove any parent socket object, and the log file from the dictionary before pickling'''
114111
self.writeLogLine('Pickling RDict')
115112
d = self.__dict__.copy()
116113
if 'parent' in d: del d['parent']
117114
if 'saveTimer' in d: del d['saveTimer']
118115
if '_setCommandLine' in d: del d['_setCommandLine']
119-
del d['packer']
120-
del d['unpacker']
121116
del d['logFile']
122117
return d
123118

124119
def __setstate__(self, d):
125-
'''Reconnect the parent socket object, recreate the XDR translators and reopen the log file after unpickling'''
120+
'''Reconnect the parent socket object and reopen the log file after unpickling'''
126121
self.logFile = open('RDict.log', 'a')
127122
self.writeLogLine('Unpickling RDict')
128123
self.__dict__.update(d)
129-
import xdrlib
130-
self.packer = xdrlib.Packer()
131-
self.unpacker = xdrlib.Unpacker('')
132124
self.connectParent(self.parentAddr, self.parentDirectory)
133125
return
134126

@@ -477,13 +469,9 @@ def sendPacket(self, s, packet, source = 'Unknown', isPickled = 0):
477469
p = packet
478470
else:
479471
p = pickle.dumps(packet)
480-
self.packer.reset()
481-
self.packer.pack_uint(len(p))
482472
if hasattr(s, 'write'):
483-
s.write(self.packer.get_buffer())
484473
s.write(p)
485474
else:
486-
s.sendall(self.packer.get_buffer())
487475
s.sendall(p)
488476
self.writeLogLine(source+': Sent packet')
489477
return
@@ -495,9 +483,6 @@ def recvPacket(self, s, source = 'Unknown'):
495483
s.read(4)
496484
value = pickle.load(s)
497485
else:
498-
# I probably need to check that it actually read these 4 bytes
499-
self.unpacker.reset(s.recv(4))
500-
length = self.unpacker.unpack_uint()
501486
objString = ''
502487
while len(objString) < length:
503488
objString += s.recv(length - len(objString))

config/BuildSystem/config/compilerOptions.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ def getCFlags(self, compiler, bopt, language):
2626
if config.setCompilers.Configure.isGNU(compiler, self.log) or config.setCompilers.Configure.isClang(compiler, self.log):
2727
if bopt == '':
2828
flags.extend(['-Wall', '-Wwrite-strings', '-Wno-unknown-pragmas', '-Wno-lto-type-mismatch'])
29+
if config.setCompilers.Configure.isClang(compiler, self.log):
30+
# gcc does not support -Wno-implicit-float-conversion so -Wconversion is always noisy
31+
flags.extend(['-Wconversion', '-Wno-sign-conversion', '-Wno-float-conversion', '-Wno-implicit-float-conversion'])
2932
if config.setCompilers.Configure.isGcc110plus(compiler, self.log):
3033
flags.extend(['-Wno-stringop-overflow'])
3134
# skip -fstack-protector for brew gcc - as this gives SEGV

config/BuildSystem/config/compilers.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ def checkCLibraries(self):
188188
if hasattr(self.setCompilers, 'CXX'):
189189
self.setCompilers.saveLog()
190190
try:
191-
if self.checkCrossLink('#include <stdio.h>\nvoid asub(void)\n{char s[16];printf("testing %s",s);}\n',"int main(int argc,char **args)\n{return 0;}\n",language1='C',language2='C++'):
191+
if self.checkCrossLink('#include <stdio.h>\nvoid asub(void)\n{char s[16];printf("testing %s",s);}\n',"int main(int argc,char **args)\n{(void)argc, (void)args; return 0;}\n",language1='C',language2='C++'):
192192
self.logWrite(self.setCompilers.restoreLog())
193193
self.logPrint('C libraries are not needed when using C++ linker')
194194
else:
@@ -853,8 +853,8 @@ def checkFortranLibraries(self):
853853
skipfortranlibraries = 1
854854
self.setCompilers.saveLog()
855855
asub=self.mangleFortranFunction("asub")
856-
cbody = "extern void "+asub+"(void);\nint main(int argc,char **args)\n{\n "+asub+"();\n return 0;\n}\n";
857-
cxxbody = 'extern "C" void '+asub+'(void);\nint main(int argc,char **args)\n{\n '+asub+'();\n return 0;\n}\n';
856+
cbody = "extern void "+asub+"(void);\nint main(int argc,char **args)\n{\n "+asub+"();\n (void)argc, (void)args;\n return 0;\n}\n";
857+
cxxbody = 'extern "C" void '+asub+'(void);\nint main(int argc,char **args)\n{\n '+asub+'();\n (void)argc, (void)args;\n return 0;\n}\n';
858858
self.pushLanguage('FC')
859859
if self.checkLink(body=' use mpi\n call MPI_Allreduce()\n'):
860860
fbody = " subroutine asub()\n use mpi\n print*,'testing'\n call MPI_Allreduce()\n return\n end\n"

config/BuildSystem/config/framework.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,7 @@ def filterPreprocessOutput(self,output, log = None):
454454
lines = [s for s in lines if s.find("icc: command line remark #10148: option '-i-dynamic' not supported") < 0]
455455
lines = [s for s in lines if s.find("[: unexpected operator") < 0] # Deals with error in mpiicc and mpiicpc wrappers from some versions of Intel MPI.
456456
lines = [s for s in lines if s.find(': remark #10441:') < 0]
457+
lines = [s for s in lines if s.find("'linker' input unused") < 0]
457458
# IBM:
458459
lines = [s for s in lines if not s.startswith('cc_r:')]
459460
# PGI: Ignore warning about temporary license
@@ -469,6 +470,8 @@ def filterPreprocessOutput(self,output, log = None):
469470
lines = [s for s in lines if s.find('The -gpu option has no effect unless a language-specific option to enable GPU code generation is used') < 0]
470471
# pgi dumps filename on stderr - but returns 0 errorcode'
471472
lines = [s for s in lines if lines != 'conftest.c:']
473+
# nvcc
474+
lines = [s for s in lines if s.find('incompatible redefinition for option \'compiler-bindir\', the last value of this option was used') < 0]
472475

473476
lines = [s for s in lines if len(s)]
474477
if lines: output = '\n'.join(lines)
@@ -517,6 +520,7 @@ def filterCompileOutput(self, output,flag = '', filterAlways = 0):
517520
# Intel
518521
lines = [s for s in lines if s.find("icc: command line remark #10148: option '-i-dynamic' not supported") < 0]
519522
lines = [s for s in lines if s.find(': remark #10441:') < 0]
523+
lines = [s for s in lines if s.find("'linker' input unused") < 0]
520524
# PGI: Ignore warning about temporary license
521525
lines = [s for s in lines if s.find('license.dat') < 0]
522526
# Cray XT3
@@ -531,8 +535,9 @@ def filterCompileOutput(self, output,flag = '', filterAlways = 0):
531535
lines = [s for s in lines if s.find('The -gpu option has no effect unless a language-specific option to enable GPU code generation is used') < 0]
532536
# pgi dumps filename on stderr - but returns 0 errorcode'
533537
lines = [s for s in lines if lines != 'conftest.c:']
534-
535538
lines = [s for s in lines if len(s)]
539+
# nvcc
540+
lines = [s for s in lines if s.find('incompatible redefinition for option \'compiler-bindir\', the last value of this option was used') < 0]
536541
if lines: output = '\n'.join(lines)
537542
else: output = ''
538543
self.log.write("Compiler output after filtering:\n"+(output if not output else output+'\n'))
@@ -595,6 +600,7 @@ def filterLinkOutput(self, output, filterAlways = 0):
595600
lines = [s for s in lines if s.find('ld: warning: -undefined dynamic_lookup may not work with chained fixups') < 0]
596601
# Nvidia linker
597602
lines = [s for s in lines if s.find('nvhpc.ld contains output sections') < 0]
603+
lines = [s for s in lines if s.find('incompatible redefinition for option \'compiler-bindir\', the last value of this option was used') < 0]
598604
# Intel dpcpp linker
599605
# Ex. clang-offload-bundler: error: '/home/jczhang/mpich/lib': Is a directory
600606
lines = [s for s in lines if s.find('clang-offload-bundler: error:') < 0]

config/BuildSystem/config/functions.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def check(self, funcs, libraries = None, examineOutput=lambda ret,out,err:None):
2828
if isinstance(funcs, str): funcs = [funcs]
2929
self.log.write('Checking for functions ['+' '.join(funcs)+']\n')
3030
def genIncludes(funcName):
31-
return 'char %s();\n' % funcName
31+
return 'char %s(void);\n' % funcName
3232
def genBody(funcName):
3333
# The GNU C library defines __stub_* for functions that it implements
3434
# to always fail with ENOSYS. Some functions are actually named
@@ -112,7 +112,7 @@ def checkVSNPrintf(self):
112112
def checkSignalHandlerType(self):
113113
'''Checks the type of C++ signals handlers, and defines SIGNAL_CAST to the correct value'''
114114
self.pushLanguage('C++')
115-
if not self.checkLink('#include <signal.h>\nstatic void myhandler(int sig) {}\n', 'signal(SIGFPE,myhandler)'):
115+
if not self.checkLink('#include <signal.h>\nstatic void myhandler(int sig) { (void)sig; }\n', 'signal(SIGFPE,myhandler)'):
116116
self.addDefine('SIGNAL_CAST', '(void (*)(int))')
117117
else:
118118
self.addDefine('SIGNAL_CAST', ' ')
@@ -147,7 +147,7 @@ def checkMemmove(self):
147147

148148
def checkMmap(self):
149149
'''Check for functional mmap() to allocate shared memory and define HAVE_MMAP'''
150-
if self.checkLink('#include <sys/mman.h>\n#include <sys/types.h>\n#include <sys/stat.h>\n#include <fcntl.h>\n','int fd;\n fd=open("/tmp/file",O_RDWR);\n mmap((void*)0,100,PROT_READ|PROT_WRITE,MAP_SHARED,fd,0)'):
150+
if self.checkLink('#include <sys/mman.h>\n#include <sys/types.h>\n#include <sys/stat.h>\n#include <fcntl.h>\n','int fd;\n fd=open("/tmp/file",O_RDWR);\n mmap(NULL,100,PROT_READ|PROT_WRITE,MAP_SHARED,fd,0)'):
151151
self.addDefine('HAVE_MMAP', 1)
152152
return
153153

config/BuildSystem/config/libraries.py

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -575,13 +575,13 @@ def checkExportedSymbols(self, flags, checkLink = None, libraries = [], defaultA
575575
576576
#define PETSC_DLLEXPORT %s
577577
578-
extern PETSC_DLLEXPORT int foo() {
578+
extern PETSC_DLLEXPORT int foo(void) {
579579
return 42;
580580
}
581581
''' % (guard, visibility)
582582
body = '''
583583
void *lib;
584-
int (*foo)();
584+
int (*foo)(void);
585585
586586
lib = dlopen(NULL, RTLD_LAZY);
587587
if (!lib) {
@@ -627,6 +627,24 @@ def isBGL(self):
627627
self._isBGL = 0
628628
return self._isBGL
629629

630+
def checkPthreadMutex(self):
631+
'''Check for pthread mutex support'''
632+
funcs = ['pthread_mutex_unlock']
633+
prototypes = ['#include <pthread.h>']
634+
self.pthreadmutex = []
635+
calls = ['pthread_mutex_t m; pthread_mutex_unlock(&m)']
636+
if self.check('', funcs, prototype=prototypes, call=calls):
637+
self.logPrint('pthread mutex are linked in by default')
638+
self.pthreadmutex = []
639+
self.addDefine('HAVE_PTHREAD_MUTEX',1)
640+
elif self.check('pthread', funcs, prototype=prototypes, call=calls):
641+
self.logPrint('Using libpthread for the mutex')
642+
self.pthreadmutex = ['libpthread.a']
643+
self.addDefine('HAVE_PTHREAD_MUTEX',1)
644+
else:
645+
self.logPrint('No pthread mutex support found')
646+
return
647+
630648
def checkExecutableExportFlag(self):
631649
'''Checks for the flag that allows executables to export symbols to dlsym()'''
632650
# Right now, we just check some compilers, but we should make a test trying to load a symbol from the executable
@@ -648,6 +666,7 @@ def configure(self):
648666
self.executeTest(self.checkMathLog2)
649667
self.executeTest(self.checkRealtime)
650668
self.executeTest(self.checkDynamic)
669+
self.executeTest(self.checkPthreadMutex)
651670
if not self.argDB['with-batch']:
652671
self.executeTest(self.checkExecutableExportFlag)
653672
return

config/BuildSystem/config/package.py

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,13 +305,15 @@ def rmArgsPair(self,args,rejects,remove_ahead=True):
305305
return nargs
306306

307307
def rmArgsStartsWith(self,args,rejectstarts):
308+
'''Remove an argument that starts with given strings'''
308309
rejects = []
309310
if not isinstance(rejectstarts, list): rejectstarts = [rejectstarts]
310311
for i in rejectstarts:
311312
rejects.extend([arg for arg in args if arg.startswith(i)])
312313
return self.rmArgs(args,rejects)
313314

314315
def addArgStartsWith(self,args,sw,value):
316+
'''Adds another value with the argument that starts with sw, create sw if it does not exist'''
315317
keep = []
316318
found = 0
317319
for i in args:
@@ -323,13 +325,24 @@ def addArgStartsWith(self,args,sw,value):
323325
keep.append(sw+'="' + value + '"')
324326
return keep
325327

328+
def rmValueArgStartsWith(self,args,sw,value):
329+
'''Remove a value from arguements that start with sw'''
330+
if not isinstance(sw, list): sw = [sw]
331+
keep = []
332+
for i in args:
333+
for j in sw:
334+
if i.startswith(j+'="'):
335+
i = i.replace(value,'')
336+
keep.append(i)
337+
return keep
338+
326339
def removeWarningFlags(self,flags):
327340
flags = self.rmArgs(
328341
flags,
329342
{
330343
'-Werror', '-Wall', '-Wwrite-strings', '-Wno-strict-aliasing', '-Wno-unknown-pragmas',
331344
'-Wno-unused-variable', '-Wno-unused-dummy-argument', '-std=c89', '-pedantic','--coverage',
332-
'-Mfree', '-fdefault-integer-8', '-fsanitize=address', '-fstack-protector'
345+
'-Mfree', '-fdefault-integer-8', '-fsanitize=address', '-fstack-protector', '-Wconversion'
333346
}
334347
)
335348
return ['-g' if f == '-g3' else f for f in flags]
@@ -374,6 +387,13 @@ def removeCoverageFlag(self, flags, pair_prefix=None):
374387
"""Remove --coverage from flags."""
375388
return self.__remove_flag_pair(flags, '--coverage', pair_prefix)
376389

390+
def removeOpenMPFlag(self, flags, pair_prefix=None):
391+
"""Remove -fopenmp from flags."""
392+
if hasattr(self,'openmp') and hasattr(self.openmp,'ompflag'):
393+
return self.__remove_flag_pair(flags, self.openmp.ompflag, pair_prefix)
394+
else:
395+
return flags
396+
377397
def removeStdCxxFlag(self,flags):
378398
'''Remove the -std=[CXX_VERSION] flag from the list of flags, but only for CMake packages'''
379399
if issubclass(type(self),config.package.CMakePackage):

0 commit comments

Comments
 (0)