From a0ab3c2523d0d209803f2126ae218783d1dc93e6 Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Sat, 18 Mar 2017 21:14:47 -0400 Subject: [PATCH] hdf5: Clean up building self-tests (#3483) * hdf5: Clean up building self-tests * hdf5: Clean up running self-tests --- var/spack/repos/builtin/packages/hdf5/package.py | 14 +++++--------- 1 file 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 3b646f825cd..15139db645c 100644 --- a/var/spack/repos/builtin/packages/hdf5/package.py +++ b/var/spack/repos/builtin/packages/hdf5/package.py @@ -196,16 +196,12 @@ def check_install(self): 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)