Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,20 @@ project('nixl', 'CPP', version: '0.6.1',
meson_version: '>= 0.64.0'
)

build_plugins_opt = get_option('build_plugins')
enabled_plugins = build_plugins_opt == '' ? [] : build_plugins_opt.split(',')

should_build_plugin = {}
Copy link
Contributor

@ovidiusm ovidiusm Nov 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should_build_plugin should be called enabled_plugins IMO

foreach plugin : ['UCX', 'UCX_MO', 'LIBFABRIC', 'POSIX', 'OBJ', 'GDS', 'GDS_MT', 'MOONCAKE', 'Mooncake', 'HF3FS', 'GUSLI', 'GPUNETIO']
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's make a list all_plugins and do case insensitive comparison to avoid duplicates

should_build_plugin += {plugin: enabled_plugins.length() == 0 or plugin in enabled_plugins}
endforeach

if enabled_plugins.length() == 0
message('Building all available plugins')
else
message('Building only selected plugins: ' + build_plugins_opt)
endif

# set up some global vars for compiler, platform, configuration, etc.
cpp = meson.get_compiler('cpp')
fs = import('fs')
Expand Down
1 change: 1 addition & 0 deletions meson_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ option('cudapath_inc', type: 'string', value: '', description: 'Include path for
option('cudapath_lib', type: 'string', value: '', description: 'Library path for CUDA')
option('cudapath_stub', type: 'string', value: '', description: 'Extra Stub path for CUDA')
option('static_plugins', type: 'string', value: '', description: 'Plugins to be built-in, comma-separated')
option('build_plugins', type: 'string', value: '', description: 'List of plugins to build, comma-separated. Default (empty) builds all available plugins')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we name this plugins?

option('build_docs', type: 'boolean', value: false, description: 'Build Doxygen documentation')
option('log_level', type: 'combo', choices: ['trace', 'debug', 'info', 'warning', 'error', 'fatal', 'auto'], value: 'auto', description: 'Log Level (auto: auto-detect based on build type: trace for debug builds, info for release builds)')
option('rust', type: 'boolean', value: false, description: 'Build Rust bindings')
Expand Down
31 changes: 19 additions & 12 deletions src/plugins/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -13,48 +13,55 @@
# See the License for the specific language governing permissions and
# limitations under the License.

ucx_backend_inc_dirs = include_directories('./ucx')

if ucx_dep.found()
if ucx_dep.found() and should_build_plugin.get('UCX')
subdir('ucx')
endif

if ucx_dep.found() and should_build_plugin.get('UCX_MO')
ucx_backend_inc_dirs = include_directories('./ucx')
subdir('ucx_mo')
endif

subdir('posix') # Always try to build POSIX backend, it will handle its own dependencies
subdir('obj') # Always try to build Obj backend, it will handle its own dependencies
if should_build_plugin.get('POSIX')
subdir('posix')
endif

if should_build_plugin.get('OBJ')
subdir('obj')
endif

if libfabric_dep.found()
if libfabric_dep.found() and should_build_plugin.get('LIBFABRIC')
subdir('libfabric')
endif

disable_gds_backend = get_option('disable_gds_backend')
if not disable_gds_backend and cuda_dep.found()
if not disable_gds_backend and cuda_dep.found() and should_build_plugin.get('GDS')
subdir('cuda_gds')
endif

if taskflow_proj.found() and cuda_dep.found() and not disable_gds_backend
if taskflow_proj.found() and cuda_dep.found() and not disable_gds_backend and should_build_plugin.get('GDS_MT')
subdir('gds_mt')
endif

cc = meson.get_compiler('cpp')
libtransfer_engine = cc.find_library('transfer_engine', required: false)
if libtransfer_engine.found() and not get_option('disable_mooncake_backend')
if libtransfer_engine.found() and not get_option('disable_mooncake_backend') and (should_build_plugin.get('MOONCAKE') or should_build_plugin.get('Mooncake'))
subdir('mooncake')
endif

hf3fs_lib_path = '/usr/lib/'
hf3fs_lib_file = 'hf3fs_api_shared'
hf3fs_lib_found = cc.find_library(hf3fs_lib_file, dirs: [hf3fs_lib_path], required: false)
if hf3fs_lib_found.found()
if hf3fs_lib_found.found() and should_build_plugin.get('HF3FS')
subdir('hf3fs')
endif

gusli_lib_file = 'gusli_clnt'
gusli_lib_found = cc.find_library(gusli_lib_file, required: false)
if gusli_lib_found.found()
if gusli_lib_found.found() and should_build_plugin.get('GUSLI')
subdir('gusli')
endif

if cuda_dep.found() and doca_gpunetio_dep.found()
if cuda_dep.found() and doca_gpunetio_dep.found() and should_build_plugin.get('GPUNETIO')
subdir('gpunetio')
endif
5 changes: 5 additions & 0 deletions test/gtest/plugins/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.

if not should_build_plugin.get('OBJ')
message('OBJ plugin not enabled, skipping plugins_gtest build')
subdir_done()
endif

aws_s3 = dependency('aws-cpp-sdk-s3', static: false, required: false)
if not aws_s3.found()
message('aws-cpp-sdk-s3 not found, skipping plugins_gtest build')
Expand Down
22 changes: 13 additions & 9 deletions test/unit/plugins/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -13,44 +13,48 @@
# See the License for the specific language governing permissions and
# limitations under the License.

if ucx_dep.found()
if ucx_dep.found() and should_build_plugin.get('UCX')
subdir('ucx')
endif

if ucx_dep.found() and should_build_plugin.get('UCX_MO')
subdir('ucx_mo')
endif
subdir('posix')

if should_build_plugin.get('POSIX')
subdir('posix')
endif

if cuda_dep.found() and doca_gpunetio_dep.found()
if cuda_dep.found() and doca_gpunetio_dep.found() and should_build_plugin.get('GPUNETIO')
subdir('gpunetio')
endif


disable_gds_backend = get_option('disable_gds_backend')
if not disable_gds_backend
if not disable_gds_backend and should_build_plugin.get('GDS')
subdir('cuda_gds')
endif

if taskflow_proj.found()
if taskflow_proj.found() and should_build_plugin.get('GDS_MT')
subdir('gds_mt')
endif

cc = meson.get_compiler('cpp')
libtransfer_engine = cc.find_library('transfer_engine', required: false)
disable_mooncake_backend = get_option('disable_mooncake_backend')
if libtransfer_engine.found() and not disable_mooncake_backend
if libtransfer_engine.found() and not disable_mooncake_backend and (should_build_plugin.get('MOONCAKE') or should_build_plugin.get('Mooncake'))
subdir('mooncake')
endif

hf3fs_lib_path = '/usr/lib/'
hf3fs_lib_file = 'hf3fs_api_shared'
hf3fs_lib_found = cc.find_library(hf3fs_lib_file, dirs: [hf3fs_lib_path], required: false)
if hf3fs_lib_found.found()
if hf3fs_lib_found.found() and should_build_plugin.get('HF3FS')
subdir('hf3fs')
endif

gusli_lib_path = '/usr/lib/'
gusli_lib_file = 'gusli_clnt'
gusli_lib_found = cc.find_library(gusli_lib_file, dirs: [gusli_lib_path], required: false)
if gusli_lib_found.found()
if gusli_lib_found.found() and should_build_plugin.get('GUSLI')
subdir('gusli')
endif