aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2022-03-09 10:32:48 +0100
committerThomas White <taw@physics.org>2022-03-09 10:51:38 +0100
commitfa397e933d2ba0ecdfb94e6a9d876886598be9f5 (patch)
tree29ea8fed5cb0522f2e706fe20d6c7117225e5da9 /src
parent54752e2ce0a0d5c9ea0e8b6832affb4bc5ef6554 (diff)
Meson: enable building without HDF5
Diffstat (limited to 'src')
-rw-r--r--src/ambigator.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/ambigator.c b/src/ambigator.c
index fe4d5fa1..3777cf0a 100644
--- a/src/ambigator.c
+++ b/src/ambigator.c
@@ -43,7 +43,9 @@
#include <gsl/gsl_rng.h>
#include <gsl/gsl_permutation.h>
#include <gsl/gsl_randist.h>
+#ifdef HAVE_HDF5
#include <hdf5.h>
+#endif
#include <image.h>
#include <utils.h>
@@ -909,6 +911,7 @@ static void write_reindexed_stream(const char *infile, const char *outfile,
static void save_corr(const char *filename, struct cc_list *ccs, int n_crystals,
int *assignments)
{
+#ifdef HAVE_HDF5
hid_t fh, fsh, msh, cdh, rdh;
herr_t r;
hsize_t size[2];
@@ -1035,6 +1038,9 @@ static void save_corr(const char *filename, struct cc_list *ccs, int n_crystals,
H5Fclose(fh);
STATUS("Wrote correlation matrix in HDF5 format to %s\n", filename);
+#else
+ ERROR("Can't save correlation matrix - not compiled with HDF5\n");
+#endif
}