summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--var/spack/repos/builtin/packages/hdf5/package.py14
1 files changed, 5 insertions, 9 deletions
diff --git a/var/spack/repos/builtin/packages/hdf5/package.py b/var/spack/repos/builtin/packages/hdf5/package.py
index 3b646f825c..15139db645 100644
--- a/var/spack/repos/builtin/packages/hdf5/package.py
+++ b/var/spack/repos/builtin/packages/hdf5/package.py
@@ -196,16 +196,12 @@ HDF5 version {version} {version}
with open("check.c", 'w') as f:
f.write(source)
if '+mpi' in spec:
- cc = which('%s' % spec['mpi'].mpicc)
+ cc = Executable(spec['mpi'].mpicc)
else:
- cc = which('cc')
- # TODO: Automate these path and library settings
- cc('-c', "-I%s" % join_path(spec.prefix, "include"), "check.c")
- cc('-o', "check", "check.o",
- "-L%s" % join_path(spec.prefix, "lib"),
- "-L%s" % join_path(spec.prefix, "lib64"),
- "-lhdf5",
- "-lz")
+ cc = Executable(self.compiler.cc)
+ cc(*(['-c', "check.c"] + spec['hdf5'].cppflags.split()))
+ cc(*(['-o', "check", "check.o"] +
+ spec['hdf5'].libs.ld_flags.split()))
try:
check = Executable('./check')
output = check(return_output=True)