summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDom Heinzeller <dom.heinzeller@icloud.com>2024-05-03 12:38:33 -0600
committerGitHub <noreply@github.com>2024-05-03 11:38:33 -0700
commit272c7c069a9d148b55a531316c397eaf179f5574 (patch)
tree464a90d327d6fc68e4f3f2f39d49d901a645c0b2
parent23f16041cdff676166e3820ab84a9af1bd4912ef (diff)
downloadspack-272c7c069a9d148b55a531316c397eaf179f5574.tar.gz
spack-272c7c069a9d148b55a531316c397eaf179f5574.tar.bz2
spack-272c7c069a9d148b55a531316c397eaf179f5574.tar.xz
spack-272c7c069a9d148b55a531316c397eaf179f5574.zip
Add -fPIC to hdf-eos2 builds (#43794)
* Add -fPIC to hdf-eos2 builds * Use self.compiler.cc_pic_flag instead of -fPIC * Fix style in var/spack/repos/builtin/packages/hdf-eos2/package.py
-rw-r--r--var/spack/repos/builtin/packages/hdf-eos2/package.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/hdf-eos2/package.py b/var/spack/repos/builtin/packages/hdf-eos2/package.py
index 3eb9b7477b..76d8239934 100644
--- a/var/spack/repos/builtin/packages/hdf-eos2/package.py
+++ b/var/spack/repos/builtin/packages/hdf-eos2/package.py
@@ -160,4 +160,15 @@ class HdfEos2(AutotoolsPackage):
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