diff options
-rw-r--r-- | deps/meson.build | 14 | ||||
-rw-r--r-- | meson.build | 36 | ||||
-rw-r--r-- | meson_options.txt | 4 | ||||
-rw-r--r-- | src/config.h.meson.in | 4 | ||||
-rw-r--r-- | src/meson.build | 199 |
5 files changed, 257 insertions, 0 deletions
diff --git a/deps/meson.build b/deps/meson.build new file mode 100644 index 0000000..26feadd --- /dev/null +++ b/deps/meson.build @@ -0,0 +1,14 @@ +oclfft_lib = shared_library('oclfft', + sources: [ + 'oclfft/fft_execute.cpp', + 'oclfft/fft_kernelstring.cpp', + 'oclfft/fft_setup.cpp', + ], + dependencies: deps, + install: true, +) + +oclfft_dep = declare_dependency( + include_directories: include_directories('oclfft'), + link_with: oclfft_lib, +) diff --git a/meson.build b/meson.build new file mode 100644 index 0000000..62fcacb --- /dev/null +++ b/meson.build @@ -0,0 +1,36 @@ +project('ufo-filters', + ['c', 'cpp'], + version: '0.13.0' +) + +version = meson.project_version() +components = version.split('.') +version_major = components[0] +version_minor = components[1] +version_patch = components[2] + +cc = meson.get_compiler('c') + +add_global_arguments( + '-DGLIB_DISABLE_DEPRECATION_WARNINGS', + '-DCL_USE_DEPRECATED_OPENCL_1_1_APIS', + '-DCL_USE_DEPRECATED_OPENCL_1_2_APIS', + language: 'c' +) + +if cc.get_id() == 'gcc' + add_global_arguments('-fopenmp', language: 'c') +endif + +opencl_dep = declare_dependency(dependencies: cc.find_library('OpenCL')) +ufo_dep = dependency('ufo', version: '>= 0.12') + +plugin_install_dir = ufo_dep.get_pkgconfig_variable('plugindir') + +deps = [ + ufo_dep, + opencl_dep, +] + +subdir('deps') +subdir('src') diff --git a/meson_options.txt b/meson_options.txt new file mode 100644 index 0000000..c22e664 --- /dev/null +++ b/meson_options.txt @@ -0,0 +1,4 @@ +option('lamino_backproject_burst_mode', + type: 'combo', + choices: ['1', '2', '4', '8', '16'], + value: '16') diff --git a/src/config.h.meson.in b/src/config.h.meson.in new file mode 100644 index 0000000..ec900c2 --- /dev/null +++ b/src/config.h.meson.in @@ -0,0 +1,4 @@ +#define HAVE_OCLFFT +#mesondefine HAVE_TIFF +#mesondefine HAVE_JPEG +#mesondefine WITH_HDF5 diff --git a/src/meson.build b/src/meson.build new file mode 100644 index 0000000..eacd16d --- /dev/null +++ b/src/meson.build @@ -0,0 +1,199 @@ +plugins = [ + 'average', + 'backproject', + 'bin', + 'binarize', + 'blur', + 'buffer', + 'calculate', + 'clip', + 'crop', + 'cut', + 'cut-sinogram', + 'center-of-rotation', + 'concatenate-result', + 'contrast', + 'correlate-stacks', + 'dfi-sinc', + 'denoise', + 'detect-edge', + 'rescale', + 'dummy-data', + 'dump-ring', + 'duplicate', + 'filter', + 'flatten', + 'flatten-inplace', + 'flat-field-correct', + 'fftmult', + 'filter-particle', + 'filter-stripes', + 'filter-stripes1d', + 'flip', + 'forwardproject', + 'get-dup-circ', + 'interpolate', + 'loop', + 'map-slice', + 'measure-sharpness', + 'median-filter', + 'memory-in', + 'memory-out', + 'merge', + 'metaballs', + 'monitor', + 'null', + 'opencl', + 'ordfilt', + 'pad', + 'polar-coordinates', + 'reduce', + 'refeed', + 'remove-circle', + 'ring-pattern', + 'ringwriter', + 'replicate', + 'sleep', + 'slice', + 'stack', + 'stdin', + 'transpose', + 'transpose-projections', + 'swap-quadrants', + 'subtract', + 'volume-render', + 'zeropad', +] + +fft_plugins = [ + 'fft', + 'ifft', + 'retrieve-phase', +] + +read_sources = [ + 'ufo-read-task.c', + 'readers/ufo-reader.c', + 'readers/ufo-edf-reader.c', + 'readers/ufo-raw-reader.c', +] + +write_sources = [ + 'ufo-write-task.c', + 'writers/ufo-writer.c', + 'writers/ufo-raw-writer.c', +] + +tiff_dep = dependency('libtiff-4', required: false) +hdf5_dep = dependency('hdf5', required: false) +jpeg_dep = dependency('libjpeg', required: false) +gsl_dep = dependency('gsl', required: false) + +conf = configuration_data() +conf.set('HAVE_TIFF', tiff_dep.found()) +conf.set('HAVE_JPEG', jpeg_dep.found()) +conf.set('WITH_HDF5', hdf5_dep.found()) + +configure_file( + input: 'config.h.meson.in', + output: 'config.h', + configuration: conf, +) + +# standard plugins + +foreach plugin: plugins + name = ''.join(plugin.split('-')) + + shared_module(name, + 'ufo-@0@-task.c'.format(plugin), + dependencies: deps, + name_prefix: 'libufofilter', + install: true, + install_dir: plugin_install_dir, + ) +endforeach + +# fft plugins + +common_fft = static_library('commonfft', + 'common/ufo-fft.c', + dependencies: deps + [oclfft_dep] +) + +foreach plugin: fft_plugins + name = ''.join(plugin.split('-')) + + shared_module(name, + 'ufo-@0@-task.c'.format(plugin), + dependencies: deps, + name_prefix: 'libufofilter', + link_with: common_fft, + install: true, + install_dir: plugin_install_dir, + ) +endforeach + +# lamino plugin + +shared_module('lamino_backproject', + sources: ['ufo-lamino-backproject-task.c'], + dependencies: deps, + name_prefix: 'libufofilter', + install: true, + install_dir: plugin_install_dir, + c_args: [ + '-DBURST=@0@'.format(get_option('lamino_backproject_burst_mode')), + ], +) + +# i/o plugins + +read_deps = deps +write_deps = deps + +if tiff_dep.found() + read_sources += ['readers/ufo-tiff-reader.c'] + read_deps += [tiff_dep] + + write_sources += ['writers/ufo-tiff-writer.c'] + write_deps += [tiff_dep] +endif + +if hdf5_dep.found() + read_sources += ['readers/ufo-hdf5-reader.c'] + read_deps += [hdf5_dep] + + write_sources += ['writers/ufo-hdf5-writer.c'] + write_deps += [hdf5_dep] +endif + +if jpeg_dep.found() + write_sources += ['writers/ufo-jpeg-writer.c'] + write_deps += [jpeg_dep] +endif + +shared_module('read', + sources: read_sources, + dependencies: read_deps, + name_prefix: 'libufofilter', + install: true, + install_dir: plugin_install_dir, +) + +shared_module('write', + sources: write_sources, + dependencies: write_deps, + name_prefix: 'libufofilter', + install: true, + install_dir: plugin_install_dir, +) + +if gsl_dep.found() + shared_module('measure', 'ufo-measure-task.c', + dependencies: deps + [gsl_dep], + name_prefix: 'libufofilter', + install: true, + install_dir: plugin_install_dir, + ) +endif |