openblas and others: change flag_handler idiom to respect incoming flags (#46211)

* openblas: fix flag_handler to respect flags

* arpack-ng: fix flag_handler to respect flags

* czmq: fix flag_handler to respect flags

* flex: fix flag_handler to respect flags

* json-c: fix flag_handler to respect flags

* mpifileutils: fix flag_handler to respect flags

* netlib-scalapack: fix flag_handler to respect flags

* sed: fix flag_handler to respect flags

---------

Co-authored-by: Harmen Stoppels <me@harmenstoppels.nl>
This commit is contained in:
Greg Becker 2024-09-16 09:14:24 -07:00 committed by GitHub
parent 61d6c5486c
commit f4f59b7f18
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 19 additions and 27 deletions

View File

@ -93,16 +93,15 @@ class ArpackNg(CMakePackage, AutotoolsPackage):
def flag_handler(self, name, flags):
spec = self.spec
iflags = []
if name == "cflags":
if spec.satisfies("%oneapi"):
iflags.append("-Wno-error=implicit-function-declaration")
flags.append("-Wno-error=implicit-function-declaration")
if name == "fflags":
if self.spec.satisfies("%cce"):
iflags.append("-hnopattern")
flags.append("-hnopattern")
return (iflags, None, None)
return (flags, None, None)
@property
def libs(self):

View File

@ -32,12 +32,11 @@ class Czmq(AutotoolsPackage):
depends_on("libzmq")
def flag_handler(self, name, flags):
iflags = []
if name == "cflags":
if self.spec.satisfies("%oneapi@2022.2.0:"):
iflags.append("-Wno-error=gnu-null-pointer-arithmetic")
iflags.append("-Wno-error=strict-prototypes")
return (iflags, None, None)
flags.append("-Wno-error=gnu-null-pointer-arithmetic")
flags.append("-Wno-error=strict-prototypes")
return (flags, None, None)
def autoreconf(self, spec, prefix):
autogen = Executable("./autogen.sh")

View File

@ -65,11 +65,10 @@ class Flex(AutotoolsPackage):
def flag_handler(self, name, flags):
spec = self.spec
iflags = []
if name == "cflags":
if spec.satisfies("%oneapi"):
iflags.append("-Wno-error=implicit-function-declaration")
return (iflags, None, None)
flags.append("-Wno-error=implicit-function-declaration")
return (flags, None, None)
@classmethod
def determine_version(cls, exe):

View File

@ -48,11 +48,10 @@ def patch(self):
filter_file("-Werror", "", "CMakeLists.txt")
def flag_handler(self, name, flags):
iflags = []
if name == "cflags":
if self.spec.satisfies("%oneapi"):
iflags.append("-Wno-error=implicit-function-declaration")
return (iflags, None, None)
flags.append("-Wno-error=implicit-function-declaration")
return (flags, None, None)
@run_after("install")
def darwin_fix(self):

View File

@ -65,11 +65,10 @@ class Mpifileutils(CMakePackage):
def flag_handler(self, name, flags):
spec = self.spec
iflags = []
if name == "cflags":
if spec.satisfies("%oneapi"):
iflags.append("-Wno-error=implicit-function-declaration")
return (iflags, None, None)
flags.append("-Wno-error=implicit-function-declaration")
return (flags, None, None)
def cmake_args(self):
args = [

View File

@ -41,15 +41,14 @@ class ScalapackBase(CMakePackage):
patch("fix-build-macos.patch", when="@2.2.0")
def flag_handler(self, name, flags):
iflags = []
if name == "cflags":
if self.spec.satisfies("%gcc@14:"):
# https://bugzilla.redhat.com/show_bug.cgi?id=2178710
iflags.append("-std=gnu89")
flags.append("-std=gnu89")
elif name == "fflags":
if self.spec.satisfies("%cce"):
iflags.append("-hnopattern")
return (iflags, None, None)
flags.append("-hnopattern")
return (flags, None, None)
@property
def libs(self):

View File

@ -270,11 +270,10 @@ class Openblas(CMakePackage, MakefilePackage):
def flag_handler(self, name, flags):
spec = self.spec
iflags = []
if name == "cflags":
if spec.satisfies("@0.3.20: %oneapi") or spec.satisfies("@0.3.20: %arm"):
iflags.append("-Wno-error=implicit-function-declaration")
return (iflags, None, None)
flags.append("-Wno-error=implicit-function-declaration")
return (flags, None, None)
@classmethod
def determine_version(cls, lib):

View File

@ -44,8 +44,7 @@ def determine_version(cls, exe):
return match.group(1) if match else None
def flag_handler(self, name, flags):
iflags = []
if name == "cflags":
if self.spec.satisfies("%oneapi@2023.0.0:"):
iflags.append("-Wno-error=incompatible-function-pointer-types")
return (iflags, None, None)
flags.append("-Wno-error=incompatible-function-pointer-types")
return (flags, None, None)