Skip to content

Commit

Permalink
Clean up redundant settings in var/spack/repos/builtin/packages/hdf-e…
Browse files Browse the repository at this point in the history
…os2/package.py
  • Loading branch information
climbfuji committed Jul 23, 2024
1 parent 54f00bb commit 537a0a1
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions var/spack/repos/builtin/packages/hdf-eos2/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,9 @@ def fix_configure(self):
filter_file("CC=./\\$SZIP_CC", "", "configure")

def flag_handler(self, name, flags):
if self.spec.compiler.name in ["apple-clang", "oneapi"]:
if name == "cflags":
if name == "cflags":
flags.append(self.compiler.cc_pic_flag)
if self.spec.compiler.name in ["apple-clang", "oneapi"]:
flags.append("-Wno-error=implicit-function-declaration")
flags.append("-Wno-error=implicit-int")

Expand Down Expand Up @@ -161,15 +162,4 @@ def configure_args(self):
if "zlib" in self.spec:
extra_args.append("--with-zlib={0}".format(self.spec["zlib-api"].prefix))

# https://forum.hdfgroup.org/t/help-building-hdf4-with-clang-error-implicit-declaration-of-function-test-mgr-szip-is-invalid-in-c99/7680
# -fPIC: https://github.com/spack/spack/issues/43792
if self.spec.satisfies("%apple-clang"):
extra_args.append(
"CFLAGS=-Wno-error=implicit-function-declaration {0}".format(
self.compiler.cc_pic_flag
)
)
else:
extra_args.append("CFLAGS={0}".format(self.compiler.cc_pic_flag))

return extra_args

0 comments on commit 537a0a1

Please sign in to comment.