hdf5: Clean up building self-tests (#3483)

* hdf5: Clean up building self-tests

* hdf5: Clean up running self-tests
This commit is contained in:
Erik Schnetter 2017-03-18 21:14:47 -04:00 committed by Adam J. Stewart
parent 4866b4592f
commit a0ab3c2523

View File

@ -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)