LIB: Difference between revisions

Glue code: make strlen a 64bit integer !
m Glue code: change X*Y*DEPTH to X*Y*NBYTE
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
The possibility of using external libraries (that are loaded at runtime) has been available in C/C++ for a long time, but in Fortran became only available as of Fortran2003.  
The possibility of using external libraries (that are loaded at runtime) has been available in C/C++ for a long time, but in Fortran became only available as of Fortran2003.  


In the case of XDS, frame-reading and computation can be separated starting with version November-2016. This allows users/companies to develop their own specialized frame-reading libraries, and relieves the XDS maintainers from implementing even more file formats. The feature was developed in order to be able to natively (i.e. without temporary intermediates) read the HDF5 files written for data from the [[Eiger]] detector.
In the case of XDS, frame-reading and computation can be separated starting with version November-2016. The [https://xds.mr.mpg.de/html_doc/xds_parameters.html#LIB= LIB=] keyword allows users/companies to develop their own specialized frame-reading libraries, and relieves the XDS maintainers from implementing even more file formats. The feature was developed in order to be able to natively (i.e. without temporary intermediates) read the HDF5 files written for data from the [[Eiger]] detector.


In the following, small examples are given for
In the following, small examples are given for
Line 129: Line 129:
! or
! or
! gfortran -fpic test_generic_client.f90 -shared -o libtest_generic_client.so
! gfortran -fpic test_generic_client.f90 -shared -o libtest_generic_client.so
! (this does not include the compiler's libgfortran.so and libquadmath.so into the library; don't know how to achieve this so
! (adding -static-libgfortran and -static-libquadmath should put these into the library as well so that it can be distributed.
! gfortran is only useful if it is anyway installed on the machine)
! This requires a gfortran version higher than 12. For older gfortran versions, libgfortran.so and libquadmath.so can be
! renamed to something that the linker does not search for; it will then include libgfortran.a and libquadmath.a)
! The resulting file can be used with a LIB=./libtest_generic_client.so line in XDS.INP, and enables
! The resulting file can be used with a LIB=./libtest_generic_client.so line in XDS.INP, and enables
! reading of data files with a 7680 bytes header plus 1024*1024 pixels of integer data, without any record structure.
! reading of data files with a 7680 bytes header plus 1024*1024 pixels of integer data, without any record structure.
Line 531: Line 532:
     !  'NX' (integer)                  output  Number of pixels along X  
     !  'NX' (integer)                  output  Number of pixels along X  
     !  'NY' (integer)                  output  Number of pixels along Y
     !  'NY' (integer)                  output  Number of pixels along Y
     !  'NBYTE' (integer)              output  Number of bytes in the image... X*Y*DEPTH
     !  'NBYTE' (integer)              output  Number of bytes in the image is X*Y*NBYTE
     !  'QX' (4*REAL)                  output  Pixel size
     !  'QX' (4*REAL)                  output  Pixel size
     !  'QY' (4*REAL)                  output  Pixel size
     !  'QY' (4*REAL)                  output  Pixel size
Line 687: Line 688:


# [https://github.com/dectris/neggia Dectris Neggia-plugin] to read HDF5 written by Dectris-supplied software of Eiger detectors
# [https://github.com/dectris/neggia Dectris Neggia-plugin] to read HDF5 written by Dectris-supplied software of Eiger detectors
# [https://github.com/DiamondLightSource/durin Diamond's Durin-plugin] to read HDF5 written by Eiger detectors at Diamond (and presumably elsewhere); latest binaries for MacOS and Linux (RHEL6) as well as example XDS.INP and source at https://github.com/DiamondLightSource/durin/releases/latest
# [https://github.com/DiamondLightSource/durin Diamond's Durin-plugin] to read HDF5 written by Eiger detectors at Diamond (and presumably elsewhere); latest binaries for MacOS and Linux (RHEL6) as well as example XDS.INP and source at https://github.com/DiamondLightSource/durin/releases/latest . A binary for M1 Mac is available - see [[Installation]]
# [https://git.embl.de/nikolova/xds-zcbf/ EMBL-Hamburg's zcbf-plugin] to read gzip-compressed CBF files without intermediate file
# [https://git.embl.de/nikolova/xds-zcbf/ EMBL-Hamburg's zcbf-plugin] to read gzip-compressed CBF files without intermediate file . A binary for M1 Mac is available - see [[Installation]].
 
Plugins for Linux and Intel-Mac can also be obtained through [https://www.globalphasing.com/autoproc/ GPhL's autoPROC].
 
See also [[Installation]].


== See also ==
== See also ==
# https://rosettacode.org/wiki/Call_a_function_in_a_shared_library#GNU_Fortran_on_Linux
# https://rosettacode.org/wiki/Call_a_function_in_a_shared_library#GNU_Fortran_on_Linux