Skip to content

Commit 1e9253b

Browse files
committed
Cherry-pick var/spack/repos/builtin/packages/hdf-eos2/package.py from spack/develop
1 parent 5d06b61 commit 1e9253b

File tree

1 file changed

+13
-3
lines changed
  • var/spack/repos/builtin/packages/hdf-eos2

1 file changed

+13
-3
lines changed

var/spack/repos/builtin/packages/hdf-eos2/package.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,9 @@ def fix_configure(self):
120120
filter_file("CC=./\\$SZIP_CC", "", "configure")
121121

122122
def flag_handler(self, name, flags):
123-
if name == "cflags":
124-
if self.spec.compiler.name == "apple-clang":
123+
if self.spec.compiler.name in ["apple-clang", "oneapi"]:
124+
if name == "cflags":
125125
flags.append("-Wno-error=implicit-function-declaration")
126-
flags.append(f"{self.compiler.cc_pic_flag}")
127126

128127
return flags, None, None
129128

@@ -161,4 +160,15 @@ def configure_args(self):
161160
if "zlib" in self.spec:
162161
extra_args.append("--with-zlib={0}".format(self.spec["zlib-api"].prefix))
163162

163+
# https://forum.hdfgroup.org/t/help-building-hdf4-with-clang-error-implicit-declaration-of-function-test-mgr-szip-is-invalid-in-c99/7680
164+
# -fPIC: https://github.com/spack/spack/issues/43792
165+
if self.spec.satisfies("%apple-clang"):
166+
extra_args.append(
167+
"CFLAGS=-Wno-error=implicit-function-declaration {0}".format(
168+
self.compiler.cc_pic_flag
169+
)
170+
)
171+
else:
172+
extra_args.append("CFLAGS={0}".format(self.compiler.cc_pic_flag))
173+
164174
return extra_args

0 commit comments

Comments
 (0)