6 Commits

Author SHA1 Message Date
Graeme Winter 6ec2cd7437 First cut: use H5_USE_110_API
For #18 - compile against 1.10 API (may need to do more work to make sure this
does what we actually want)
2020-06-08 10:43:06 +01:00
Graeme Winter f25a73c667 Set to NULL after free; though fixes nothing 2020-04-02 14:21:52 +01:00
Tom Schoonjans 6165d14c31 Force linking against HDF5 shared library (#16) 2020-01-22 06:40:22 +00:00
Tom Schoonjans 19b16ad2a1 Fix sprintf usage (#15) 2020-01-21 10:52:49 +00:00
Graeme Winter 4e2b0c7506 Point at release 2019-05-08 09:28:59 +01:00
Charles Mita 34a38e15fd Update README.md 2019-01-29 19:58:27 +00:00
4 changed files with 44 additions and 18 deletions
+1 -1
View File
@@ -8,7 +8,7 @@ BSLZ4_BUILD_DIR = ./bslz4/build
BSLZ4_INC_DIR = $(BSLZ4_SRC_DIR)
CC=h5cc
CFLAGS=-Wall -g -O2 -fpic -I$(INC_DIR) -I$(BSLZ4_INC_DIR) -std=c89
CFLAGS=-DH5_USE_110_API -Wall -g -O2 -fpic -I$(INC_DIR) -I$(BSLZ4_INC_DIR) -std=c89 -shlib
.PHONY: plugin
plugin: $(BUILD_DIR)/durin-plugin.so
+34 -11
View File
@@ -8,6 +8,9 @@ See:
* https://www.dectris.com/features/features-eiger-x/hdf5-and-nexus
* https://strucbio.biologie.uni-konstanz.de/xdswiki
## Get Durin
Latest release at https://github.com/DiamondLightSource/durin/releases/tag/2019v1
## Usage
In your XDS.INP add:
@@ -29,26 +32,47 @@ series of datasets named `data_000001`, `data_000002`, etc.
## Building
First ensure that the HDF5 libraries are compiled with:
### Building HDF5 library
The HDF5 library used when building durin must have been compiled with specific switches enabled
to allow the durin plugin to be built and used.
Download the HDF5 source code (https://www.hdfgroup.org/downloads/hdf5/source-code) and extract
to any directory (referred to as `/hdf5_dir`), and run the following commands.
```
cd /hdf5_dir
mkdir build
cd build
export CFLAGS=-fPIC
./configure --enable-threadsafe=yes --enable-unsupported
../configure --enable-threadsafe --enable-deprecated-symbols --enable-hl --enable-unsupported
make
make check
make install
```
The hdf5 tools and libraries should now be located in `/hdf5_dir/build/hdf5`
former is neeed to ensure that XDS in parallel mode will work, latter
to ensure that the chunk read (which for opaque reasons is defined to
be _high level_) works. Then make sure that wherever this was
installed, the h5cc is in PATH before:
For reference, the plugin requires the thread-safe switch and the optimised chunk read function.
The chunk read function may be defined in the high level library instead of the regular library,
depending on the exact HDF5 version downloaded (hence the --enable-deprecated-symbols _and_ --enable-hl).
The unsupported flag enables building with both threadsafe and high-level enabled.
### Building durin plugin
The plugin makefile will use the "h5cc" compiler wrapper, provided by the HDF5 library, which
must be on your PATH.
Download or clone the plugin source code (https://github.com/DiamondLightSource/durin)
into any directory (referred to as `/durin_dir`) and run the following commands.
```
cd durin
cd /durin_dir
PATH=/hdf5_dir/build/hdf5/bin:$PATH
make
```
The plugin is located at `/durin_dir/build/durin-plugin.so` and should be added to the
XDS.INP file as `LIB=/durin_dir/build/durin-plugin.so`
Plugin file is `build/durin-plugin.so` - this should be added to the
XDS.INP file i.e. as:
## Example XDS.INP
```
DETECTOR=PILATUS MINIMUM_VALID_PIXEL_VALUE=0 OVERLOAD=4096
LIB=/opt/durin/build/durin-plugin.so
@@ -57,7 +81,6 @@ SENSOR_THICKNESS= 0.450
!SILICON= 3.953379
DIRECTION_OF_DETECTOR_X-AXIS= 1.00000 0.00000 0.00000
DIRECTION_OF_DETECTOR_Y-AXIS= 0.00000 1.00000 0.00000
NX=2070 NY=2164 QX=0.0750 QY=0.0750
DETECTOR_DISTANCE= 194.633000
ORGX= 1041.30 ORGY= 1160.90
ROTATION_AXIS= 0.00000 -1.00000 -0.00000
@@ -74,4 +97,4 @@ JOB=XYCORR INIT COLSPOT IDXREF DEFPIX INTEGRATE CORRECT
```
N.B. the master file is needed, not the .nxs one which follows the
standard.
standard.
+5 -5
View File
@@ -339,7 +339,7 @@ int get_dectris_eiger_dataset_dims(struct ds_desc_t *desc) {
ds_id = H5Dopen2(desc->data_g_id, ds_name, H5P_DEFAULT);
if (ds_id < 0) {
char message[64];
sprintf("Unable to open dataset %.16s", ds_name);
sprintf(message, "Unable to open dataset %.16s", ds_name);
ERROR_JUMP(-1, loop_end, message);
}
t_id = H5Dget_type(ds_id);
@@ -410,14 +410,14 @@ int read_pixel_info(hid_t g_id, const char *path, double *size) {
ds_id = H5Dopen2(g_id, path, H5P_DEFAULT);
if (ds_id < 0) {
char message[64];
sprintf("Error opening dataset %.32s", path);
sprintf(message, "Error opening dataset %.32s", path);
ERROR_JUMP(-1, done, message);
}
err = H5Dread(ds_id, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, &value);
if (err < 0) {
char message[64];
sprintf("Error reading dataset %.32s", path);
sprintf(message, "Error reading dataset %.32s", path);
ERROR_JUMP(-1, close_dataset, message);
}
@@ -429,8 +429,8 @@ int read_pixel_info(hid_t g_id, const char *path, double *size) {
double scale = 1;
a_id = H5Aopen(ds_id, "units", H5P_DEFAULT);
if (a_id < 0) {
char message[64];
sprintf("Error openeing units attribute for %.32s after existence check", path);
char message[100];
sprintf(message, "Error openeing units attribute for %.32s after existence check", path);
ERROR_JUMP(-1, close_dataset, message);
}
+4 -1
View File
@@ -238,7 +238,10 @@ void plugin_close(int *error_flag) {
}
file_id = 0;
if (mask_buffer) free(mask_buffer);
if (mask_buffer) {
free(mask_buffer);
mask_buffer = NULL;
}
if (data_desc->free_desc) {
data_desc->free_desc(data_desc);
data_desc = NULL;